Use of ServiceNow with Rest API(using SOAP UI) to generate mails

nehasr1288
Tera Expert

Hi ,

I have a task to generate or rather insert incidents in Service Now using Rest API explorer from servicenow and soapUI tool.

As soon as incident is inserted from a soapui tool to service now a mail should be generated.

Please anyone know where to begin from?

1 ACCEPTED SOLUTION

Hi Neha,



Please pass the fields in the body of request as shown below, This worked for me.



1) Change media type to json and add your query


2) Add the content-type and accept headers



Rest API.jpg




Thanks


PS: Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

16 REPLIES 16

I am using POST method to create a new record but the values are not getting inserted,only a incident is raised


Hi Neha,



Please pass the fields in the body of request as shown below, This worked for me.



1) Change media type to json and add your query


2) Add the content-type and accept headers



Rest API.jpg




Thanks


PS: Hit like, Helpful or Correct depending on the impact of the response


Hi,



Yes it is working that way..but any idea why it does not works from the above section?


Hi,



What I can see from the tool is the above section is for sending the parameters as a query string in the URL itself (eg: URL?short_description=test). Service Now supports XML or JSON data which needs to be send in the request body as we did. If you are sending the data as query string then the target system should have logic to retrieve query string and scan each parameters which is not happening when we use the OOB Rest API.




Thanks


PS: Hit like, Helpful or Correct depending on the impact of the response


Hi Neha,



How are you mapping the incoming data that is flowing into service now via SOAP UI ?


are you using inbound web service import sets or scripted web services for mapping incoming data with the target table fields in service now ?