PowerBuilder / Support API / Reorder Ticket Forms
Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Name
string ls_Active
string ls_Created_at
string ls_Default
string ls_Display_name
string ls_End_user_visible
string ls_Id
string ls_In_all_brands
string ls_Position
string ls_Raw_display_name
string ls_Raw_name
string ls_Updated_at
string ls_Url
integer j
integer li_Count_j
integer li_Adipisicing_648
string ls_Veniamf
string ls_Id9
integer li_Ametb8
string ls_Ut08f
string ls_Non81
string ls_In_6b8
integer li_Magna1
integer li_Pariatur1
integer li_Consectetur3
integer li_Sed_6f0
string ls_Sint1d2
integer li_Cupidatat_667
string ls_Magna_d8
string ls_StrVal
integer i
integer li_Count_i
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_Http.BasicAuth = 1
loo_Http.Login = "login"
loo_Http.Password = "password"
loo_Http.SetRequestHeader("Accept","application/json")
loo_Resp = loo_Http.QuickRequest("PUT","https://example.zendesk.com/api/v2/ticket_forms/reorder")
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
return
end if
loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")
loo_Resp.GetBodySb(loo_SbResponseBody)
loo_JResp = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")
loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0
Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()
li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
Write-Debug "Response Header:"
Write-Debug loo_Resp.Header
Write-Debug "Failed."
destroy loo_Resp
destroy loo_Http
destroy loo_SbResponseBody
destroy loo_JResp
return
end if
destroy loo_Resp
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "ticket_forms": [
// {
// "name": "<string>",
// "active": "<boolean>",
// "agent_conditions": [
// {
// "adipisicing_648": -24086995
// },
// {
// "veniamf": "cupida"
// }
// ],
// "created_at": "<dateTime>",
// "default": "<boolean>",
// "display_name": "<string>",
// "end_user_conditions": [
// {
// "in_6b8": "Ut id",
// "magna1": -6245214
// },
// {
// "pariatur1": 67097325,
// "consectetur3": false,
// "sed_6f0": true
// }
// ],
// "end_user_visible": "<boolean>",
// "id": "<integer>",
// "in_all_brands": "<boolean>",
// "position": "<integer>",
// "raw_display_name": "<string>",
// "raw_name": "<string>",
// "restricted_brand_ids": [
// "<integer>",
// "<integer>"
// ],
// "ticket_field_ids": [
// "<integer>",
// "<integer>"
// ],
// "updated_at": "<dateTime>",
// "url": "<string>"
// },
// {
// "name": "<string>",
// "active": "<boolean>",
// "agent_conditions": [
// {
// "id9": "laborum veniam",
// "ametb8": false
// },
// {
// "ut08f": -79491980.10398532,
// "non81": "Duis est fugiat officia consequat"
// }
// ],
// "created_at": "<dateTime>",
// "default": "<boolean>",
// "display_name": "<string>",
// "end_user_conditions": [
// {
// "sint1d2": "sint ex et"
// },
// {
// "cupidatat_667": true,
// "magna_d8": 64894285.255497575
// }
// ],
// "end_user_visible": "<boolean>",
// "id": "<integer>",
// "in_all_brands": "<boolean>",
// "position": "<integer>",
// "raw_display_name": "<string>",
// "raw_name": "<string>",
// "restricted_brand_ids": [
// "<integer>",
// "<integer>"
// ],
// "ticket_field_ids": [
// "<integer>",
// "<integer>"
// ],
// "updated_at": "<dateTime>",
// "url": "<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
li_Count_i = loo_JResp.SizeOfArray("ticket_forms")
do while i < li_Count_i
loo_JResp.I = i
ls_Name = loo_JResp.StringOf("ticket_forms[i].name")
ls_Active = loo_JResp.StringOf("ticket_forms[i].active")
ls_Created_at = loo_JResp.StringOf("ticket_forms[i].created_at")
ls_Default = loo_JResp.StringOf("ticket_forms[i].default")
ls_Display_name = loo_JResp.StringOf("ticket_forms[i].display_name")
ls_End_user_visible = loo_JResp.StringOf("ticket_forms[i].end_user_visible")
ls_Id = loo_JResp.StringOf("ticket_forms[i].id")
ls_In_all_brands = loo_JResp.StringOf("ticket_forms[i].in_all_brands")
ls_Position = loo_JResp.StringOf("ticket_forms[i].position")
ls_Raw_display_name = loo_JResp.StringOf("ticket_forms[i].raw_display_name")
ls_Raw_name = loo_JResp.StringOf("ticket_forms[i].raw_name")
ls_Updated_at = loo_JResp.StringOf("ticket_forms[i].updated_at")
ls_Url = loo_JResp.StringOf("ticket_forms[i].url")
j = 0
li_Count_j = loo_JResp.SizeOfArray("ticket_forms[i].agent_conditions")
do while j < li_Count_j
loo_JResp.J = j
li_Adipisicing_648 = loo_JResp.IntOf("ticket_forms[i].agent_conditions[j].adipisicing_648")
ls_Veniamf = loo_JResp.StringOf("ticket_forms[i].agent_conditions[j].veniamf")
ls_Id9 = loo_JResp.StringOf("ticket_forms[i].agent_conditions[j].id9")
li_Ametb8 = loo_JResp.BoolOf("ticket_forms[i].agent_conditions[j].ametb8")
ls_Ut08f = loo_JResp.StringOf("ticket_forms[i].agent_conditions[j].ut08f")
ls_Non81 = loo_JResp.StringOf("ticket_forms[i].agent_conditions[j].non81")
j = j + 1
loop
j = 0
li_Count_j = loo_JResp.SizeOfArray("ticket_forms[i].end_user_conditions")
do while j < li_Count_j
loo_JResp.J = j
ls_In_6b8 = loo_JResp.StringOf("ticket_forms[i].end_user_conditions[j].in_6b8")
li_Magna1 = loo_JResp.IntOf("ticket_forms[i].end_user_conditions[j].magna1")
li_Pariatur1 = loo_JResp.IntOf("ticket_forms[i].end_user_conditions[j].pariatur1")
li_Consectetur3 = loo_JResp.BoolOf("ticket_forms[i].end_user_conditions[j].consectetur3")
li_Sed_6f0 = loo_JResp.BoolOf("ticket_forms[i].end_user_conditions[j].sed_6f0")
ls_Sint1d2 = loo_JResp.StringOf("ticket_forms[i].end_user_conditions[j].sint1d2")
li_Cupidatat_667 = loo_JResp.BoolOf("ticket_forms[i].end_user_conditions[j].cupidatat_667")
ls_Magna_d8 = loo_JResp.StringOf("ticket_forms[i].end_user_conditions[j].magna_d8")
j = j + 1
loop
j = 0
li_Count_j = loo_JResp.SizeOfArray("ticket_forms[i].restricted_brand_ids")
do while j < li_Count_j
loo_JResp.J = j
ls_StrVal = loo_JResp.StringOf("ticket_forms[i].restricted_brand_ids[j]")
j = j + 1
loop
j = 0
li_Count_j = loo_JResp.SizeOfArray("ticket_forms[i].ticket_field_ids")
do while j < li_Count_j
loo_JResp.J = j
ls_StrVal = loo_JResp.StringOf("ticket_forms[i].ticket_field_ids[j]")
j = j + 1
loop
i = i + 1
loop
destroy loo_Http
destroy loo_SbResponseBody
destroy loo_JResp
Curl Command
curl -u login:password -X PUT
-H "Accept: application/json"
https://example.zendesk.com/api/v2/ticket_forms/reorder
Postman Collection Item JSON
{
"name": "Reorder Ticket Forms",
"request": {
"method": "PUT",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/ticket_forms/reorder",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"ticket_forms",
"reorder"
]
},
"description": "#### Allowed For\n* Admins\n\n#### Request Parameters\n\nYou can pass in the following parameter in the payload:\n\n| Name | Type | Comment\n| ------------------- | ------ | --------\n| ticket_form_ids | array | An array of ticket form ids. Example: \"[2, 23, 46, 50]\"\n"
},
"response": [
{
"name": "Success response",
"originalRequest": {
"method": "PUT",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/ticket_forms/reorder",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"ticket_forms",
"reorder"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"ticket_forms\": [\n {\n \"name\": \"<string>\",\n \"active\": \"<boolean>\",\n \"agent_conditions\": [\n {\n \"adipisicing_648\": -24086995\n },\n {\n \"veniamf\": \"cupida\"\n }\n ],\n \"created_at\": \"<dateTime>\",\n \"default\": \"<boolean>\",\n \"display_name\": \"<string>\",\n \"end_user_conditions\": [\n {\n \"in_6b8\": \"Ut id\",\n \"magna1\": -6245214\n },\n {\n \"pariatur1\": 67097325,\n \"consectetur3\": false,\n \"sed_6f0\": true\n }\n ],\n \"end_user_visible\": \"<boolean>\",\n \"id\": \"<integer>\",\n \"in_all_brands\": \"<boolean>\",\n \"position\": \"<integer>\",\n \"raw_display_name\": \"<string>\",\n \"raw_name\": \"<string>\",\n \"restricted_brand_ids\": [\n \"<integer>\",\n \"<integer>\"\n ],\n \"ticket_field_ids\": [\n \"<integer>\",\n \"<integer>\"\n ],\n \"updated_at\": \"<dateTime>\",\n \"url\": \"<string>\"\n },\n {\n \"name\": \"<string>\",\n \"active\": \"<boolean>\",\n \"agent_conditions\": [\n {\n \"id9\": \"laborum veniam\",\n \"ametb8\": false\n },\n {\n \"ut08f\": -79491980.10398532,\n \"non81\": \"Duis est fugiat officia consequat\"\n }\n ],\n \"created_at\": \"<dateTime>\",\n \"default\": \"<boolean>\",\n \"display_name\": \"<string>\",\n \"end_user_conditions\": [\n {\n \"sint1d2\": \"sint ex et\"\n },\n {\n \"cupidatat_667\": true,\n \"magna_d8\": 64894285.255497575\n }\n ],\n \"end_user_visible\": \"<boolean>\",\n \"id\": \"<integer>\",\n \"in_all_brands\": \"<boolean>\",\n \"position\": \"<integer>\",\n \"raw_display_name\": \"<string>\",\n \"raw_name\": \"<string>\",\n \"restricted_brand_ids\": [\n \"<integer>\",\n \"<integer>\"\n ],\n \"ticket_field_ids\": [\n \"<integer>\",\n \"<integer>\"\n ],\n \"updated_at\": \"<dateTime>\",\n \"url\": \"<string>\"\n }\n ]\n}"
}
]
}