Last Updated on : 2025-05-30 01:56:03download
Request method | API | description |
---|---|---|
POST | /v1.0/osaas/project | API for Creating a Project |
GET | /v1.0/osaas/projects | API for Querying the Project List |
GET | /v1.0/osaas/projects/{project_id} | API for Querying Project Details |
PUT | /v1.0/osaas/projects/{project_id} | API for Modifying Project Information |
DELETE | /v1.0/osaas/projects/{project_id} | API for Deleting a Project |
You can use this API to create a project. The project name and location ID must be unique.
POST /v1.0/osaas/project
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_name | String | BODY | Project name, which contains a maximum of 64 characters. | Yes |
location_id | String | BODY | Unique ID of a location. | Yes |
address | String | BODY | Detailed address, which contains a maximum of 80 characters. | Yes |
time_zone_id | String | BODY | ID of a time zone, for example, Asia/Shanghai. | Yes |
Parameter | Type | Description |
---|---|---|
code | Integer | Response code. Null indicates success. |
success | Boolean | Request result. true: success false: failure |
msg | String | Exception message. It is null when the request result is success. |
t | Long | Response time, which is a 13-digit timestamp. |
result | String | Unique ID of a project. |
POST {url}/v1.0/osaas/project
{
"project_name": "Project name",
"location_id": "11",
"address": "Detailed address",
"time_zone_id": "Asia/Shanghai"
}
{
"success": true,
"result": "116082396505314*******",
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to obtain the project list.
GET /v1.0/osaas/projects
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
page_no | Integer | URL | Page number. | No |
page_size | Integer | URL | Number of records on a page, which is greater than 0 and less than 100. | No |
project_ids | String[] | URL | List of project IDs. | No |
Parameter | Type | Description |
---|---|---|
code | Integer | Response code. Null indicates success. |
success | Boolean | Request result. true: success false: failure |
msg | String | Exception message. It is null when the request result is success. |
t | Long | Response time, which is a 13-digit timestamp. |
result | Object | Result object. |
Parameters in result
Parameter | Type | Description |
---|---|---|
total | Integer | Total number of records. |
page_no | Integer | Page number. |
page_size | Integer | Number of records on a page. |
projects | Arrays | Project set. |
Parameters in projects
Parameter | Type | Description |
---|---|---|
project_id | String | Project ID. |
project_name | String | Project name. |
location_id | String | Unique ID of a basic location. |
address | String | Detailed address. |
time_zone_id | String | ID of a time zone |
authorization_status | String | Authorization status. UNAUTHORIZED: unauthorized AUTHORIZED: authorized REVOCATION_AUTHORIZATION: authorization revoked |
gmt_create | Long | Creation time, which is a 13-digit timestamp. |
gmt_modified | Long | Modification time, which is a 13-digit timestamp. |
GET {url}/v1.0/osaas/projects?page_no=1&page_size=20
{
"result": {
"total": 1,
"page_no": 1,
"page_size": 20,
"projects": [
{
"project_id": "116082396505314******",
"project_name": "Project name",
"location_id": "1002",
"address": "Detailed address",
"time_zone_id": "Asia/Shanghai",
"authorization_status": "AUTHORIZED",
"gmt_create": 1559707046000,
"gmt_modified": 1559707046000
}
]
},
"success": true,
"t": 1561381210234
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to obtain project details based on the unique ID of a project.
GET /v1.0/osaas/projects/{project_id}
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project. | Yes |
Parameter | Type | Description |
---|---|---|
code | Integer | Response code. Null indicates success. |
success | Boolean | Request result. true: success false: failure |
msg | String | Exception message. It is null when the request result is success. |
t | Long | Response time, which is a 13-digit timestamp. |
result | Object | Result object. |
Parameters in result
Parameter | Type | Description |
---|---|---|
project_id | String | Project ID. |
project_name | String | Project name. |
location_id | String | Unique ID of a basic location. |
address | String | Detailed address. |
time_zoneId | String | ID of a time zone |
authorization_status | String | Authorization status. UNAUTHORIZED: unauthorized AUTHORIZED: authorized REVOCATION_AUTHORIZATION: authorization revoked |
gmt_create | Long | Creation time, which is a 13-digit timestamp. |
gmt_modified | Long | Modification time, which is a 13-digit timestamp. |
GET {url}/v1.0/osaas/projects/116082396505312******
{
"success": true,
"result": {
"project_id": "116082396505314******",
"project_name": "Project name",
"location_id": "1002",
"address": "Detailed address",
"time_zone_id": "Asia/Shanghai",
"authorization_status": "AUTHORIZED",
"gmt_create": 1559707046000,
"gmt_modified": 1559707046000
},
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to modify information about a project based on the unique ID of the project. The project name and location ID must be unique.
PUT /v1.0/osaas/projects/{project_id}
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project | Yes |
project_name | String | BODY | Project name, which contains a maximum of 64 characters. | No |
location_id | String | BODY | Unique ID of a basic location. | No |
address | String | BODY | Detailed address, which contains a maximum of 80 characters. | No |
time_zone_id | String | BODY | Unique ID of a time | No |
Parameter | Type | Description |
---|---|---|
code | Integer | Response code. Null indicates success. |
success | Boolean | Request result. true: success false: failure |
msg | String | Exception message. It is null when the request result is success. |
t | Long | Response time, which is a 13-digit timestamp. |
result | Boolean | Operation result. |
PUT {url}/v1.0/osaas/projects/1160823965053******
{
"project_name": "Project name",
"location_id": "11",
"address": "Detailed address",
"time_zone_id": "Asia/Shanghai"
}
{
"success": true,
"result": true,
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to delete a project based on the unique ID of the project.
DELETE /v1.0/osaas/projects/{project_id}
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project | Yes |
Parameter | Type | Description |
---|---|---|
code | Integer | Response code. Null indicates success. |
success | Boolean | Request result. true: success false: failure |
msg | String | Exception message. It is null when the request result is success. |
t | Long | Response time, which is a 13-digit timestamp. |
result | Boolean | Operation result. |
DELETE {url}/v1.0/osaas/projects/1160823965053******
{
"success": true,
"result": true,
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
The following are common business exceptions for this interface. For more exception errors, see Global Error Codes.
error code | explain |
---|---|
500 | system error |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback