Data Insert API Call Error

We received the following error while trying to use the Data Insert API:
{
“errors”: [
{
“msg”: “Invalid SDK credentials”,
“code”: 4002
}
]
}

The Details of the API Call:
HTTPS Method: POST
URL: https://bots.kore.ai/api/public/tables/peoplecentralemployeemaster
POST Body:
{
“data”: {
“userId”: “1”,
“empId”: “1”,
“status”: “t”,
“defaultFullName”: “John Doe”
}
}
Headers:

  1. auth JWT_TOKEN using below defined apps client Id.
  2. content-type application/json

An App was defined within the Data Tab with all permissions on the table. I tested this using Postman.

Thank you,
Rahul

Hello @rahul ,

If the API is failing with postman, it is clear that the jwt used is incorrect or does not have required permissions to access Data Tables. As indicated in the documentation:

To use this API, the app needs to be given Write access to the Data Table from the Data Definition in DaaS

I.e, the data table should have been already created and assigned to the bot, and linked to app with the relevant permissions.

For example:

Ensure these permissions are assigned, before testing the API. Hope this resolved your issue.

Regards,
Sameera

Hello Sameera,

I have Created an App as follows:

I have also permissioned the app to have all permissions in the Data Table Definition as follows:

I generated the JWT using https://developer.kore.ai/tools/jwt/

The error still persists.

I would also like to know if the host URL I am using (bot.kore.ai) is correct or not for these data updates on a table existing in a developer account.

Thank you,
Rahul Reddy

Hello @rahul ,

We have resolved the issue with the API over a ticket.

1. Invalid credentials - was due to not using the secret code to generate the jwt.  

2. Invalid arguments - was observed later, and fixed after ensuring all the default headers are 
     selected.

Let us know if you have any other concerns.

Thank you @sameera.tumuluri for your quick response in resolving the issue.