Endpoints and authorization
-
Get service endpoints: Replace {domain} in the API request syntax with a valid service endpoint.
|
Product |
Resource |
Required permission |
|
Project Collaboration |
Project |
Read/Write |
Request syntax
Region edition
POST https://{domain}/oapi/v1/projex/projects
Request headers
|
Parameter |
Type |
Required |
Description |
Example |
|
x-yunxiao-token |
string |
Yes |
Your personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Location |
Required |
Description |
Example |
| - |
object |
body |
No |
||
|
customCode |
string |
body |
Yes |
The project code. It must consist of 4 to 6 uppercase letters and be unique within the organization. |
CCDD |
|
customFieldValues |
object |
body |
No |
Custom field values as a JSON object: {"fieldId": "value"}. The fieldId must correspond to a CustomField type returned by the GetProjectTemplateList operation. To set multiple values for a field, use a comma-separated string. Example: {"priority": "888853d622cc8eae793e085e27"}. |
{ |
|
description |
string |
body |
No |
The project description. |
test |
|
name |
string |
body |
Yes |
The project name. |
project-test |
|
operatorId |
string |
body |
No |
The ID of the user performing the operation. Ignored when using a personal access token. |
user-xxx |
|
scope |
string |
body |
Yes |
The project visibility. Valid values: public and private. |
public |
|
templateId |
string |
body |
Yes |
The template ID. Call the GetProjectTemplateList operation to obtain available template IDs. |
template-test |
Request examples
Region edition
curl -X 'POST' \
'https://{domain}/oapi/v1/projex/projects' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"customCode": "CCDD",
"customFieldValues": {
"priority": "888853d622cc8eae793e085e27"
},
"description": "test",
"name": "project-test",
"operatorId": "user-xxx",
"scope": "public",
"templateId": "template-test"
}'
Response parameters
|
Parameter |
Type |
Description |
Example |
| - |
object |
||
|
id |
string |
The ID of the newly created project. |
1111 |
Response example
{
"id": "1111"
}
Error codes
For API error codes, see the Error Code Center.