Get bearer token from api key

Hey team, i have got the api key from the dashboard, but unable to get the bearer token using the provided api. Below is the curl that i am using

curl --location --request POST ‘https://apix.sg.amity.co/api/v4/authentication/token
–header ‘accept: text/plain’
–header ‘x-server-key: xxxxxxxxxxxxxxxxxxxxxxxx’
–header ‘Content-Type: application/json’
–data-raw ‘’

I am getting below error when trying to call above curl
{
“status”: “error”,
“message”: “Invalid server key”,
“data”: {
“httpStatus”: 400,
“appStatus”: 400001
}
}

Hello @Devesh, it appears from the error that your server key is invalid. Please follow the instructions in this section to obtain a valid server key from your console: https://docs.amity.co/analytics-and-moderation/console/settings/security#how-to-generate-a-server-key.

Once you have a valid server key, please try using these cURL commands:

curl -X 'POST' \
  'https://apix.us.amity.co/api/v4/authentication/token' \
  -H 'accept: text/plain' \
  -H 'x-server-key: 32a1eabbeffd1db291d5283fe286195a1fca36f56d87fd303ddf78528f3b9e629cb40026033c18d7fda2e344577xxxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "userId": "string"
}'