Creating and managing requests
A request is an end user's perspective on a ticket. The following actions can be performed with theCreate RequestandUpdate Requestendpoints:
You can alsocreate anonymous requestswhen creating a ticket andadd collaboratorsto an existing ticket.
Setting collaborators
Note: If the account has the CCs and Followers feature enabled, then collaborators can still be set usingcollaborators
andadditional_collaborators
, which will automatically make end users CCs and agents followers. The use of email_ccs and followers is preferred for these accounts. SeeSetting Email CCsandSetting Followersfor more details.
When creating a ticket, you can set collaborators on a ticket using thecollaborators
parameter.
An email notification is sent to the collaborators when the request is created.
Thecollaborators
parameter takes an array consisting of a combination of user ids, email addresses, or objects containing aname
andemail
property.
- 562562562
- "[email protected]"
{ "name": "Someone Special", "email": "[email protected]" }
Use an object to create the user on the fly with the appropriate name in your Zendesk Support instance.
Example
{
"ticket":{
"collaborators":[562,"[email protected]",{"name":"Someone Else","email":"[email protected]"}]
}
}
The new or updated collaborators will be specified in the JSON response by a property namedcollaborator_ids
. The response won't have acollaborators
property.
Setting email CCs
When creating or updating a request, you can set email CCs on a request using the parameteremail_ccs
.
An email notification is sent to the CCs when the request is created or updated depending on trigger settings.
Theemail_ccs
parameter takes an array of objects representing users. Each object must have an identifier, either user ID (user_id
) or email address (user_email
). If an email address is specified and the user doesn't exist in the account, a new user will be created. Additionally, the keyaction
可以设置为“将”或“删除”——印第安纳州吗icates whether the user should be added to or removed from the email CCs list. If theaction
key is not given, the default ofput
is used. Optionally, if a new user is created,user_name
can be specified to set the new user's name. If the user will be implicitly created and auser_name
is not given, the user name will be derived from the local part of the email address. If an email address not associated with a user is included (with eg. the intention to implicitly create the user), but the "action" key is valued "delete", that email address will not be created and/or added as an email CC.
Email CCs will not be updated if an internal note is also added to the request in the same update.
Example request
{
"request":{
"email_ccs":[
{"user_id":"562624","action":"put"},
{"user_id":"243642","action":"delete"},
{"user_email":"[email protected]","user_name":"Someone Else","action":"put"}
]
}
}
Creating anonymous requests
匿名的请求必须first be enabled in the Zendesk Admin Center by a Zendesk admin. If you're not an admin, ask an admin to do it for you. To enable anonymous requests, follow the procedure inAnybody can submit tickets, no registration requiredin Zendesk help. Make sure theRequire authentication for request and uploads APIsoption is not selected.
To create anonymous requests
- Omit the authorization header.
- Include a
requester
object in therequest
object.
Therequester
object has the following properties. Onlyname
is required.
Name | Required | Description |
---|---|---|
name | yes | A real or arbitrary name for the requester |
no | An email address | |
locale | no | A BCP-47 compliant tag |
locale_id | no | See theLocalesAPI |
If bothlocale
andlocale_id
are included on create,locale
is used andlocale_id
is ignored.
Example
{
"request":{
"requester":{"name":"Anonymous customer"},
"subject":"Help!",
"comment":{"body":"My printer is on fire!"}
}
}
Adding collaborators
When updating a ticket, you can add new collaborators on a ticket using theadditional_collaborators
parameter.
An email notification is sent to the collaborators when the ticket is updated.
Theadditional_collaborators
takes an array consisting of a combination of user ids, email addresses, or objects containing aname
andemail
property.
- 562562562
- "[email protected]"
{ "name": "Someone Special", "email": "[email protected]" }
Example
{
"ticket":{
"additional_collaborators":[562,"[email protected]",{"name":"Someone Else","email":"[email protected]"}]
}
}
The new or updated collaborators will be specified in the JSON response by a property namedcollaborator_ids
. The response won't have aadditional_collaborators
property.