Recent searches


No recent searches

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



Edited Nov 11, 2024


8

15

15 comments

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 the Conversation 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


image avatar

Remi

Zendesk Customer Care

Hi Lev,

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 to readwrite, and chat.

Please refer to the section Authentication in Chat Conversations API for 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!

Have a great rest of your day.

Best regards,

 

0


I've got an access token generated through "Implicit grant flow" detailed at https://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


image avatar

John Espina

Zendesk Customer Care

Hi Matt,

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


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\":\"<html>\\r\\n<head><title>500 Internal Server Error</title></head>\\r\\n<body>\\r\\n<center><h1>500 Internal Server Error</h1></center>\\r\\n<hr><center>nginx</center>\\r\\n</body>\\r\\n</html>\\r\\n\",\"name\":\"UNAUTHORIZED\"}],\"data\":null}",

 

Can you help me, what am I missing?

2


I have the same error

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

0


I also get the same error.

0


image avatar

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 a conversation with us and provide the actual replication steps

0


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


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


Hello whats the expiration period of the bearer token, please  

Thanks

0


image avatar

Dane

Zendesk Engineering

An access token doesn't expire but it can be revoked.

0


Niall Colfer You're the best! I tried to follow the documentation and it is chaotic and a huge mess. 

Thanks to your approach I was able to get the token, was trying this for daaaayz!

Unfortunately could only find this in the Forum, maybe it could be linked to in this documentation?

https://developer.zendesk.com/documentation/live-chat/getting-started/auth/#oauth-authentication

Would be a huge help for everyone. Good job on putting this together ♥

0


Hi, When i create client_credentials token use the example:
 

  curl https://{subdomain}.zendesk.com/oauth2/chat/token \
  -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
I got {"error": "invalid_client"}. It seems my param is correct!

  

0


Could you please mention how to generate the API GRAPHQL token:
https://chat-api.zopim.com/graphql/request

0


Please sign in to leave a comment.