Conversation History API Invalid SDK Credentials

Hi,
Conversation history is working fine and giving proper response on bots.kore.ai environment but when i change the host url to intranet url, the reponse is 401 (Invalid SDK credentials)

Please help me on this.

@chsaidulu13,

Please check if you have generated the credentials appropriately.

The error 401 indicates the improper generation on the token.

Kindly re-check and send us the URL in case if you are still observing the issue.

Regards,
Yoga Ramya

Please can you provide me a steps to generate jwt token using clientId, clientSecret i am using https://developer.kore.ai/tools/jwt/ to generate the token but when trying to access api using Postman it is thorwing me an 401 error. Please help me i need this to be done on an urgent basis.

@caditi009
There is an existing article that should help.

Followed exactly same steps given in above document. But getting same error.
{
“errors”: [
{
“msg”: “Invalid SDK credentials”,
“code”: 4002
}
]
}

API i am testing is: https://{{host}}/api/public/bot/{{BotID}}/changelogs

client Id: st-12bb850c-3a90-553f-a571-010902c0f008
client Secret: +JBK9lbpfYUYjMbdqFgAbCUSMfgMJ/AovCxSdL7eEQc=
Bot Id: st-12bb850c-3a90-553f-a571-010902c0f008

can you help me out please.

@caditi009
The client id is incorrect. Please provide the correct one.

these credentials are valid. If you have time can i connect with u. Please help me out i need this testing to be done urgently.

@caditi009

here you used bold instead of clientId. Also, I see that you have JWE selected for the app. Please unselect it and save it.

Done I unselected that JWE but having same issue.

But the signature is valid here.

@caditi009
If you see the documentation, you can either use get or use post. But there is a difference in the level of app, mandatory inputs also.

Get is used with userid and for this, bot level api scope is required.
For post you need admin console level app and right scope.
I see from the screenshot that you are using get. So user ID is a must. But the url you have used as well as mandatory query parameters seems inaccurate.

Actually i have used that also. But facing same issue.

Get Api used:

https://{{host}}/api/public/bot/{{BotID}}/getMessages?userId={{userID}}&skip=10&limit=10

these are the credentials required:

User Id: u-49e8841b-088b-5156-8fd0-c15c34d0d0c9

@caditi009
Please invite swagata.sengupta@kore.com as a developer on your bot. I will check it out.

I sent u an invitation please do check it once
.

@caditi009
You will need to add me as a developer in your bot. I think you invited me to your account but I am not added to your bot yet.

I sent u please do check it and reply.

I didn’t remove you. Please check again . I added you again.

On your bot,
I took this app


created the jwt

took user id from the the conversations history

It worked fine.

curl --location --request GET 'https://bots.kore.ai/api/public/bot/st-12bb850c-3a90-553f-a571-010902c0f008/getMessages?userId=u-49e8841b-088b-5156-8fd0-c15c34d0d0c9&limit=100' \
--header 'auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6ImNzLWRmOGVlYWQxLTI5ZGItNTdmMi1iNDZjLTA0NTRkMjg3YWZiZCJ9.Ai9ZXUmx_PSPxbaok4M9Hlk62vAWnkwRTCPMBxghLeo'

I noticed that on jwt.io you had used base64 encoded secret. So maybe that is why it gave you a different JWT token than mine.