Skip to main content

GetDepartmentUsage - Retrieve department usage data

Retrieve Qoder CN department usage data via OpenAPI.
Applies to: Enterprise Dedicated Edition, Enterprise Standard Edition
Service access point: Get the service access point and replace {domain} in the API request syntax.

Authorization

ProductResourceRequired permission
Qoder CNDepartment usage statisticsRead-only

Request Syntax

GET https://{domain}/oapi/v1/lingma/organizations/{organizationId}/departmentUsage

Request description

  • Enterprise Standard Edition
  • Enterprise Dedicated Edition
  • Query department usage data
curl -X 'GET' \
  'https://openapi-rdc.aliyuncs.com/oapi/v1/lingma/organizations/c7655445-143f-4466-9724-8b371a21****/departmentUsage?departmentId=7b58e90a-063f-475b-ad6d-32d1f438****&startTime=2025-06-10&endTime=2025-06-10&page=1&perPage=100' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Request Headers

x-yunxiao-token string (Required) Personal access token. See Personal access token for how to obtain it. Example: pt-0fh30fbG_35af0484.

Request Parameters

string
path
required
Organization ID. You can go to the Basic Information page in the Organization Admin Console to get the organizationId.
string
path
required
Department ID. See List organization departments to get the department ID.
string
path
required
The start time, in YYYY-MM-DD format.
string
path
required
The end time, in YYYY-MM-DD format.
integer
path
default:"1"
The current page number.
integer
path
default:"100"
The maximum number of entries per page. Valid range: [1, 100].

Response Fields

  • Response example
[
    {
        "activeDeveloper": 1,
        "activeDeveloperChat": 1,
        "activeDeveloperCompletion": 1,
        "breakdown": {
            "chatting": [
                {
                    "activeDeveloper": 1,
                    "chatTurns": 1,
                    "chatTurnsAccepted": 1,
                    "chatType": "GENERATE_TESTCASE",
                    "ide": "jetbrains"
                }
            ],
            "coding": [
                {
                    "acceptAssistantNewlineCount": 0,
                    "activeDeveloper": 1,
                    "language": "java",
                    "linesAccepted": 95,
                    "linesChanged": 95
                }
            ],
            "completion": [
                {
                    "activeDeveloper": 1,
                    "countAccepted": 3,
                    "countSuggested": 3,
                    "ide": "jetbrains",
                    "language": "java",
                    "linesAccepted": 5,
                    "linesSuggested": 5
                }
            ]
        },
        "date": 1749571200000,
        "departmentId": "68491a3e0dc52b6c963b****",
        "totalChatTurns": 1,
        "totalChatTurnsAccepted": 1,
        "totalCountAcceptedCompletion": 3,
        "totalCountSuggestedCompletion": 3,
        "totalLinesAccepted": 95,
        "totalLinesAcceptedChat": 0,
        "totalLinesAcceptedCompletion": 5,
        "totalLinesChanged": 95,
        "totalLinesSuggestedCompletion": 5
    }
]
integer
Number of active developers.
integer
Number of active developers in chat.
integer
Number of active developers in code generation.
Object
Detailed data.
array
Q&A interaction details.
integer
Number of active users.
integer
Number of chat turns.
integer
Number of accepted chat turns.
string
The type of chat:
  • CODE_GENERATE_COMMENT: Code comments.
  • GENERATE_TESTCASE: Unit tests.
  • EXPLAIN_CODE: Code explanation.
  • OPTIMIZE_CODE: Code optimization.
  • FREE_INPUT: Free-form Q&A. This is a non-uppercase string for a custom instruction.
string
The IDE type, such as jetbrains or vscode.
array
Code change details, including summary of accepted code from inline completions and Q&A generations.
integer
Lines of code accepted by the department on that day, broken down by Q&A type and language.
integer
Number of active users.
string
Language.
integer
The number of accepted lines of code.
integer
The number of changed lines of code.
array
Inline completion generation and acceptance details.
integer
Number of active users.
integer
The number of acceptances.
integer
The number of suggestions.
string
The IDE type, such as jetbrains or vscode.
string
Language.
integer
The number of accepted lines of code.
integer
The number of suggested lines of code.
integer
The date.
string
The department ID.
integer
Total chat turns for the department on that day.
integer
Total number of accepted Q&A turns for the department on that day.
integer
Total number of accepted inline completions for the department on that day.
integer
Total number of suggested inline completions for the department on that day.
integer
Total lines of code accepted by the department on that day, including lines from ask, edit (formerly AI Programmer), agent Q&A generation, and inline completions.
integer
Total lines of code accepted by the department via Q&A on that day.
integer
Total lines of code accepted via inline completion by the department on that day.
integer
Total lines of code changed by the department on that day, including lines from ask, edit (formerly AI Programmer), agent Q&A generation, and inline completions.
integer
Total lines suggested via inline completion for the department on that day.

Response Headers

ParameterDescriptionExample value
x-next-pageThe next page2
x-pageThe current page1
x-per-pageThe number of entries per page100
x-prev-pageThe previous page0
x-request-idThe request ID37294673-00CA-5B8B-914F-A8B35511E90A
x-totalThe total number of entries10
x-total-pagesThe total number of pages1

Error Codes

For related API error codes, see the API error codes reference. For issues encountered when using the API, see FAQ.