The following document contains information pertaining to how an Arcadia customer can authenticate themselves, create and update tickets, add attachments, view a single ticket, and fetch all tickets for their organization through the Zendesk Request API for End Users.
Authentication:
Zendesk API utilizes Basic Auth. This entails passing in a username (email) and a password to each request. Once you have successfully set up your authentication, you can then move on to creating tickets through the Zendesk API.
Create a Ticket:
The endpoint used to create tickets is POST /api/v2/requests
- Arcadias Zendesk subdomain is https://urjanet.zendesk.com
- The full endpoint location is: https://urjanet.zendesk.com/api/v2/requests
curl --location 'https://urjanet.zendesk.com/api/v2/requests' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <token>' \
--data '{
"request": {
"subject": "Demo test ticket",
"comment": {
"body": "Step 1 is to create the ticket"
},
"custom_fields": [
{
"id": 360004069311,
"value": "utility_cloud"
},
{
"id": 360003278132,
"value": "i_found_an_error_in_my_data"
}
]
}
}'
As per Arcadia's setup, there are two fields that are mandatory, as shown on the image above. Below is the enumerated list of values.
Customer Classification
The field Customer Classification has an id of id=360003278132.
Currently there are four options available to this field:
Zendesk UI Value | Corresponding Zendesk API Value |
General Question | i_have_a_general_question |
I found an error in my data | i_found_an_error_in_my_data |
I am missing a bill | i_am_missing_data |
My request is not listed | my_issue_is_not_listed |
Arcadia reserves the right to change, add, or remove any options listed above without prior customer notification. Utilizing the correct classification ensures that your ticket is routed to the correct team as quickly as possible.
Product Type
The field Product Type has an id of id=360004069311.
Currently there are eight options available to this field:
Zendesk UI Value | Corresponding Zendesk API Value |
Utility Bill Data or UDS | utility_bill_data |
Utility Cloud | utility_cloud |
Utility Interval Data | utility_interval_data |
Arcadia reserves the right to change, add, or remove any options listed above without prior customer notification.
Retrieving an Individual Ticket:
curl --location 'https://urjanet.zendesk.com/api/v2/requests/<requestId>.json' \
--header 'Authorization: Basic <token>' \
Once you have successfully created your first ticket, you can fetch the ticket details using the Zendesk Request API.
The endpoint used to call a specific ticket is GET /api/v2/requests/{request_id}
- Arcadias Zendesk subdomain is https://urjanet.zendesk.com
- The full endpoint location is https://urjanet.zendesk.com/api/v2/requests/{request_id}
Retrieving All Tickets:
curl --location 'https://urjanet.zendesk.com/api/v2/requests.json' \
--header 'Authorization: Basic YWJmYWxsMTEyMkBnbWFpbC5jb206Z29sZGZpc2gyNDY=' \
--header 'Cookie: _zendesk_cookie=BAhJIhl7ImRldmljZV90b2tlbnMiOnt9fQY6BkVU--0bf2100788cb010d0183feca16aaf88ccaf719ca'
Once you have successfully created one or more tickets, you can then fetch all tickets using the list tickets request.
The endpoint used to call all tickets is GET /api/v2/requests
- Arcadias Zendesk subdomain is https://urjanet.zendesk.com
- The full endpoint location is https://urjanet.zendesk.com/api/v2/requests
Attaching Attachments to a Ticket:
Once you have successfully created a ticket, you can then move on to attaching attachments to that ticket using Zendesk's two step process. The API allows for the upload of different format files, however, the most widely used formats are listed on the table below. The format selected must match the file uploaded in order for the following two steps to work.
Document Type | Parameter | Content-Type Header |
Image | .JPG | image/jpeg |
Image | .PNG | image/png |
XLSX | .XLSX | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
Text | .CSV | text/csv |
Step 1 – Upload file to Zendesk repository:
The endpoint used to upload a file to the repository is POST /api/v2/uploads/
- The file type noted via the header Content-Type must match the file being uploaded.
curl --location 'https://urjanet.zendesk.com/api/v2/uploads?filename=%3DtestImage2.jpeg' \
--header 'Content-Type: image/jpeg' \
--header 'Authorization: Basic <token>' \
--data '@/Users/testUser/Desktop/testImage2.jpeg'
Step 2–Attaching uploaded document to a ticket:
The endpoint used is PUT api/v2/requests/{request_id}
- Arcadias Zendesk subdomain is https://urjanet.zendesk.com
- The full endpoint location is: https://urjanet.zendesk.com/api/v2/requests/{request_id}
Once you have successfully uploaded your file to the file repository, you can then move on to the next step which will allow you to attach that file to a single ticket through the Zendesk Request API.
- Note: you can only use a given upload token once successfully each.
curl --location --request PUT 'https://urjanet.zendesk.com/api/v2/requests/<requestId>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <token>' \
--data '{
"request": {
"comment": {
"body": "Attaching a jpeg",
"uploads": [
"<token>"
]
}
}
}'
You should see the file successfully uploaded after this step.