- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2020 08:44 PM
I have been trying to call an external API(Zendesk API) from the SN personal instance Previously , i would use the following code in my server side script(on NodeJS) and it would work perfectly fine .
app.get("/api/v2/tickets/:TICKET_ID/comments.json", function(req, res) {
debugger;
var options = {
method: "GET",
url:
process.env.ZENDESK_HOST +
"/api/v2/tickets/" +
req.params.TICKET_ID +
"/comments.json",
headers: {
authorization: process.env.ZENDESK_TOKEN
}
};
request(options, function(error, response, body) {
//Somecode
});
Now i am trying to do the same in ServiceNow. The problem i am facing is how do i add the headers(which can be seen above ) in ServiceNow HTTP request .
My approach in (ServiceNow) has been to create a new REST Message(call it test2 ) :
1.)Fill in the endpoint
2.) Selected ->AUTHENTICATION TAB ->Add authorisation(tried both basic and NO authorization ) . While trying basic created a new "Basic Auth Configurations" and added some random username and password.
3)Selected ->HTTP REQUEST -> Tried adding Headers , but the add(+) button wont work .
See below :
4.)Anyhow submitted the REST Message and Selected "Test" ,and then i see this :
4a.)HTTP Status : 401
4b.) Error Message : Invalid username/password combo
4c.)Response : {"error":"Couldn't authenticate you"}
After this i returned to STEP 3 to add headers , just in case . But it is still unclickable .
I tried reading through the documents to call API in SN , and tried many approaches but none seem to work for me .
Any help will be greatly appreciated .
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2020 09:06 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2020 09:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2020 09:22 PM
Thanks a lot !!!
I tried doing something similar to what you just said . What i tried was double click on
Insert a new row" but this does not work . First the value has to be added .
You saved a lot of time of mine. 🙂