Generating a REST API token for integrated Chat accounts Follow



  • Avatar
    Hanlin Chen

    I can see if I don't use the code quick enough, I get an invalid_grant error

    However, I always get an access_denied error otherwise... Can anyone suggest which step I could have missed? (I am the admin of both Zendesk chat and support)


  • Avatar
    Niall Colfer

    Hi Hanlin,

    Thanks for letting us know. I see you have an open ticket with my colleague to troubleshoot further, we'll gather some details from you regarding your issue there.

  • Avatar
    Jan Marowski

    Hi Niall,


    I have problem with final step. I'm getting:

    {{"description": "The method is not allowed for the requested URL.", "error": "Method Not Allowed"}}

    Can you tell me if this is some setting that I can set or this is what you have mentioned in beginning of this article in conditions?



  • Avatar
    Ruth Anne Dilig (Edited )


    I understand that this procedure is for authorization code grant type. Can you also provide a tutorial on how I can get an access token with client_credentials grant type? I am using the curl command below which I found in and I am getting an error: "invalid_client". Thanks

    curl \
      -H "Content-Type: application/x-www-form-urlencoded" \
      -d 'grant_type=client_credentials&client_id={your_client_id}&client_secret={your_client_secret}' \
      -X POST
  • Avatar
    Ruth Anne Dilig

    Hello, I already solved this issue. I just wanna share the solution if grant_type is client_credentials. The client_type must be set to confidential to be able to get the access token

  • Avatar
    ★Panayiotis Georgiou


    I have tried to connect to the api and still getting CORS problems

    Failed to load Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access.

    Can you tell me if this is some setting that I can avoid the CORS problems ?




  • Avatar
    Logan McNiece

    I am in the same boat as Hanlin Chen. I can get the the auth code via step #3, but no matter what I do I get "access_denied" for step #4. I also am an admin of both Zendesk chat and support. What could be causing this?

    Also, I'd advise updating your documentation at to highlight this different authentication pattern. It is super confusing for anyone on an integrated Zopim-Zendesk account. I spent three hours trying to get this to work until accidentally stumbling on this thread via a google search.

  • Avatar
    Logan McNiece

    Just a call out. I figured out the issue for my instance of the "access_denied", not sure if it was the same for Chen. I was not specifying localhost:8080 as my redirect.

  • Avatar
    Hani Tanna

    hello... i got error that unsupported_grant_type


  • Avatar
    Jim Williams

    I found this process was a little easier when I modified it as such:

    Step 1 - Request a token rather than a code using this URL:

    Step 2 - Skipped.

    Step 3 - Get the token from the URL bar in the browser.  The URL in the bar will look similar to:


    Only grab the value for access_token.

    Step 4 - Skipped.

    Step 5 - Use the access_token from Step 3 directly.


    Hopefully this will help to simplify the process.

Please sign in to leave a comment.

Powered by Zendesk