Missing scopes Error in Configuration API V3

Hi,
I have application with features like oAuth 2.0 and read_agent_chats. I tried new Configuration API V3 . But I got “Missing scopes” error.

I tried to add scopes in authorization url as given below but still got same error.

https://accounts.livechatinc.com/
  ?response_type=token
  &client_id=<client_id>
  &redirect_uri=<redirect_uri>
  &state='extra params'
  &scopes='chats--all:ro, chats--access:ro, chats--my:ro'

Note- Already required scopes are added to the application in developer console.  

Please suggest any solution. Thanks.

Hello,

The scopes need to be added only in the developers console and the token generated will include them automatically.

Can you tell me which method/endpoint you’re trying to use in configuration API that returns you the missing scopes error?

POST
https://api.livechatinc.com/v3.1/agent/action/get_archives
-H ‘Authorization: <access_token>’
-H ‘Content-Type: application/json’
-d ‘{}’

Can you please validate the token you are using the endpoint described here?

Let me know what is the response you get from
https://accounts.livechatinc.com/info

I tried to get_archives api of an agent, but still i got same below error-
{
“error”: {
“type”: “authorization”,
“message”: "Missing scope chats--all:ro, chats--access:ro, chats--my:ro"
}
}

I validated token, I got below response-
{
“access_token”: <access_token>,
“account_id”: <account_id>,
“client_id”: <client_id>,
“entity_id”: “plugins@scoop.ai”,
“expires_in”: 27975,
“license_id”: 11285022,
“organization_id”: <organization_id>,
“refresh_token”: <refresh_token>,
“scope”: “visitors_read,webhooks_manage,tags_write,reports_read,goals_write,routing_write,unban_customer,archives_read,properties_manage,buttons_manage,groups_write,tickets_read,languages_read,tags_read,greetings_read,in_app_msg_manage,ban_customer,agents_read,routing_read,surveys_read,billing_manage”,
“token_type”: “Bearer”
}
I can see chats related scopes are missing, but how should i add those scopes ?

Hello plugins,

To add scopes to your token, first go to your apps in developers console: https://developers.livechatinc.com/console/apps

Choose your app and select Authorization building block - https://take.ms/5jcJ8

Scrolling down you will see a list of all your current scopes and an option to add more if you are missing some: https://take.ms/cpMUd

Once you add required scopes, save changes and generate new token using clientID of this app. All new tokens will now include the updated list of scopes from the console.

Hope that helps,
Jakub, LiveChat Inc.

1 Like

I added scopes into the app and generate new access token. Then tried below API-
POST
https://api.livechatinc.com/v3.1/agent/action/get_archives
-H ‘Authorization: <access_token>’
-H ‘Content-Type: application/json’
-d ‘{}’

Response-
{
“error”: {
“type”: “authorization”,
“message”: "Missing scope chats--all:ro, chats--access:ro, chats--my:ro"
}
}
I got same error even generated new token after adding new scopes to app.

Hello plugins,

I have checked both apps created on your account: ScoopAI and New ScoopAI and neither has the required scopes added and saved.
Please open developers console in incognito/private mode and make sure to save changes after adding the scopes. Refresh the page afterwards and double check the list to make sure scopes are properly saved - then generate a new token and retry the request.

Best,
Jakub, LiveChat inc

Hi,
Now I have only one app ScoopAI. I deleted New ScoopAI app.
I opened app in incognito mode and other browser, but I can see scopes are added in my app.
Again I regenrate access_token and test but same error-
{
“error”: {
“type”: “authorization”,
“message”: "Missing scope chats--all:ro, chats--access:ro, chats--my:ro "
}
}

Can you please share a screenshot of the added scopes in your dev console? And provide the client_id of the app in question? I will investigate that

Hi,
I sent screenshots of an app in the livechat’s developer console. Please check scopes are already added. client_id also available in screenshot.
Thanks.

Hey,

Each api method requires a different set of scopes as per our documentation. While you have some scopes that permit your app to make actions via API, you’re missing the specific ones for the method you’re using.

As in the error you get, you are missing the following scopes:

chats--all:ro, chats--access:ro, chats--my:ro

Those are not currently on the list of scopes in your app and need to be added. Simply go to the dev console, scroll down your list of scopes and in the search box type “Chats”, then add all of the missing scopes you require, save changes and generate a token.

Here’s a screenshot for reference: https://take.ms/nzqMc

Hope that helps!

Hi, I have the same issue!

I do not have options in scope list that you have in your screenshoot

Hi,
I searched chats options but I don’t have chats options in scope list.
Please check screenshot.

Thanks.

Hey Valeria and Plugins,

If you do not see the option to add those scopes it means the license you are logged in is still using our old v2 API. Please contact our support on chat and provide them with an e-mail address of your account, after a quick check they’ll be able to help you out with an update to v3.