Verifying Environment Report
After obtaining the token, the connector calls this API to send the token to kdc_agent for verification.
Item |
Description |
|---|---|
API path |
/rest/kdc_agent/v1/proxy |
Request method |
POST |
requestType |
0x0011 |
Request Header
Parameter |
Value |
|---|---|
Content-Type |
application/json |
Accept |
application/json |
Request Body
Parameter |
Type |
Specification |
Required (Yes/No) |
Description |
|---|---|---|---|---|
taskId |
String |
64 |
Yes |
Task ID. Each request must use a unique ID. |
version |
String |
8 |
Yes |
Payload format version in VR format, initially set to 26.0. |
msgType |
Int |
32 |
Yes |
Service message type, with a value of 0x0011. |
data |
Object |
- |
No |
Service message entity in key:value format. |
data.token |
String |
8192 |
Yes |
Trusted environment token |
Request Body Example
{
"taskId": "SDFMOASDMNFIOASMD",
"version": "26.0",
"msgType": "0x0011",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
}
Response Header
Parameter |
Value |
|---|---|
Content-Type |
application/json |
Response Body
Parameter |
Type |
Specification |
Required (Yes/No) |
Description |
|---|---|---|---|---|
retCode |
Int |
32 |
Yes |
Error code |
retMsg |
String |
64 |
Yes |
Error message |
data |
Object |
- |
Yes |
Custom service data |
data.status |
String |
- |
Yes |
Verification result: pass or fail |
Response Body Example
{
"retCode": 0,
"retMsg": "Success",
"data": {
"status": "pass"
}
}
Examples
const char *input = "{\"token\":\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"}";
char *output = NULL;
uint32_t outputLen = 0;
uint32_t ret = KdcTrustedRequest(0x0011, input, strlen(input), &output, &outputLen);
if (ret == 0 && output != NULL) {
// Parse the output to obtain the status and check the verification result.
printf("Result: %s\n", output);
KdcFreePtr(output);
}