cancel
Showing results for 
Search instead for 
Did you mean: 

Error While calling API using WebAPI functionality provided in System tab

ManishRaw
Level 7
Hi All,

I am trying to access the API, while using the WebAPI functionality for the same we are getting the below error:

28126.png
We have checked the API key and the same is correct, also the call is working correctly with CURL. 

CURL Command Snippet:
curl --location --request GET "XXXXX" --header "apikey: XXXXX" --header "Content-Type: XXXXX" --data-raw "{"query":"","variables":{}}"

WebAPI Wizard Snippet:

28127.png

------------------------------
Manish Rawat
Project Manager
Mercer
New Delhi
------------------------------
3 REPLIES 3

bruce.liu
Staff
Staff
Hi Manish,

Based on the information that I am able to see, what you had in Curl does not appear to be an exact match as what you did in Blue Prism.
  • apikey in Curl vs. apiKey in BP
  • some body message in Curl vs. no body message at all in BP
That being said, neither would have played a role in the failure of the HTTP call. Without API documentation, it is not possible to be specificc.

The HTTP error code is 401, and the error message seems to suggest the key is not suitable for the purpose. But without seeing the full content of your call, it is difficult to comment on that.

------------------------------
Bruce Liu
Senior Product Consultant, Professional Services
Blue Prism
Australia/Sydney
------------------------------

ewilson
Staff
Staff
Hi @Manish Rawat,

@Bruce Liu has called out the main issues with what we can see. The one thing I would recommend is to make sure the API key value doesn't have any extra leading or trailing whitespace. That is a common error when people copy/paste an API key value.

Cheers,
​​

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi Bruce, Eric,

Thanks for your response.

Just found out the issue, the apikey was correct but the URL given missed an entry that's why the error Invalid ApiKey for given resource, was thrown instead of Invalid ApiKey.


Hope this will help others if they had the similar issue :)

------------------------------
Manish Rawat
Project Manager
Mercer
New Delhi
------------------------------