0

I have created an Action using IBM Cloud's Function service to query against a Cloudant database. I am able to verify that the code is working when I invoke it. I would like to also verify it using Postman. See image below for endpoint details

enter image description here

After research, I learned to generate a bearer token with Postman. enter image description here

For the API key, I created a Cloudant service credential and used the api key provided there. enter image description here

I then try to call the REST API provided from the Action's Endpoint section. Based on the Curl section and a youtube video (https://www.youtube.com/watch?v=9JgSQ4J6TkQ), I composed my call to have the authorization defined in the header with the value of "Bearer " enter image description here

Finally, it says I'm not authorized for my Action's endpoint. Not sure where I went wrong. I've also tried placing my bear token in Postman's Authorization > OAuth2.0 and Bearer Token. Both yield the same results.

Thanks.

mauvecrow
  • 35
  • 5
  • Depending on the security setting of your action, authentication is not done by bearer token but through other means. Check how your action is configured. Within the action you need to use the API key to initialize the connection to Cloudant. Tokens are only valid for some (short) time. – data_henrik Jun 30 '23 at 07:48
  • Got it, I'll have to play around then. Thanks. – mauvecrow Jul 03 '23 at 15:34

0 Answers0