Receiving error "Invalid SDK credentials" upon using Kore ai API

Hi,

I am trying to use the conversation API but receiving “msg”: “Invalid SDK credentials”, “code”: 4002.

I followed the steps to given on below link
→ " Associating API Scopes to a Client App from Bot Builder",
→ Generated JWT token using client, secret
-? use conversation api from bot builder service node/soap ui but getting above error. please see the attached screen shot.

Please inform if I’m doing anything wrong or if anything is missing.

@janak.jay What version of platform have you been using? If you were on platform version earlier to 7.1, say 6.3, Please use the link https://developer.kore.ai/v6-3/docs/bots/kore-web-sdk/apis/conversation-history-api/.

I believe the issue here should be with the method being used. Use the method ‘GET’ instead of ‘POST’ and let us know if you run into further issues.

Thanks for the response @Subrahmanyam

We’re on version 6.3 and I tried with Get and API for v6.3 given at [https://developer.kore.ai/v6-3/docs/bots/kore-web-sdk/apis/conversation-history-api/ ]

Unfortunately it gives same issue, the error is consistent with all other apis that i tried just to see if anything else is working. For testing purpose, can you please suggest any basic api that most probably should work ? Also inform if you think these might be needing something else to make it working.

Thanks,

Okay @janak.jay,

I have quickly enabled the API scope for a bot I use on our Prod instance and published it. Below is the cURL you could try to retrieve the conversation history:
curl -X GET
https://bots.kore.ai/api/public/stream/st-0833d730-2bd0-5728-b643-709cd15b11ec/getMessages?userId=u-83975241-3597-5e27-8be3-9e380312ab29&limit=2
-H ‘Accept: /
-H ‘Accept-Encoding: gzip, deflate’
-H ‘Cache-Control: no-cache’
-H ‘Connection: keep-alive’
-H ‘Content-Type: application/json’
-H ‘Host: bots.kore.ai’
-H ‘Postman-Token: 80ecc094-0956-4319-ad12-d98deca57503,92b9145b-b22d-455a-9192-880fba13f77a’
-H ‘User-Agent: PostmanRuntime/7.19.0’
-H ‘auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiYXBwSWQiOiJjcy1hYjRkYWExOS0wNGM2LTU0MWQtOTEzZi1lODI2NThkMDRjNDgifQ.36jex1L4bqkk6ic3q7TJ2aNn5igD4bvTVFfC42SoDPQ’
-H ‘cache-control: no-cache’

Below are some follow up questions I have to make sure the config is right to get the response from conversation history API:

  1. Is the API scope Chat History selected while subscribing it with created application?
  2. Were the API scopes and the bot published and approved?
  3. Would you be able to provide us with your cURL so that we could debug the issue further?

Please see my responses.

  1. Is the API scope Chat History selected while subscribing it with created application?
    Yes, Please see attached screen

  2. Were the API scopes and the bot published and approved?

Yes, Please see attached screen. In this version, when i publish, it does not specifically show me if scope if going to be published or not. But I did publish couple of times after creating the scope.

  1. Would you be able to provide us with your cURL so that we could debug the issue further?

$ curl -k GET ‘https://korestedev02.nam.nsroot.net/api/public/stream/st-2bc08e85-c0b2-5d7a-9f50-fa30917a1242/getMessages?userId=u-ce3dfdf4-902f-5527-ae4a-7e9be0ebd412&limit=2’ -H ‘Accept: application/json’ -H ‘auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6ImNzLWMyMGZmNmIzLWI3MDYtNTRjYS1iYzEzLTBjMDA0NWQ5MWUxZSJ9.thuXQ17kw_C_H3HcetkPI6Fpm5SY9VIKcBa7b_Hnm9k’
curl: (6) Couldn’t resolve host ‘GET’
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 58 100 58 0 0 58 0 0:00:01 0:00:01 --:–:-- 35{“errors”:[{“msg”:“Invalid SDK credentials”,“code”:4002}]}

apiscope

@janak.jay The conversation history API you were referring was introduced in platform version 7.0 and you were platform on-premise version 6.3.

Please refer to the below link on our developer documentation and let me know if you have further questions.

https://developer.kore.ai/docs/bots/api-guide/conversation-history-api-old/

@Subrahmanyam
Unfortunately its giving me the same error. Please see the curl below, Not sure what might be going wrong here. let us know if you think something is missing.

jj60664@H17BAFI12PS0035 MINGW64 ~
$ curl -k GET ‘https://korestedev02.nam.nsroot.net/api/botsdk/stream/st-2bc08e85-c0b2-5d7a-9f50-fa30917a1242/getMessages?userId=u-ce3dfdf4-902f-5527-ae4a-7e9be0ebd412&limit=2’ -H ‘auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6ImNzLWMyMGZmNmIzLWI3MDYtNTRjYS1iYzEzLTBjMDA0NWQ5MWUxZSJ9.thuXQ17kw_C_H3HcetkPI6Fpm5SY9VIKcBa7b_Hnm9k’
curl: (6) Couldn’t resolve host ‘GET’
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 58 100 58 0 0 58 0 0:00:01 0:00:01 --:–:-- 41{“errors”:[{“msg”:“Invalid SDK credentials”,“code”:4002}]}

jj60664@H17BAFI12PS0035 MINGW64 ~
$ curl -k GET ‘https://korestedev02.nam.nsroot.net/api/botsdk/stream/st-2bc08e85-c0b2-5d7a-9f50-fa30917a1242/getMessages?userId=u-ce3dfdf4-902f-5527-ae4a-7e9be0ebd412&limit=2’ -H ‘auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6ImNzLWMyMGZmNmIzLWI3MDYtNTRjYS1iYzEzLTBjMDA0NWQ5MWUxZSJ9.thuXQ17kw_C_H3HcetkPI6Fpm5SY9VIKcBa7b_Hnm9k’
curl: (6) Couldn’t resolve host ‘GET’
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 58 100 58 0 0 58 0 0:00:01 0:00:01 --:–:-- 35{“errors”:[{“msg”:“Invalid SDK credentials”,“code”:4002}]}

Sorry to hear that. I’ll coordinate with our support team to schedule a call with you soon to have the issue sorted out. Have you had a support ticket raised for this issue?

@swagata.sengupta @yogaramya.mendu @srirama.yadlapalli

Hi @janak.jay,

We will need to schedule a call to debug this issue.
We request you to drop a mail to support@kore.com with all issue details to proceed further.

Regards,
Yoga Ramya.

Hi @janak.jay,

Is the issue resolved from your end?
If not, we can schedule a call to debug this issue.

Please confirm if we can raise a ticket on your behalf to report this issue.

Regards,
Kore Support Team

Thanks Sadhvi, it’s still the same. But we have prioritized other features as of now.

We will have to work on this chat history feature in January. Please raise the ticket but we will have to work out for scheduling the call as we have other priorities for now.

Hi @sadhvi.chandra,

Please see if you can raise a ticket and scheduling a call so I can show the issue I am facing.

Thanks,
Jaydip

Hi @Subrahmanyam,

Wanted to give a correction, We’re on version 6.2.3.

Is this conversation history API feature available in this version ? Or Can you please guide us for the 6.2.3 documentation on APIs.

Thanks,
Jaydip

Hi @Subrahmanyam , @sadhvi.chandra

Please see if you can inform if this API is available for version 6.2.3 and if yes can you please help to raise a ticket.

Thanks

Hi @janak.jay,

The conversation history API has been introduced after 6.3.1 release. Hence, it will not be available in 6.2.3 version of bot builder.

Regards,
Yoga Ramya.