I'm attempting to create ZenDesk tickets using an OAuth Token from the Google Scripts API.
When creating the ZenDesk ticket using an token provided for an Agent, it works fine. However, when running it as an end user, it obtains a token fine, then fails to create the request throwing the error:
---
{"error":"RecordInvalid","description":"Record validation errors","details":{"base":[{"description":"Subject: cannot be blank","error":"BlankValue","field_key":"subject"},{"description":"Type: cannot...)
---
The token is correct as the same token works when listing requests using the GET method.
The JSON payload and options must be correct as the same code works correctly when initiating the request from an Agent, it's only when initiating it from an end user that it fails.
Payload:
---
"request" : {
"subject": "Test Ticket Subject",
"comment": { "body": "Test Ticket Body" }
}
---
Body:
---
'method': 'post',
'payload' : JSON.stringify(formData),
'contentType' : 'application/json',
'headers' : {"Authorization" : "Bearer " + token}
---
Doing a GET on the requests.json works correctly and enumerates the requests as expected. It's only POST that's failing
Are there specific permissions that are required for an end-user to post a request with their own token?

That sounds reasonable Calum. So I'll just point out again then, an end-user account can generate an OAuth token and use it against the /api/v2/requests.json API. It sounded like this wasn't working for you when I read the original post. If that's still the case, then more details will probably be needed via a private ticket. Let me know and I can create one for you.