Call this API to retrieve the usage data of Lingma in a department.
Supported editions | Enterprise Dedicated Edition |
Service endpoints and authorization information
Get the service endpoint to replace <domain> in the API request syntax with your endpoint.
Obtain the access token.
Obtain the
organizationId. Go to the Lingma console and view the organization ID on the Basic Information page under .
Product | Resource | Required permission |
Lingma | Department usage statistics | Read-Only |
Request syntax
GET https://{domain}/oapi/v1/lingma/organizations/{organizationId}/departmentUsageRequest header
Parameter | Type | Required | Description | Example |
x-yunxiao-token | string | Yes | The access token. | pt-0fh3****0fbG_35af****0484 |
Request parameters
Parameter | Type | Position | Required | Description |
| string | path | Yes | The organization ID. |
| string | query | Yes | The department ID. |
| string | query | Yes | The start date in the YYYY-MM-DD format. |
| string | query | Yes | The end date in the YYYY-MM-DD format. |
| integer | query | No | The page number. Default value: 1. |
| integer | query | No | The number of entries per page. Default value: 100. |
Request example
curl -X 'GET' \
'https://{domain}/oapi/v1/lingma/organizations/{organizationId}/departmentUsage?departmentId={departmentId}&startTime={startTime}&endTime={endTime}&page={page}&perPage={perPage}' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'Response parameters
Parameter | Type | Description |
- | array | |
- | object | |
| integer | The total number of active users. |
| integer | The number of active users who triggered Lingma's chat feature at least once on the specified date. |
| integer | The number of active users who triggered Lingma's code completion feature at least once on the specified date. |
| object | A breakdown of Lingma's usage data. Valid values:
|
| array | The detailed data about the chat feature. |
- | object | |
| integer | The number of active users. |
| integer | The number of chats. |
| integer | The number of accepted chats. |
| string | The type of the chat. Valid values:
|
| string | The integrated development environment (IDE), like |
| array | The code change statistics, including the number of accepted and changed code changes in code completion and chat. |
- | object | |
| integer | The number of code lines accepted by the department on that day, including by chat and by language. |
| integer | The number of active users. |
| string | The language. |
| integer | The number of accepted lines of code. |
| integer | The number of changed lines of code. |
| array | The detailed data about the code completion feature. |
- | object | |
| integer | The number of active users. |
| integer | The code completions accepted by the department. |
| integer | The code completions suggested by Lingma. |
| string | The integrated development environment (IDE), like |
| string | The language. |
| integer | The number of accepted lines of code. |
| integer | The number of changed lines of code. |
| integer | The date. |
| string | The department ID. |
| integer | The number of chats by the department on that day. |
| integer | The number of chats accepted by the department on that day. |
| integer | The code completions accepted by the department on that day. |
| integer | The code completions suggested for the department on that day. |
| integer | The total number of accepted code lines by the department on that day through Ask, Edit, Agent modes and code completion. |
| integer | The total number of lines of code accepted by the department through chat on that day. |
| integer | The total number of code lines accepted through code completion by the department on that day. |
| integer | The total number of lines of code changed by the department on that day through Ask, Edit, Agent modes and code completion. |
| integer | The total number of lines of code suggested through code completion for the department on that day. |
Response example
[
{
"activeDeveloper": 0,
"activeDeveloperChat": 0,
"activeDeveloperCompletion": 0,
"breakdown": {
"chatting": [
{
"activeDeveloper": 0,
"chatTurns": 0,
"chatTurnsAccepted": 0,
"chatType": "",
"ide": ""
}
],
"coding": [
{
"acceptAssistantNewlineCount": 0,
"activeDeveloper": 0,
"language": "",
"linesAccepted": 0,
"linesChanged": 0
}
],
"completion": [
{
"activeDeveloper": 0,
"countAccepted": 0,
"countSuggested": 0,
"ide": "",
"language": "",
"linesAccepted": 0,
"linesChanged": 0
}
]
},
"date": 0,
"departmentId": "",
"totalChatTurns": 0,
"totalChatTurnsAccepted": 0,
"totalCountAcceptedCompletion": 0,
"totalCountSuggestedCompletion": 0,
"totalLinesAccepted": 0,
"totalLinesAcceptedChat": 0,
"totalLinesAcceptedCompletion": 0,
"totalLinesChanged": 0
"totalLinesSuggestedCompletion": 0
}
]Response header
Parameter | Description | Example |
| The next page. | 1 |
| The number of entries per page. | 100 |
| The previous page. | 1 |
| The total number of entries. | 2 |
| The total number of pages. | 1 |
Error code
For more information, see Error codes.
References
For more information, see OpenAPI-related issues.