APIs Related to Project Management

Last Updated on : 2025-05-30 01:56:03download

API List

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

API for Creating a Project

API Description

You can use this API to create a project. The project name and location ID must be unique.

API Address

POST /v1.0/osaas/project

Request Parameters

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

Response Parameters

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.

Request Example

POST {url}/v1.0/osaas/project
{ "project_name": "Project name", "location_id": "11", "address": "Detailed address", "time_zone_id": "Asia/Shanghai" }

Success Response Example

{ "success": true, "result": "116082396505314*******", "t": 1566053034624 }

Failure Response Example

{ "code": 500, "msg": "system error,please contact the admin", "success": false, "t": 1561378856383 }

API for Querying the Project List

API Description

You can use this API to obtain the project list.

API Address

GET /v1.0/osaas/projects

Request Parameters

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

Response Parameters

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.

Request Example

GET {url}/v1.0/osaas/projects?page_no=1&page_size=20

Success Response Example

{ "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 }

Failure Response Example

{ "code": 500, "msg": "system error,please contact the admin", "success": false, "t": 1561378856383 }

API for Querying Project Details

API Description

You can use this API to obtain project details based on the unique ID of a project.

API Address

GET /v1.0/osaas/projects/{project_id}

Request Parameters

Parameter Type Position Description Mandatory
project_id String URI Unique ID of a project. Yes

Response Parameters

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.

Request Example

GET {url}/v1.0/osaas/projects/116082396505312******

Success Response Example

{ "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 }

Failure Response Example

{ "code": 500, "msg": "system error,please contact the admin", "success": false, "t": 1561378856383 }

API for Modifying Project Information

API Description

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.

API Address

PUT /v1.0/osaas/projects/{project_id}

Request Parameters

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

Response Parameters

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.

Request Example

PUT {url}/v1.0/osaas/projects/1160823965053******
{ "project_name": "Project name", "location_id": "11", "address": "Detailed address", "time_zone_id": "Asia/Shanghai" }

Success Response Example

{ "success": true, "result": true, "t": 1566053034624 }

Failure Response Example

{ "code": 500, "msg": "system error,please contact the admin", "success": false, "t": 1561378856383 }

API for Deleting a Project

API Description

You can use this API to delete a project based on the unique ID of the project.

API Address

DELETE /v1.0/osaas/projects/{project_id}

Request Parameters

Parameter Type Position Description Mandatory
project_id String URI Unique ID of a project Yes

Response Parameters

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.

Request Example

DELETE {url}/v1.0/osaas/projects/1160823965053******

Success Response Example

{ "success": true, "result": true, "t": 1566053034624 }

Failure Response Example

{ "code": 500, "msg": "system error,please contact the admin", "success": false, "t": 1561378856383 }

Error Code

The following are common business exceptions for this interface. For more exception errors, see Global Error Codes.

error code explain
500 system error