Integrate Servicenow API with POST method

api

(Priyanshu Shukla) #1

I need to integrate service now api with post method. I have created the below flow:
API%20flow

I created the authorization profile in config settings. I need to send the 3 entity values in api which will store in servicenow database.

Configuration of service node is given below:
apicall

response
Here auth= post incident (authorization profile created by me)
In headers- Key :Content-Type , value: application/json
In Body- i given sample values
{“approval”:“approve”,“group_list”:“123qq123”,“caller_id”:“789ddd45”}

After testing the above response is coming fine.
But when we test the bot on clicking “talk to bot”, it gives the below error:
log

Please help where i am wrong.


(Swagat) #2

Your screenshot does not show how you are preparing the payload of the service node call. Please refer to “Working with service node” in our documentation. You can use this node when you have collected the parameters needed for the API request using Entity or other nodes to capture the user input.

It is further explained in the documentation that you need to refer to captured entities or context variables as the following:

  1. In the second field of the Request URL , specify the URL for the Dialog task response to process at Kore.ai, for example, http://koremessenger.com/postURL. Add query or path parameters as part of the URL, if required. To use Entity node values as parameters, use the following syntax for accessing the Context object: https://myDomain.com/{{context.entities.topic}} for the context.entities.topic . You must use the double brackets {{ context.object }} . For more information, see the Context Object.

Hope this helps.


(Gourav Madan) #3

Hi Priyanshu,

I am getting an error in creating Basic Auth Profile. I have entered service now credentials to get the data from API but showing below error:
“message”: “User Not Authenticated”,
“detail”: “Required to provide Auth information”

But same credentials are working in POSTMAN.
Could you please tell me how you setup the Basic Auth profile and where i am doing wrong?
Urgent!!!


(Lucas Augusto Barbosa Lopes) #4

I have the same problem with a service now api. works correctly in postman, but kore issues error! please help us!!!


(Priyanshu Shukla) #5

Hi Gourav,
You can use servicenow api with post using following steps:

  1. You need to navigate to Config Settings->Authorization Profile-> Click on add
    Now create it like below image:
    image

  2. Now create a service node & define request as given below:
    image

  3. Set header like this:
    image

  4. Set the values, which you want to send using api with post method. For ex, i have used description here. This description i have already created as an entity node, which i am sending along with api.)
    image

  5. Now click on test like below:
    (while testing enter your credentials & also provide the entity value which you want to post with api)
    image

If you are getting the correct output, then it worked correctly.
Save it as a sample response.

Let me know if you are facing any issue.

Regards:
Priyanshu Shukla


(Reni Sweta) #6

Please help me out with https://{{tenant}}.com/api/now/table/incident .
Is there any format to be followed?


(Priyanshu Shukla) #7

Its your servicenow instance api url…which you are using to post data

For more details…go through with servicenow documentation.


(Reni Sweta) #8

Thanks!

Help me out with the authorization check URL .

https://{{tenant}}/api/tnse/create_incident is not working when making an authorization profile under basic auth but https://{{tenant}}/api/now/table/incident is working well for making a service now call by using authorisation profile.

Can i know the reason.

Are there some necessary details this URL should have ?

I got the https://{{tenant}}/api/tnse/create_incident