# User Access
The platform provides capabilities to users that can only be accessed through authentication using APPID+AppKey. Therefore, before using the AIGC video and content generation platform, please prepare your platform account. The platform account offers a callback address configuration feature, which enables the completion of message notification through the calling of an API provided by the user upon the completion of long-duration tasks.
# Account Introduction
Account Activation
- Currently, user accounts do not support self-registration services. You can contact the operator with your basic information (contact person/contact information/company information, etc.). The operator will activate the account and carry out the relevant content configuration.
Obtaining Account Information
- The account information of a user includes basic information and resource configuration, which can be obtained in real-time through our provided API interface.
- Basic Information: Includes account ID, company name, service validity period start and end times, as well as APPID and AppKey information.
- Resource Configuration: Includes the total available amount of character image models that can be generated, the total amount of character image models that have been used, the total available amount of TTS personal voice models that can be generated, the total amount of TTS personal voice models that have been used, the total available duration of videos that can be generated, the total duration of videos that have been used, the maximum concurrent task number for character image models, the used maximum concurrent task number for character image models, the maximum concurrent task number for TTS personal voice model generation, the used maximum concurrent task number for TTS personal voice model generation, the maximum concurrent task number for video generation, and the used maximum concurrent task number for video generation, etc.
- The account information of a user includes basic information and resource configuration, which can be obtained in real-time through our provided API interface.
User Authentication
- The platform provides an interface for various systems to obtain tokens during the identity legitimacy verification phase. User authentication is completed using a signature generated by encrypting appId, timestamp, and appKey, and authentication is required to use related services.
- To call all API services of the platform, access service entry point: aigc.softsugar.com, and add token information in the request header (The token is obtained by encrypting appId, timestamp, appKey to generate a signature 【MD5(appId+timestamp+appKey)】, with the MD5 result being a 32-bit lowercase value. This token must be added to subsequent interface requests, added as Header: Authorization: Bearer {token}).
# API Description
# Third-Party System Access Login
# Interface Description
An interface for various systems to obtain tokens during the identity legitimacy verification phase. The signature is generated by encrypting appId, timestamp, and appKey 【MD5(appId+timestamp+appKey)】, with the MD5 result being a 32-bit lowercase value. The token must be added to subsequent interface requests, added as Header: Authorization: Bearer {token}.
# Request URL
POST
/api/uc/v1/access/api/token
# Request Header
Content-Type:
application/json
# Request Parameters
JSON array format, with the fields of the objects in the array defined as follows:
Field | Type | Required | Description |
---|---|---|---|
appId | String | True | app id (Used for user access authentication) |
timestamp | String | True | Current timestamp, accurate to milliseconds |
sign | String | True | Generated signature (The MD5 value converted to a hexadecimal string. If the converted byte number is insufficient, pad with zeros in front) |
grantType | String | True | Authentication type (Fixed value ‘sign’) |
# Request Example
{
"appId": "ID",
"timestamp": "1676797061518",
"sign": "c4b08ca7d242939b8bf9c1dbb1a1911a",
"grantType": "sign"
}
# Response Elements
Field | Type | Required | Description |
---|---|---|---|
code | Integer | True | 0 - Success, Others - Exception |
message | String | True | Detailed information about the exception |
data | Object | True | Data object, null if there's an error |
- permissions | Object[] | True | Array of permission objects |
- roles | Object[] | True | Array of role objects |
- accessToken | String | True | Access token, valid for 8 hours by default, returning the original token upon multiple retrievals within its validity period |
- expiresIn | Integer | True | Remaining life cycle of the access token, in seconds |
- refreshToken | String | True | Refresh Token |
- refreshTokenExpiresIn | Integer | True | Remaining life cycle of the refreshToken, in seconds |
- user | Object | True | User information object |
permissions
Field | Type | Required | Description |
---|---|---|---|
id | Long | True | Permission id |
appId | Long | True | System application id |
resourceId | Integer | True | Resource id |
action | Integer | True | Permission type (0: All, 1: Create, 2: Modify, 3: Delete, 4: Query) |
creator | Long | True | Creator id |
createTime | String | True | Creation time, yyyy-MM-dd HH:mm:ss |
roles
Field | Type | Required | Description |
---|---|---|---|
id | Long | True | Role id |
roleName | String | True | Role name |
appId | Long | True | System application id |
description | String | False | Description |
isDelete | Integer | True | Deletion mark (0: Not deleted; 1: Deleted) |
creator | Long | True | Creator id |
createTime | String | True | Creation time, yyyy-MM-dd HH:mm:ss |
updater | Long | True | Updater id |
updateTime | String | True | Update time, yyyy-MM-dd HH:mm:ss |
user
Field | Type | Required | Description |
---|---|---|---|
id | Long | True | User id |
userName | String | True | User name |
profilePhoto | String | False | Personal photo |
company | String | False | Company name |
companyPhone | String | False | Company phone |
companyContact | String | False | Company contact address |
status | Integer | True | Account status (0: Not open; 1: Enabled; 2: Disabled) |
effectiveBeginDate | Date | True | Effective start time, yyyy-MM-dd HH:mm:ss |
effectiveEndDate | Date | True | Effective end time, yyyy-MM-dd HH:mm:ss |
extraInfo | String | False | Additional information |
description | String | False | Description |
appId | String | True | app id |
appKey | String | True | app key |
licensePath | String | False | License path |
isDelete | Integer | True | Deletion mark (0: Not deleted; 1: Deleted) |
creator | Long | True | Creator id |
createTime | String | True | Creation time, yyyy-MM-dd HH:mm:ss |
updater | Long | True | Updater id |
updateTime | String | True | Update time, yyyy-MM-dd HH:mm:ss |
# Response Example
{
"code": 0,
"message": "success",
"data": {
"permissions": [
{
"id": 1,
"appId": "虚拟人应用",
"resourceId": 1,
"action": null,
"creator": 1,
"createTime": "2022-05-23 15:12:35"
}
],
"roles": [
{
"id": 3,
"roleName": "企业",
"appId": 1,
"description": null,
"isDelete": 0,
"creator": 1,
"createTime": "2022-05-23 15:12:35",
"updater": 1,
"updateTime": "2022-05-23 15:12:35"
}
],
"accessToken": "ZGI3YzRiZmY4ZmFjMjM2MDExODUxNDdmY2MwNGY4OTA0NGRmNGNjYi1jNGNmLTRlMTEtOTExOC05YTU0YTM2NjFjODY",
"user": {
"id": 4,
"userName": "企业1",
"profilePhoto": null,
"company": null,
"companyPhone": null,
"companyContact": null,
"status": 1,
"effectiveBeginDate": null,
"effectiveEndDate": null,
"extraInfo": null,
"description": null,
"appId": null,
"appKey": null,
"licensePath": null,
"isDelete": 0,
"creator": 1,
"createTime": "2022-05-23 15:13:03",
"updater": 1,
"updateTime": "2022-05-24 14:26:05"
}
}
}
# User Token Refresh
# Interface Description
Actively refresh the user Access Token to obtain a new Access Token and Refresh Token, and recalculate the validity period of the Access Token. Note: The value of the Authorization parameter when calling this interface should be the Refresh Token. The interval between two calls to the token refresh interface must not be less than 3 hours, otherwise, it will prompt "refresh token too frequent, limit interval to 3 hours".
# Request URL
POST
/api/uc/v1/access/api/token/refresh
# Request Headers
Content-Type:
application/json
Header: Authorization: Bearer {refresh token}
# Request Parameters
Field | Type | Required | Description |
---|---|---|---|
appId | String | True | app id (ID used for user access authentication) |
grantType | String | True | Authentication type (fixed value ‘refreshToken’) |
# Request Example
{
"appId": "APP ID",
"grantType": "refreshToken"
}
# Response Elements
Field | Type | Required | Description |
---|---|---|---|
code | Integer | True | 0 - Success, others - Exception |
message | String | True | Detailed information of the exception |
data | Object | False | Data object, returns null on error |
- accessToken | String | True | Access token, default validity period is 8 hours |
- expiresIn | Integer | True | Remaining life span of the access token, in seconds |
- refreshToken | String | True | Refresh Token |
- refreshTokenExpiresIn | Integer | True | Remaining life span of the refresh token, in seconds |
# User Logout
# Interface Description
Complete some cache information cleanup work when the user logs out of the system.
# Request URL
POST
/api/uc/v1/web/logout
# Request Headers
Content-Type:
application/json
# Request Parameters
None
# Request Example
None
# Response Elements
Field | Type | Required | Description |
---|---|---|---|
code | Integer | True | 0 - Success, others - Exception |
message | String | True | Detailed information of the exception |
data | Object | False | Success or not, 1 for success, returns 0 or null on error |
# Response Example
{
"code": 0,
"message": "success",
"data": 1
}
# Get Account Basic Information and Resource Configuration Information
# Interface Description
When an administrator creates an account, they fill in a series of basic information and resource configuration information. This part of the information supports user access. This interface is for obtaining account basic information and resource configuration and usage through the account ID.
# Request URL
GET
/api/2dvh/v1/user/config/resource?userId={userId}
# Request Headers
Content-Type:
application/x-www-form-urlencode
# Request Parameters
Field | Type | Required | Description |
---|---|---|---|
userId | Long | True | Account id |
# Request Example
https://xxx.softsugar.com/api/2dvh/v1/user/config/resource?userId=2
# Response Elements
Field | Type | Required | Description |
---|---|---|---|
code | Integer | True | 0 - Success, others - Exception |
message | String | True | Detailed information of the exception |
data | Object | False | Data object, returns null on error |
- basicInfo | Object | True | Account basic information |
- resourceConfig | Object | True | Account resource configuration and usage information |
Basic Information
Field | Type | Required | Description |
---|---|---|---|
id | Integer | True | id |
company | String | True | Company name |
effectiveBeginDate | Date | True | Service effective start date, yyyy-MM-dd HH:mm:ss |
effectiveEndDate | Date | True | Service effective end date, yyyy-MM-dd HH:mm:ss |
appId | String | True | APP id (ID used for user access authentication) |
appKey | String | True | APP key |
Resource Configuration and Usage Information
Field | Type | Required | Description |
---|---|---|---|
id | Long | True | id |
genCharModelTotalQty | Integer | True | Total available quantity of character models that can be generated |
genCharModelUsageQty | Integer | True | Total used quantity of character models that have been generated |
genTtsCharVoiceModelTotalQty | Integer | True | Total available quantity of TTS personal voice models that can be generated |
genTtsCharVoiceModelUsageQty | Integer | True | Total used quantity of TTS personal voice models that have been generated |
genVideoDurationTotalQty | Integer | True | Total available duration of videos that can be generated, in seconds |
genVideoDurationUsageQty | Integer | True | Total used duration of videos that have been generated, in seconds |
charModelMaxConTasksTotalQty | Integer | True | Total available quantity of maximum concurrent tasks for character model generation |
charModelMaxConTasksUsageQty | Integer | True | Total used quantity of maximum concurrent tasks for character model generation |
ttsCharVoiceModelMaxConTasksTotalQty | Integer | True | Total available quantity of maximum concurrent tasks for TTS personal voice model generation |
ttsCharVoiceModelMaxConTasksUsageQty | Integer | True | Total used quantity of maximum concurrent tasks for TTS personal voice model generation |
videoGenMaxConTasksTotalQty | Integer | True | Total available quantity of maximum concurrent tasks for video generation |
videoGenMaxConTasksUsageQty | Integer | True | Total used quantity of maximum concurrent tasks for video generation |
# Response Example
{
"code": 0,
"message": "success",
"data": {
"basicInfo": {
"id": 1,
"company": "zhangsan",
"effectiveBeginDate": "2019-01-01 20:20:20",
"effectiveEndDate": "2019-01-01 20:20:20",
"appId": "7sadf7sadf7ads7f7asf7sda7f",
"appKey": "7sadf7sadf7ads7f7asf7sda7f"
},
"resourceConfig": {
"id": 1,
"genCharModelTotalQty": 12,
"genCharModelUsageQty": 2,
"genTtsCharVoiceModelTotalQty": 12,
"genTtsCharVoiceModelUsageQty": 2,
"genVideoDurationTotalQty": 21,
"genVideoDurationUsageQty": 11,
"charModelMaxConTasksTotalQty": 12,
"charModelMaxConTasksUsageQty": 3,
"ttsCharVoiceModelMaxConTasksTotalQty": 11,
"ttsCharVoiceModelMaxConTasksUsageQty": 4,
"videoGenMaxConTasksTotalQty": 11,
"videoGenMaxConTasksUsageQty": 7
}
}
}
This covers the preparations required for users to access and use the platform services.