Sessions History API getting Permission denied. Scope is incorrect! error

Hi Team,
I am trying to get the session details using the session history api (https://{{host}}/api/public/bot/{{BotID}}/getSessions?containmentType={{containmentType}}) but I am getting Permission denied. Scope is incorrect! error. I have given scope as session ID from admin console>chat history.
PFB for the error screenshot:

Thanks,
Satish

Hello Satish Kumar,

Thank you for reaching out to Kore.ai Community.
Looks like the scop is not defined properly.

Could you please verify if the below scope is enabled ?

Thank you,
Srujan Madderla
Kore.ai Community Team

Hi @srujan.madderla,
I have shared the postman response in that you can see scope and the session ID .

Thanks, Satish

Hi @srujan.madderla,

What should be scope I have taken the scope value as session ID from the admin console is it the correct way or how to define the scope.

Thanks,
Satish

Hello Satish,

You will need to enable the scopes at Bot builder or admin console.
From the postman screenshot which you have shared, we see that you are using it wrongly.

Below is the screenshot showing the page where you need to enable scopes in bot builder.

Below is the screenshot showing the page where you can enable api scopes in the bot admin console.

Hope this helps.

Thank you,
Srujan Madderla
Kore.ai Community Team

Hi @srujan.madderla,
I have enabled the API scopes as you mentioned but still getting the Permission denied. Scope is incorrect! as shown in the below screenshot.
May I know what is the parameter and value need to be passed for scope in the header section.

Thanks,
Satish