When I make the call as myself it works fine. But when I a new request on behalf of them it is giving me an error.
For example:
POST: https://thiswayglobal.zendesk.com/api/v2/requests.json
{ "request": { "subject": "Help!",
"comment": {
"body": "My printer is on fire!",
"type": "Comment"
},
"priority": "normal",
"type": "incident",
"status": "open" } }
Works fine for opening my own ticket. When I add the following to the header:
"X-On-Behalf-Of","tomjones.example.com"
I get the following error:
{
"error": "RecordInvalid",
"description": "Record validation errors",
"details": {
"base": [ { "description": "Type: cannot be blank",
"error": "BlankValue",
"field_key": 360040711652 } ] } }
The issue is that I am creating a REQUEST and not a TICKET and in the documentation for requests says to
"Read-only first comment on the request. When creating a request, use comment to set the description"
I'm also using the exact form in the documentation. Can you please help?
Thank you so much for posting in the Community! I'm glad your team was able to resolve this. Also, thanks for following up on the post and sharing your solution. I know we can all relate when it comes to naming convention mishaps and I'm sure this will be a useful tip for many.
Hope you have a great weekend!
Best,
Erica - Dev Support