autoit / Support API / Show Suspended Ticket
Back to Collection Items
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oHttp = ObjCreate("Chilkat.Http")
Local $bSuccess
$oHttp.BasicAuth = True
$oHttp.Login = "login"
$oHttp.Password = "password"
$oHttp.SetRequestHeader "Accept","application/json"
$oSbResponseBody = ObjCreate("Chilkat.StringBuilder")
$bSuccess = $oHttp.QuickGetSb("https://example.zendesk.com/api/v2/suspended_tickets/:id",$oSbResponseBody)
If ($bSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
$oJResp = ObjCreate("Chilkat.JsonObject")
$oJResp.LoadSb($oSbResponseBody)
$oJResp.EmitCompact = False
ConsoleWrite("Response Body:" & @CRLF)
ConsoleWrite($oJResp.Emit() & @CRLF)
Local $iRespStatusCode = $oHttp.LastStatus
ConsoleWrite("Response Status Code = " & $iRespStatusCode & @CRLF)
If ($iRespStatusCode >= 400) Then
ConsoleWrite("Response Header:" & @CRLF)
ConsoleWrite($oHttp.LastHeader & @CRLF)
ConsoleWrite("Failed." & @CRLF)
Exit
EndIf
; Sample JSON response:
; (Sample code for parsing the JSON response is shown below)
; {
; "suspended_tickets": [
; {
; "attachments": [
; {
; "content_type": "<string>",
; "content_url": "<string>",
; "deleted": "<boolean>",
; "file_name": "<string>",
; "height": "<string>",
; "id": "<integer>",
; "inline": "<boolean>",
; "malware_access_override": "<boolean>",
; "malware_scan_result": "<string>",
; "mapped_content_url": "<string>",
; "size": "<integer>",
; "url": "<string>",
; "width": "<string>",
; "thumbnails": [
; {
; "content_type": "<string>",
; "content_url": "<string>",
; "deleted": "<boolean>",
; "file_name": "<string>",
; "height": "<string>",
; "id": "<integer>",
; "inline": "<boolean>",
; "malware_access_override": "<boolean>",
; "malware_scan_result": "<string>",
; "mapped_content_url": "<string>",
; "size": "<integer>",
; "url": "<string>",
; "width": "<string>"
; },
; {
; "content_type": "<string>",
; "content_url": "<string>",
; "deleted": "<boolean>",
; "file_name": "<string>",
; "height": "<string>",
; "id": "<integer>",
; "inline": "<boolean>",
; "malware_access_override": "<boolean>",
; "malware_scan_result": "<string>",
; "mapped_content_url": "<string>",
; "size": "<integer>",
; "url": "<string>",
; "width": "<string>"
; }
; ]
; },
; {
; "content_type": "<string>",
; "content_url": "<string>",
; "deleted": "<boolean>",
; "file_name": "<string>",
; "height": "<string>",
; "id": "<integer>",
; "inline": "<boolean>",
; "malware_access_override": "<boolean>",
; "malware_scan_result": "<string>",
; "mapped_content_url": "<string>",
; "size": "<integer>",
; "url": "<string>",
; "width": "<string>",
; "thumbnails": [
; {
; "content_type": "<string>",
; "content_url": "<string>",
; "deleted": "<boolean>",
; "file_name": "<string>",
; "height": "<string>",
; "id": "<integer>",
; "inline": "<boolean>",
; "malware_access_override": "<boolean>",
; "malware_scan_result": "<string>",
; "mapped_content_url": "<string>",
; "size": "<integer>",
; "url": "<string>",
; "width": "<string>"
; },
; {
; "content_type": "<string>",
; "content_url": "<string>",
; "deleted": "<boolean>",
; "file_name": "<string>",
; "height": "<string>",
; "id": "<integer>",
; "inline": "<boolean>",
; "malware_access_override": "<boolean>",
; "malware_scan_result": "<string>",
; "mapped_content_url": "<string>",
; "size": "<integer>",
; "url": "<string>",
; "width": "<string>"
; }
; ]
; }
; ],
; "author": {
; "email": "<string>",
; "id": "<integer>",
; "name": "<string>"
; },
; "brand_id": "<integer>",
; "cause": "<string>",
; "cause_id": "<integer>",
; "content": "<string>",
; "created_at": "<dateTime>",
; "id": "<integer>",
; "message_id": "<string>",
; "recipient": "<string>",
; "subject": "<string>",
; "ticket_id": "<integer>",
; "updated_at": "<dateTime>",
; "url": "<string>",
; "via": {
; "channel": "<string>",
; "source": {
; "from": {
; "address": "<string>",
; "id": "<integer>",
; "name": "<string>",
; "title": "<string>"
; },
; "rel": "<string>",
; "to": {
; "address": "<string>",
; "name": "<string>"
; }
; }
; }
; },
; {
; "attachments": [
; {
; "content_type": "<string>",
; "content_url": "<string>",
; "deleted": "<boolean>",
; "file_name": "<string>",
; "height": "<string>",
; "id": "<integer>",
; "inline": "<boolean>",
; "malware_access_override": "<boolean>",
; "malware_scan_result": "<string>",
; "mapped_content_url": "<string>",
; "size": "<integer>",
; "url": "<string>",
; "width": "<string>",
; "thumbnails": [
; {
; "content_type": "<string>",
; "content_url": "<string>",
; "deleted": "<boolean>",
; "file_name": "<string>",
; "height": "<string>",
; "id": "<integer>",
; "inline": "<boolean>",
; "malware_access_override": "<boolean>",
; "malware_scan_result": "<string>",
; "mapped_content_url": "<string>",
; "size": "<integer>",
; "url": "<string>",
; "width": "<string>"
; },
; {
; "content_type": "<string>",
; "content_url": "<string>",
; "deleted": "<boolean>",
; "file_name": "<string>",
; "height": "<string>",
; "id": "<integer>",
; "inline": "<boolean>",
; "malware_access_override": "<boolean>",
; "malware_scan_result": "<string>",
; "mapped_content_url": "<string>",
; "size": "<integer>",
; "url": "<string>",
; "width": "<string>"
; }
; ]
; },
; {
; "content_type": "<string>",
; "content_url": "<string>",
; "deleted": "<boolean>",
; "file_name": "<string>",
; "height": "<string>",
; "id": "<integer>",
; "inline": "<boolean>",
; "malware_access_override": "<boolean>",
; "malware_scan_result": "<string>",
; "mapped_content_url": "<string>",
; "size": "<integer>",
; "url": "<string>",
; "width": "<string>",
; "thumbnails": [
; {
; "content_type": "<string>",
; "content_url": "<string>",
; "deleted": "<boolean>",
; "file_name": "<string>",
; "height": "<string>",
; "id": "<integer>",
; "inline": "<boolean>",
; "malware_access_override": "<boolean>",
; "malware_scan_result": "<string>",
; "mapped_content_url": "<string>",
; "size": "<integer>",
; "url": "<string>",
; "width": "<string>"
; },
; {
; "content_type": "<string>",
; "content_url": "<string>",
; "deleted": "<boolean>",
; "file_name": "<string>",
; "height": "<string>",
; "id": "<integer>",
; "inline": "<boolean>",
; "malware_access_override": "<boolean>",
; "malware_scan_result": "<string>",
; "mapped_content_url": "<string>",
; "size": "<integer>",
; "url": "<string>",
; "width": "<string>"
; }
; ]
; }
; ],
; "author": {
; "email": "<string>",
; "id": "<integer>",
; "name": "<string>"
; },
; "brand_id": "<integer>",
; "cause": "<string>",
; "cause_id": "<integer>",
; "content": "<string>",
; "created_at": "<dateTime>",
; "id": "<integer>",
; "message_id": "<string>",
; "recipient": "<string>",
; "subject": "<string>",
; "ticket_id": "<integer>",
; "updated_at": "<dateTime>",
; "url": "<string>",
; "via": {
; "channel": "<string>",
; "source": {
; "from": {
; "address": "<string>",
; "id": "<integer>",
; "name": "<string>",
; "title": "<string>"
; },
; "rel": "<string>",
; "to": {
; "address": "<string>",
; "name": "<string>"
; }
; }
; }
; }
; ]
; }
; Sample code for parsing the JSON response...
; Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
Local $sV_Email
Local $sId
Local $sName
Local $sBrand_id
Local $sCause
Local $sCause_id
Local $sContent
Local $sCreated_at
Local $sId
Local $sMessage_id
Local $sRecipient
Local $subject
Local $sTicket_id
Local $sUpdated_at
Local $sUrl
Local $sChannel
Local $sAddress
Local $sFromId
Local $sFromName
Local $sTitle
Local $sRel
Local $sToAddress
Local $sToName
Local $iJ
Local $iCount_j
Local $sContent_type
Local $sContent_url
Local $sDeleted
Local $sFile_name
Local $sHeight
Local $sInline
Local $sMalware_access_override
Local $sMalware_scan_result
Local $sMapped_content_url
Local $size
Local $sWidth
Local $iK
Local $iCount_k
Local $i = 0
Local $iCount_i = $oJResp.SizeOfArray("suspended_tickets")
While $i < $iCount_i
$oJResp.I = $i
$sV_Email = $oJResp.StringOf("suspended_tickets[i].author.email")
$sId = $oJResp.StringOf("suspended_tickets[i].author.id")
$sName = $oJResp.StringOf("suspended_tickets[i].author.name")
$sBrand_id = $oJResp.StringOf("suspended_tickets[i].brand_id")
$sCause = $oJResp.StringOf("suspended_tickets[i].cause")
$sCause_id = $oJResp.StringOf("suspended_tickets[i].cause_id")
$sContent = $oJResp.StringOf("suspended_tickets[i].content")
$sCreated_at = $oJResp.StringOf("suspended_tickets[i].created_at")
$sId = $oJResp.StringOf("suspended_tickets[i].id")
$sMessage_id = $oJResp.StringOf("suspended_tickets[i].message_id")
$sRecipient = $oJResp.StringOf("suspended_tickets[i].recipient")
$subject = $oJResp.StringOf("suspended_tickets[i].subject")
$sTicket_id = $oJResp.StringOf("suspended_tickets[i].ticket_id")
$sUpdated_at = $oJResp.StringOf("suspended_tickets[i].updated_at")
$sUrl = $oJResp.StringOf("suspended_tickets[i].url")
$sChannel = $oJResp.StringOf("suspended_tickets[i].via.channel")
$sAddress = $oJResp.StringOf("suspended_tickets[i].via.source.from.address")
$sFromId = $oJResp.StringOf("suspended_tickets[i].via.source.from.id")
$sFromName = $oJResp.StringOf("suspended_tickets[i].via.source.from.name")
$sTitle = $oJResp.StringOf("suspended_tickets[i].via.source.from.title")
$sRel = $oJResp.StringOf("suspended_tickets[i].via.source.rel")
$sToAddress = $oJResp.StringOf("suspended_tickets[i].via.source.to.address")
$sToName = $oJResp.StringOf("suspended_tickets[i].via.source.to.name")
$iJ = 0
$iCount_j = $oJResp.SizeOfArray("suspended_tickets[i].attachments")
While $iJ < $iCount_j
$oJResp.J = $iJ
$sContent_type = $oJResp.StringOf("suspended_tickets[i].attachments[j].content_type")
$sContent_url = $oJResp.StringOf("suspended_tickets[i].attachments[j].content_url")
$sDeleted = $oJResp.StringOf("suspended_tickets[i].attachments[j].deleted")
$sFile_name = $oJResp.StringOf("suspended_tickets[i].attachments[j].file_name")
$sHeight = $oJResp.StringOf("suspended_tickets[i].attachments[j].height")
$sId = $oJResp.StringOf("suspended_tickets[i].attachments[j].id")
$sInline = $oJResp.StringOf("suspended_tickets[i].attachments[j].inline")
$sMalware_access_override = $oJResp.StringOf("suspended_tickets[i].attachments[j].malware_access_override")
$sMalware_scan_result = $oJResp.StringOf("suspended_tickets[i].attachments[j].malware_scan_result")
$sMapped_content_url = $oJResp.StringOf("suspended_tickets[i].attachments[j].mapped_content_url")
$size = $oJResp.StringOf("suspended_tickets[i].attachments[j].size")
$sUrl = $oJResp.StringOf("suspended_tickets[i].attachments[j].url")
$sWidth = $oJResp.StringOf("suspended_tickets[i].attachments[j].width")
$iK = 0
$iCount_k = $oJResp.SizeOfArray("suspended_tickets[i].attachments[j].thumbnails")
While $iK < $iCount_k
$oJResp.K = $iK
$sContent_type = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].content_type")
$sContent_url = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].content_url")
$sDeleted = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].deleted")
$sFile_name = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].file_name")
$sHeight = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].height")
$sId = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].id")
$sInline = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].inline")
$sMalware_access_override = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].malware_access_override")
$sMalware_scan_result = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].malware_scan_result")
$sMapped_content_url = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].mapped_content_url")
$size = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].size")
$sUrl = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].url")
$sWidth = $oJResp.StringOf("suspended_tickets[i].attachments[j].thumbnails[k].width")
$iK = $iK + 1
Wend
$iJ = $iJ + 1
Wend
$i = $i + 1
Wend
Curl Command
curl -u login:password -X GET
-H "Accept: application/json"
https://example.zendesk.com/api/v2/suspended_tickets/:id
Postman Collection Item JSON
{
"name": "Show Suspended Ticket",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/suspended_tickets/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"suspended_tickets",
":id"
],
"variable": [
{
"key": "id",
"value": "<number>"
}
]
},
"description": "#### Allowed For\n\n* Unrestricted agents\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/suspended_tickets/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"suspended_tickets",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"suspended_tickets\": [\n {\n \"attachments\": [\n {\n \"content_type\": \"<string>\",\n \"content_url\": \"<string>\",\n \"deleted\": \"<boolean>\",\n \"file_name\": \"<string>\",\n \"height\": \"<string>\",\n \"id\": \"<integer>\",\n \"inline\": \"<boolean>\",\n \"malware_access_override\": \"<boolean>\",\n \"malware_scan_result\": \"<string>\",\n \"mapped_content_url\": \"<string>\",\n \"size\": \"<integer>\",\n \"url\": \"<string>\",\n \"width\": \"<string>\",\n \"thumbnails\": [\n {\n \"content_type\": \"<string>\",\n \"content_url\": \"<string>\",\n \"deleted\": \"<boolean>\",\n \"file_name\": \"<string>\",\n \"height\": \"<string>\",\n \"id\": \"<integer>\",\n \"inline\": \"<boolean>\",\n \"malware_access_override\": \"<boolean>\",\n \"malware_scan_result\": \"<string>\",\n \"mapped_content_url\": \"<string>\",\n \"size\": \"<integer>\",\n \"url\": \"<string>\",\n \"width\": \"<string>\"\n },\n {\n \"content_type\": \"<string>\",\n \"content_url\": \"<string>\",\n \"deleted\": \"<boolean>\",\n \"file_name\": \"<string>\",\n \"height\": \"<string>\",\n \"id\": \"<integer>\",\n \"inline\": \"<boolean>\",\n \"malware_access_override\": \"<boolean>\",\n \"malware_scan_result\": \"<string>\",\n \"mapped_content_url\": \"<string>\",\n \"size\": \"<integer>\",\n \"url\": \"<string>\",\n \"width\": \"<string>\"\n }\n ]\n },\n {\n \"content_type\": \"<string>\",\n \"content_url\": \"<string>\",\n \"deleted\": \"<boolean>\",\n \"file_name\": \"<string>\",\n \"height\": \"<string>\",\n \"id\": \"<integer>\",\n \"inline\": \"<boolean>\",\n \"malware_access_override\": \"<boolean>\",\n \"malware_scan_result\": \"<string>\",\n \"mapped_content_url\": \"<string>\",\n \"size\": \"<integer>\",\n \"url\": \"<string>\",\n \"width\": \"<string>\",\n \"thumbnails\": [\n {\n \"content_type\": \"<string>\",\n \"content_url\": \"<string>\",\n \"deleted\": \"<boolean>\",\n \"file_name\": \"<string>\",\n \"height\": \"<string>\",\n \"id\": \"<integer>\",\n \"inline\": \"<boolean>\",\n \"malware_access_override\": \"<boolean>\",\n \"malware_scan_result\": \"<string>\",\n \"mapped_content_url\": \"<string>\",\n \"size\": \"<integer>\",\n \"url\": \"<string>\",\n \"width\": \"<string>\"\n },\n {\n \"content_type\": \"<string>\",\n \"content_url\": \"<string>\",\n \"deleted\": \"<boolean>\",\n \"file_name\": \"<string>\",\n \"height\": \"<string>\",\n \"id\": \"<integer>\",\n \"inline\": \"<boolean>\",\n \"malware_access_override\": \"<boolean>\",\n \"malware_scan_result\": \"<string>\",\n \"mapped_content_url\": \"<string>\",\n \"size\": \"<integer>\",\n \"url\": \"<string>\",\n \"width\": \"<string>\"\n }\n ]\n }\n ],\n \"author\": {\n \"email\": \"<string>\",\n \"id\": \"<integer>\",\n \"name\": \"<string>\"\n },\n \"brand_id\": \"<integer>\",\n \"cause\": \"<string>\",\n \"cause_id\": \"<integer>\",\n \"content\": \"<string>\",\n \"created_at\": \"<dateTime>\",\n \"id\": \"<integer>\",\n \"message_id\": \"<string>\",\n \"recipient\": \"<string>\",\n \"subject\": \"<string>\",\n \"ticket_id\": \"<integer>\",\n \"updated_at\": \"<dateTime>\",\n \"url\": \"<string>\",\n \"via\": {\n \"channel\": \"<string>\",\n \"source\": {\n \"from\": {\n \"address\": \"<string>\",\n \"id\": \"<integer>\",\n \"name\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"rel\": \"<string>\",\n \"to\": {\n \"address\": \"<string>\",\n \"name\": \"<string>\"\n }\n }\n }\n },\n {\n \"attachments\": [\n {\n \"content_type\": \"<string>\",\n \"content_url\": \"<string>\",\n \"deleted\": \"<boolean>\",\n \"file_name\": \"<string>\",\n \"height\": \"<string>\",\n \"id\": \"<integer>\",\n \"inline\": \"<boolean>\",\n \"malware_access_override\": \"<boolean>\",\n \"malware_scan_result\": \"<string>\",\n \"mapped_content_url\": \"<string>\",\n \"size\": \"<integer>\",\n \"url\": \"<string>\",\n \"width\": \"<string>\",\n \"thumbnails\": [\n {\n \"content_type\": \"<string>\",\n \"content_url\": \"<string>\",\n \"deleted\": \"<boolean>\",\n \"file_name\": \"<string>\",\n \"height\": \"<string>\",\n \"id\": \"<integer>\",\n \"inline\": \"<boolean>\",\n \"malware_access_override\": \"<boolean>\",\n \"malware_scan_result\": \"<string>\",\n \"mapped_content_url\": \"<string>\",\n \"size\": \"<integer>\",\n \"url\": \"<string>\",\n \"width\": \"<string>\"\n },\n {\n \"content_type\": \"<string>\",\n \"content_url\": \"<string>\",\n \"deleted\": \"<boolean>\",\n \"file_name\": \"<string>\",\n \"height\": \"<string>\",\n \"id\": \"<integer>\",\n \"inline\": \"<boolean>\",\n \"malware_access_override\": \"<boolean>\",\n \"malware_scan_result\": \"<string>\",\n \"mapped_content_url\": \"<string>\",\n \"size\": \"<integer>\",\n \"url\": \"<string>\",\n \"width\": \"<string>\"\n }\n ]\n },\n {\n \"content_type\": \"<string>\",\n \"content_url\": \"<string>\",\n \"deleted\": \"<boolean>\",\n \"file_name\": \"<string>\",\n \"height\": \"<string>\",\n \"id\": \"<integer>\",\n \"inline\": \"<boolean>\",\n \"malware_access_override\": \"<boolean>\",\n \"malware_scan_result\": \"<string>\",\n \"mapped_content_url\": \"<string>\",\n \"size\": \"<integer>\",\n \"url\": \"<string>\",\n \"width\": \"<string>\",\n \"thumbnails\": [\n {\n \"content_type\": \"<string>\",\n \"content_url\": \"<string>\",\n \"deleted\": \"<boolean>\",\n \"file_name\": \"<string>\",\n \"height\": \"<string>\",\n \"id\": \"<integer>\",\n \"inline\": \"<boolean>\",\n \"malware_access_override\": \"<boolean>\",\n \"malware_scan_result\": \"<string>\",\n \"mapped_content_url\": \"<string>\",\n \"size\": \"<integer>\",\n \"url\": \"<string>\",\n \"width\": \"<string>\"\n },\n {\n \"content_type\": \"<string>\",\n \"content_url\": \"<string>\",\n \"deleted\": \"<boolean>\",\n \"file_name\": \"<string>\",\n \"height\": \"<string>\",\n \"id\": \"<integer>\",\n \"inline\": \"<boolean>\",\n \"malware_access_override\": \"<boolean>\",\n \"malware_scan_result\": \"<string>\",\n \"mapped_content_url\": \"<string>\",\n \"size\": \"<integer>\",\n \"url\": \"<string>\",\n \"width\": \"<string>\"\n }\n ]\n }\n ],\n \"author\": {\n \"email\": \"<string>\",\n \"id\": \"<integer>\",\n \"name\": \"<string>\"\n },\n \"brand_id\": \"<integer>\",\n \"cause\": \"<string>\",\n \"cause_id\": \"<integer>\",\n \"content\": \"<string>\",\n \"created_at\": \"<dateTime>\",\n \"id\": \"<integer>\",\n \"message_id\": \"<string>\",\n \"recipient\": \"<string>\",\n \"subject\": \"<string>\",\n \"ticket_id\": \"<integer>\",\n \"updated_at\": \"<dateTime>\",\n \"url\": \"<string>\",\n \"via\": {\n \"channel\": \"<string>\",\n \"source\": {\n \"from\": {\n \"address\": \"<string>\",\n \"id\": \"<integer>\",\n \"name\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"rel\": \"<string>\",\n \"to\": {\n \"address\": \"<string>\",\n \"name\": \"<string>\"\n }\n }\n }\n }\n ]\n}"
}
]
}