Chat API tutorial: Generating an OAuth token (integrated Chat accounts)

Return to top

12 Comments

  • Lev

    hi, i followed the steps in the article and got an access token with no errors :D

    but I seems cannot use this token to access theConversation APi,i got invalid scope error,

    I added a screen shot here for the error of scope

    also this is how i get the access token

    when i did this cURL call, I tried with scope = chat / scope= read write, i could get token no problem, but I always end up with same invalid scope error when I try to access the conversation API,

    Any suggestion is appreciated

    thank you!

    0
  • Remi
    Zendesk Customer Care

    HiLev,

    Thank you for your post, hope you are doing well today!

    According to the requests / calls you want to make through the conversation API you will need more than the Chat scope and have to set the scope of the token toread,write, andchat.

    Please refer to the sectionAuthenticationinChat Conversations APIfor a better understanding.

    For instance, retrieve the Token with :

    https://www.zopim.com/oauth2/authorizations/new?response_type=token&client_id=CLIENT_ID&scope=read%20write%20chat&subdomain=SUBDOMAIN

    I would also encourage you to have a look at the following documentation :Getting started with the Chat Conversations API, that should point you in the right direction.

    Hope this helps!

    有一个伟大的一天。

    Best regards,

    0
  • Matt Schembri

    I've got an access token generated through "Implicit grant flow" detailed athttps://developer.亚博zendesk.com/documentation/live-chat/getting-started/auth/

    How can my Zendesk support app use this token?

    Is there a clear cut way to get chat data into a zendesk support app?

    0
  • John Espina
    Zendesk Customer Care

    嗨,马特,

    In regards to your concern, you can use OAuth 2 to authenticate all your application's API requests to Zendesk. OAuth provides a secure way for your application to access Zendesk data without having to store and use the passwords of Zendesk users, which is sensitive information.

    Please check this article:https://support.zendesk.com/hc/en-us/articles/203663836-Using-OAuth-authentication-with-your-application

    John Espina | Customer Advocate

    0
  • Petre

    Hi! I've managed to get the access token, using the scopes: read write chat, but I can't start agent session. I get "UNAUTHORIZED" error every time:

    {\"errors\":[{\"UUID\":\"ccd32285-5895-45c4-bec5-6bd27b15f4a2\",\"message\":\"\\r\\n500 Internal Server Error \\r\\n\\r\\n

    500 Internal Server Error

    \\r\\n
    nginx
    \\r\\n\\r\\n\\r\\n\",\"name\":\"UNAUTHORIZED\"}],\"data\":null}",

    Can you help me, what am I missing?

    2
  • Chien Dong

    I have the same error

    My access_token used the "read", "write" and "chat" scopes

    0
  • P'Bom

    I also get the same error.

    0
  • Cheeny Aban
    Zendesk Customer Care
    Hi Chien and Pakpoom,

    If you were able to confirm that all the steps have been properly followed and you keep on receiving an error. I would suggest that you initiate aconversationwith us and provide the actual replication steps
    0
  • Nicholas Walsh

    Why is the query string returned to my callback URL with a hash (#) instead of a question mark? Everything after # in the URL will be ignored by the server, so redirecting to a backend script means the query string cannot be parsed.

    0
  • Scotty Loewen

    It's worth noting that the request will 400 if you use your full subdomain (company.zendesk.com), in this instance it's looking just for the "company" part of that. If this article could be edited to make that clearer in the beginning (first reference of subdomain) that would have saved me twenty minutes of troubleshooting today :)

    0
  • Jinen Abdelhak

    Hello whats the expiration period of the bearer token, please

    Thanks

    0
  • Dane
    Zendesk Engineering
    An access token doesn't expire but it can berevoked.
    0

Pleasesign into leave a comment.

Powered by Zendesk