- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2016 08:35 PM
I'm new to ServiceNow and currently trying to configure an outgoing REST message for the first time. I'm checking out https://currency-exchange.p.mashape.com/exchange and have already obtained my API key. The problem is, how will I configure the API key, when in the Outbound > REST Message module you can only configure either Basic or OAuth 2.0 for the authentication? Or am I missing something here?
{"message":"Missing Mashape application key. Go to http:\/\/docs.mashape.com\/api-keys to learn how to get your API application key."}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2016 11:40 PM
Hi Nelson,
Is the far end expecting the api token in the header?
You can set name-value pairs in the header.
RESTMessageV2 - setRequestHeader(String name, String value)
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2016 12:37 AM
Hello Tony,
My apologies for the late reply. I came across the Mashape Docs - Authentication Settings and found out that the API key can be used as a parameter. I then looked up another API which returns a list instead of a value and it works:
https://mashape-community-urban-dictionary.p.mashape.com/define?mashape-key=<API key>&term=lol
In the Outbound > REST Message module as the get method this would translate to:
Endpoint: https://mashape-community-urban-dictionary.p.mashape.com/define
HTTP Headers:
Name: Accept Value: text/plain
Name: X-Mashape-Key Value: <API key>
HTTP Query Parameters:
Name: term Value: lol
I haven't gone as far as the actual scripting part just yet but this already proves your first answer was correct; The API key just needs to be set in the header.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2016 12:56 AM
Hi Nelson,
That is excellent news!
Consider marking the question as answered so Community members can benefit from your investigation.
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2020 01:16 AM
Thanks @tony.barratt this works for us when we don't have "Basic Auth" OR "OAuth 2.0" and we have only API token to access, adding to header would be a better solution.