SOAP API not returning Incident number

scwillson
Mega Guru

I'd like to preface this with the fact that I am a novice when it comes to REST/SOAP APIs.

I have a client creating new Incidents with values successfully, but the API is not returning the Incident number to them. I am not sure what to even check for in the script they are using, to send back the records display value. I did find in the wiki info about the "displayvalue=true" parameter of the URL, but that was only for reference fields which wouldn't be relevant to getting the Incident "number" field. It had worked with another instance. The field names, access credentials and instance URL have all been updated.

Any assistance would be appreciated Let me know what kind of details you might need to see...

Sample Code:

[string] $webServiceUri = "https://COMPANY.service-now.com/incident.do?sys_id=-1&sysparm_template=brightlight&WSDL",

1 ACCEPTED SOLUTION

scwillson
Mega Guru

Opened a ticket in HI, and it turns out there was an issue with the clients scripting. I believe they were using powershell.


View solution in original post

8 REPLIES 8

Chuck Tomasi
Tera Patron

Hi Simon,



Your URI looks a bit suspicious. For the moment, I'll assume we're not using a scripted web service. Correct me if I'm wrong.



The WSDL is the definition of what ServiceNow will allow your third party app to do. It only needs to be called once, not on each request. It typically looks like this:



https://company.service-now.com/incident.do?WSDL



Once you have that, you can tell what methods and access you have. Then it's a matter of building the correct payload in the SOAP request and getting back the proper response. I encourage you to review: SOAP Web Service - ServiceNow Wiki


So, if I wanted to be able to have my SOAP message generate an incident and send back the number in the API response...



I would first call the WSDL using the "...incident.do?WSDL" as you indicated above. But how would I specify a template to use with the record creation?


The WSDL is just a 'Rule book' of what the remote consumer can use.



As for the template, you should still be able to reference it from sysparm_template=template_name (as seen in section 4 here.)


Ok. Just wanted the clarification because of your first statement about the URL looking suspicioius....but typing this response now I realize that might have been directed to my omitting the company's name



the rest of it is fine though right?



incident.do?-- indicating the table


sys_id=-1         -- new record
&sysparm_template=brightlight   -- loads the template "brightlight"


&WSDL -- (specifies to use WSDL?. Should it be "?WSDL" instead?)



Sorry to beat a dead horse, but I just wanted to make sure.



Thanks Chuck!


(your TechNow channel has also been quite helpful with things too! images.png