SearchProjects - Search projects
|
Applicable editions |
Central edition, Region edition |
Endpoint and authorization information
-
Get the endpoint: Replace {domain} in the API request syntax.
-
Obtain organizationId: Required only for the Central edition. Go to the Basic Information page in the Organization Management console to retrieve your organization ID.
|
Product |
Resource |
Required permission |
|
Project Collaboration |
Project |
Read-only |
Request syntax
Central edition
POST https://{domain}/oapi/v1/projex/organizations/{organizationId}/projects:search
Region edition
POST https://{domain}/oapi/v1/projex/projects:search
Request headers
|
Parameter |
Type |
Required |
Description |
Example value |
|
x-yunxiao-token |
string |
Yes |
Personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Location |
Required |
Description |
Example value |
|
organizationId |
string |
path |
|
organizationId. |
|
| - |
object |
body |
No |
||
|
conditions |
string |
body |
No |
Filter condition. This is a JSON string with the format {"conditionGroups":[[filterObject,filterObject,...]]}. Currently, you can filter by six fields: name, status, gmtCreate, creator, project.admin, and logicalStatus. The following example shows a complete set of search conditions (in real scenarios, include only the values you need): {"conditionGroups":[[{"className":"status","fieldIdentifier":"status","format":"list","operator":"CONTAINS","toValue":null,"value":["8a4058a71159b682541b0864","cc961a18adf770c6e423ccc5","faf4893ebf92851b6717511a9e","e22f2f8dcbffe9aa03eae7e8ba"]},{"className":"string","fieldIdentifier":"name","format":"input","operator":"BETWEEN","toValue":null,"value":["ffffff"]},{"className":"date","fieldIdentifier":"gmtCreate","format":"input","operator":"BETWEEN","toValue":"2023-09-06 23:59:59","value":["2023-08-03 00:00:00"]},{"className":"user","fieldIdentifier":"creator","format":"list","operator":"CONTAINS","toValue":null,"value":["43578d02-c84c-4fef-8c34-50c05304809a","d222d052-4c0e-4a03-b961-bb3f5fd556a0"]},{"className":"user","fieldIdentifier":"project.admin","format":"multiList","operator":"CONTAINS","toValue":null,"value":["d222d052-4c0e-4a03-b961-bb3f5fd556a0","bccd35ab-6380-4e03-b280-8b6f966e635c"]},{"className":"string","fieldIdentifier":"logicalStatus","format":"list","operator":"CONTAINS","toValue":null,"value":["NORMAL"]}]]}. |
{"conditionGroups":[[{"className":"string","fieldIdentifier":"name","format":"input","operator":"BETWEEN","toValue":null,"value":["test"]}]]} |
|
extraConditions |
string |
body |
No |
Additional filter conditions. This parameter defines a basic query scope, such as projects you manage, participate in, or have bookmarked. For reference, see the extraConditions parameter in the project/search/list AJAX interface on the project list page. |
|
|
orderBy |
string |
body |
No |
Sort field. Currently supports only name and creation time. If not specified, defaults to gmtCreate. Use gmtCreate for creation time or name for project name. |
gmtCreate |
|
page |
integer |
body |
No |
Paging parameter: page number. |
1 |
|
perPage |
integer |
body |
No |
Paging parameter: items per page. Range is 0–200. Default is 20. |
20 |
|
sort |
string |
body |
No |
Sort order. Default is desc (descending). Use asc for ascending. |
desc |
Request examples
Central edition
curl -X 'POST' \
'https://{domain}/oapi/v1/projex/organizations/{organizationId}/projects:search' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"conditions": "{"conditionGroups":[[{"className":"string","fieldIdentifier":"name","format":"input","operator":"BETWEEN","toValue":null,"value":["test"]}]]}",
"extraConditions": "",
"orderBy": "gmtCreate",
"page": 1,
"perPage": 20,
"sort": "desc"
}'
Region edition
curl -X 'POST' \
'https://{domain}/oapi/v1/projex/projects:search' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"conditions": "{"conditionGroups":[[{"className":"string","fieldIdentifier":"name","format":"input","operator":"BETWEEN","toValue":null,"value":["test"]}]]}",
"extraConditions": "",
"orderBy": "gmtCreate",
"page": 1,
"perPage": 20,
"sort": "desc"
}'
Response parameters
|
Parameter |
Type |
Description |
Example value |
| - |
array |
||
| - |
object |
||
| creator |
object |
Modifier. |
|
|
id |
string |
User ID. |
674d96abd497cd558d68**** |
|
name |
string |
Username. |
user-name-xxx |
|
customCode |
string |
Code. |
CCDD |
| customFieldValues |
array |
Custom field values. |
|
| - |
object |
Custom field value. |
|
|
fieldId |
string |
Field ID. |
fieldId1 |
|
fieldName |
string |
Field name. |
field-test |
| values |
array |
||
| - |
object |
||
|
displayValue |
string |
Display name of the value. |
111 |
|
identifier |
string |
Unique identifier of the value. |
111 |
|
description |
string |
Description. |
test |
|
gmtCreate |
string |
Creation timestamp. |
|
|
gmtModified |
string |
Update timestamp. |
|
|
icon |
string |
Icon. |
xxx |
|
id |
string |
ID. |
1111 |
|
logicalStatus |
string |
Logical status. |
normal |
| modifier |
object |
Modifier. |
|
|
id |
string |
User ID. |
674d96abd497cd558d68**** |
|
name |
string |
Username. |
user-name-xxx |
|
name |
string |
Name. |
project-test |
|
scope |
string |
Visibility type. Valid values: public, private. |
public |
| status |
object |
Status. |
|
|
id |
string |
Status ID. |
1111 |
|
name |
string |
Status name. |
In Progress |
Response example
[
{
"creator": {
"id": "674d96abd497cd558d68****",
"name": "user-name-xxx"
},
"customCode": "CCDD",
"customFieldValues": [
{
"fieldId": "fieldId1",
"fieldName": "field-test",
"values": [
{
"displayValue": "111",
"identifier": "111"
}
]
}
],
"description": "test",
"gmtCreate": "",
"gmtModified": "",
"icon": "xxx",
"id": "1111",
"logicalStatus": "normal",
"modifier": {
"id": "674d96abd497cd558d68****",
"name": "user-name-xxx"
},
"name": "project-test",
"scope": "public",
"status": {
"id": "1111",
"name": "In Progress"
}
}
]
Response headers
|
Parameter |
Description |
Example value |
|
x-next-page |
Next page. |
|
|
x-page |
Current page. |
|
|
x-per-page |
Items per page. |
|
|
x-prev-page |
Previous page. |
|
|
x-total |
Total data volume. |
|
|
x-total-pages |
Total number of pages. |
Error codes
See Error Code Center for API-related error codes.