/oauth2/queryData is used by third-party enterprises to query and submit vehicle data download tasks after obtaining user authorization. The interface does two things at once:
"DataFileExporting".recordNo and returns either a download URL or a status string.appId and appSecret will be sent to the applicant's email. To apply, send an email to glo.open@xpeng.com with the following information: the integrating enterprise name, third-party application name, and integration owner's contact email.openId, accessToken, enterpriseName, and scopeCode from the email they receive.| Environment | URL |
|---|---|
| UAT | https://open-eu.uat.xpeng.com/open/oauth2/queryData |
| Production | https://open.xpeng.com/open/oauth2/queryData |
POST
| Parameter | Required | Type | Description |
|---|---|---|---|
appId | Yes | String | Application unique identifier. |
nonce | Yes | String | Timestamp in milliseconds. |
sign | Yes | String | Request signature; see section 9 for calculation rules. |
Content-Type: application/json
| Parameter | Required | Type | Description |
|---|---|---|---|
openId | Yes | String | Obtained by the authorized user from the email they receive. |
accessToken | Yes | String | Obtained by the authorized user from the email they receive. |
enterpriseName | Yes | String | Obtained by the authorized user from the email they receive. |
scopeCode | Yes | String | Obtained by the authorized user from the email they receive. |
{
"openId": "6c6d6091390ffb38e70935b31397e0672e3e8cd8",
"accessToken": "eyJ0eXBlIjoxLCJ2ZXJzaW9uIjoiMS4wLjAiLCJhbGciOiJIUzI1NiJ9...",
"enterpriseName": "XXXX Enterprise Name",
"scopeCode": "d580644744cd40ddbdf88ad5a5125613"
}
| Field | Type | Description |
|---|---|---|
code | Integer | Business return code; 0 means success, non-zero means failure. |
data | String | On success, returns status string or download URL; null on failure. |
msg | String | User-facing message; content is resolved dynamically based on the request language, so exact wording is not fixed. |
desc | String | Developer-facing error description with fixed wording, used for troubleshooting. |
{
"code": 0,
"data": "DataFileExporting",
"msg": null
}
{
"code": 0,
"data": "https://example.com/download?token=xxx",
"msg": null
}
{
"code": 0,
"data": "DataFileExportFailed",
"msg": null
}
Note: the wording of
msgis resolved dynamically based on the request language; themsgvalue below is illustrative only.deschas fixed wording and should be used as the basis for error handling.
{
"code": 12064024,
"data": null,
"msg": "Server unavailable. Please try again later",
"desc": "Download count exceeded the limit"
}
{
"code": 12064019,
"data": null,
"msg": "Server unavailable. Please try again later",
"desc": "No authorization record for this user and application"
}
{
"code": 4004001,
"data": null,
"msg": "Server unavailable. Please try again later",
"desc": "accesstoken已过期"
}
The interface returns different data values based on the downstream task status:
| Downstream Status | Returned data | Description |
|---|---|---|
PENDING / GENERATING | DataFileExporting | Task is being generated; retry later. |
AVAILABLE / DOWNLOADED | Download URL | File is ready for download. |
FAILED | DataFileExportFailed | File generation failed. |
EXPIRED | DataFileExporting or error | Resubmitted if under limit; otherwise returns 12064024. |
| Item | Default Value | Description |
|---|---|---|
recordNo cache validity | 24 hours | Task record number is cached in Redis for 24 hours after first submission. |
| Submission count period | 24 hours | Submission count is tracked per user and per enterprise within 24 hours. |
| Maximum submissions | 5 | Maximum 5 submissions per user-enterprise pair within 24 hours. |
| Download link validity | 30 seconds (subject to downstream) | Download link validity is approximately 30 seconds by default; the actual value is determined by the downstream system. |
stringAappId and sign. Add body ("body" as key, body content as value) to the fields participating in signature.key1+value1+key2+value2 without separators.stringA = "body" + ${bodyContent (empty string if none)} + "nonce" + ${nonce}stringBappId and append appSecret to stringA.stringB = ${appId} + stringA + ${appSecret}signstringB, then convert the result to lowercase.sign = SHA1(stringB).toLowerCase()Note:
appSecretis obtained after the application is approved on the Xpeng Open Platform.
The examples below demonstrate how to generate the sign for /oauth2/queryData based on the rules above.
/oauth2/authorize to demonstrate concatenationGET https://xxx.xpeng.com/open/oauth2/authorize?appId=APPID&nonce=NONCE&state=STATE&sign=SIGN
StringA = bodynonceNONCEstateSTATE
StringB = APPIDbodynonceNONCEstateSTATEAPPSECRET
sign = SHA1(StringB).toLowerCase()
/oauth2/queryDataGiven:
appId = APPID
appSecret = APPSECRET
nonce = 1787020880806
body = {"openId":"xxx","accessToken":"yyy","enterpriseName":"XXXX Enterprise Name","scopeCode":"abc"}
Build signature strings:
StringA = body{"openId":"xxx","accessToken":"yyy","enterpriseName":"XXXX Enterprise Name","scopeCode":"abc"}nonce1787020880806
StringB = APPIDbody{"openId":"xxx","accessToken":"yyy","enterpriseName":"XXXX Enterprise Name","scopeCode":"abc"}nonce1787020880806APPSECRET
sign = SHA1(StringB).toLowerCase()
Notes:
StringA only contains the keys body and nonce (in natural ascending order), because appId and sign do not participate in the signature string concatenation.appId is prepended to StringA and appSecret is appended to form StringB.sign is SHA1(StringB) converted to lowercase.curl --location 'https://open-eu.uat.xpeng.com/open/oauth2/queryData?appId=YOUR_APP_ID&nonce=1787020880806&sign=YOUR_SIGN' \
--header 'Content-Type: application/json' \
--data '{
"openId": "6c6d6091390ffb38e70935b31397e0672e3e8cd8",
"accessToken": "eyJ0eXBlIjoxLCJ2ZXJzaW9uIjoiMS4wLjAiLCJhbGciOiJIUzI1NiJ9...",
"enterpriseName": "XXXX Enterprise Name",
"scopeCode": "d580644744cd40ddbdf88ad5a5125613"
}'
When running curl.exe in PowerShell, use --% to stop PowerShell parsing and avoid special characters being escaped:
curl.exe --% --location "https://open-eu.uat.xpeng.com/open/oauth2/queryData?appId=YOUR_APP_ID&nonce=1787020880806&sign=YOUR_SIGN" `
--header "Content-Type: application/json" `
--data '{"openId":"6c6d6091390ffb38e70935b31397e0672e3e8cd8","accessToken":"eyJ...","enterpriseName":"XXXX Enterprise Name","scopeCode":"d580644744cd40ddbdf88ad5a5125613"}'
| Code | Description |
|---|---|
0 | Success |
12060000 | Operation failed |
12060001 | Request parameter error |
12061001 | Invalid appId |
12061002 | Request parameter nonce error |
12061004 | Request parameter sign error |
12061005 | Invalid appId or signature data |
4004001 | access_token expired |
12061014 | accessToken verification failed |
12064018 | Invalid openId |
12064019 | No authorization record for this user and application |
12064023 | Data download submission failed |
12064024 | Download count exceeded the limit |
/oauth2/queryData interface requires both signature verification and accessToken verification; ensure both are valid.enterpriseName must exactly match the name used during authorization (including case and spaces); the system compares MD5 hashes.scopeCode is a one-time authorization credential; keep it secure.DataFileExporting, it is recommended to call this interface again after a delay (e.g., 5-10 seconds) to query task status.12064024 is returned, the submission limit for the past 24 hours has been reached; retry after 24 hours.Document Version: 1.0
Last Updated: 2026-08-19