Foxpro / Support API / Show Compliance Deletion Statuses
Back to Collection Items
LOCAL loHttp
LOCAL lnSuccess
LOCAL loQueryParams
LOCAL loResp
LOCAL loSbResponseBody
LOCAL loJResp
LOCAL lnRespStatusCode
LOCAL lcAction
LOCAL lcApplication
LOCAL lcAccount_subdomain
LOCAL lcExecuter_id
LOCAL lcUser_id
LOCAL lcCreated_at
LOCAL i
LOCAL lnCount_i
* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http')
loHttp = CreateObject('Chilkat.Http')
loHttp.BasicAuth = 1
loHttp.Login = "login"
loHttp.Password = "password"
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject')
loQueryParams = CreateObject('Chilkat.JsonObject')
loQueryParams.UpdateString("application","<string>")
loHttp.SetRequestHeader("Accept","application/json")
loResp = loHttp.QuickRequestParams("GET","https://example.zendesk.com/api/v2/users/:user_id/compliance_deletion_statuses",loQueryParams)
IF (loHttp.LastMethodSuccess = 0) THEN
? loHttp.LastErrorText
RELEASE loHttp
RELEASE loQueryParams
CANCEL
ENDIF
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSbResponseBody = CreateObject('Chilkat.StringBuilder')
loResp.GetBodySb(loSbResponseBody)
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject')
loJResp = CreateObject('Chilkat.JsonObject')
loJResp.LoadSb(loSbResponseBody)
loJResp.EmitCompact = 0
? "Response Body:"
? loJResp.Emit()
lnRespStatusCode = loResp.StatusCode
? "Response Status Code = " + STR(lnRespStatusCode)
IF (lnRespStatusCode >= 400) THEN
? "Response Header:"
? loResp.Header
? "Failed."
RELEASE loResp
RELEASE loHttp
RELEASE loQueryParams
RELEASE loSbResponseBody
RELEASE loJResp
CANCEL
ENDIF
RELEASE loResp
* Sample JSON response:
* (Sample code for parsing the JSON response is shown below)
* {
* "compliance_deletion_statuses": [
* {
* "action": "<string>",
* "application": "<string>",
* "account_subdomain": "<string>",
* "executer_id": "<integer>",
* "user_id": "<integer>",
* "created_at": "<string>"
* },
* {
* "action": "<string>",
* "application": "<string>",
* "account_subdomain": "<string>",
* "executer_id": "<integer>",
* "user_id": "<integer>",
* "created_at": "<string>"
* }
* ]
* }
* Sample code for parsing the JSON response...
* Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
i = 0
lnCount_i = loJResp.SizeOfArray("compliance_deletion_statuses")
DO WHILE i < lnCount_i
loJResp.I = i
lcAction = loJResp.StringOf("compliance_deletion_statuses[i].action")
lcApplication = loJResp.StringOf("compliance_deletion_statuses[i].application")
lcAccount_subdomain = loJResp.StringOf("compliance_deletion_statuses[i].account_subdomain")
lcExecuter_id = loJResp.StringOf("compliance_deletion_statuses[i].executer_id")
lcUser_id = loJResp.StringOf("compliance_deletion_statuses[i].user_id")
lcCreated_at = loJResp.StringOf("compliance_deletion_statuses[i].created_at")
i = i + 1
ENDDO
RELEASE loHttp
RELEASE loQueryParams
RELEASE loSbResponseBody
RELEASE loJResp
Curl Command
curl -u login:password -G -d "application=%3Cstring%3E"
-H "Accept: application/json"
https://example.zendesk.com/api/v2/users/:user_id/compliance_deletion_statuses
Postman Collection Item JSON
{
"name": "Show Compliance Deletion Statuses",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/users/:user_id/compliance_deletion_statuses?application=<string>",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"users",
":user_id",
"compliance_deletion_statuses"
],
"query": [
{
"key": "application",
"value": "<string>",
"description": "Area of compliance"
}
],
"variable": [
{
"key": "user_id",
"value": "<integer>"
}
]
},
"description": "Returns the GDPR status for each user per area of compliance. A Zendesk area of compliance is typically a product like \"support/explore\" but can be more fine-grained for areas within the product lines.\n\nIf the user is not in the account, the request returns a 404 status.\n\n```http\nStatus: 404\n{\n \"error\":\"RecordNotFound\",\n \"description\":\"Not found\"\n}\n```\n\n#### Allowed For\n\n* Agents, with restrictions\n"
},
"response": [
{
"name": "Success response",
"originalRequest": {
"method": "GET",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/users/:user_id/compliance_deletion_statuses?application=<string>",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"users",
":user_id",
"compliance_deletion_statuses"
],
"query": [
{
"key": "application",
"value": "<string>",
"description": "Area of compliance"
}
],
"variable": [
{
"key": "user_id"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"compliance_deletion_statuses\": [\n {\n \"action\": \"<string>\",\n \"application\": \"<string>\",\n \"account_subdomain\": \"<string>\",\n \"executer_id\": \"<integer>\",\n \"user_id\": \"<integer>\",\n \"created_at\": \"<string>\"\n },\n {\n \"action\": \"<string>\",\n \"application\": \"<string>\",\n \"account_subdomain\": \"<string>\",\n \"executer_id\": \"<integer>\",\n \"user_id\": \"<integer>\",\n \"created_at\": \"<string>\"\n }\n ]\n}"
}
]
}