Good Monday Morning to everyone,
I am working on creating a Dynamic Plug-in for Service Now via Rest and I am struggling once we get to the FindRelationURL. I have been able to do the standard tasks via the REST plug-in and what I believe is the problem is that ServiceNow requires Headers to perform the action. Namely it needs an Accept and Authorization headers to perform the rest calls.
Any idea where I can configure that for the plug-in creation to use and be able to connect and query successfully?
Thanks
Steve
You can duplicate the executeRequestJson action. Edit it to remove the lines that are running another action and add your specific headers.
Then you run "Set a custom request action for a host", specify your REST host and your action.
For each call on this host your custom action will be run and add the headers.
Thanks for pointing out the direction to explore. I will look at editing the action and see where I can get
ok I suck!!! I am getting no where editing the executeRequestJson action It goes from bad request to no response. Any examples or suggestions by chance?
Steve
I would advise that you first use a REST plug-in for a web browser to make sure you get the headers, URL, URL parameters right.
Then you can edit the duplicated action accordingly.
If you do not manage it post here a sample of the API documentation and the errors you get.
Other users may be able to provide examples since I have implemented this feature after getting a request from a plug-in generator user.
OK I think I am on to something in that there appears to be a certain order that the find releationships URL is done. That is what it is looking like right now.
Also FYI the executeRequestJsonText has a typo towards the top
if (url == null || restHost == null || namespace == null) {
if (debug == true) System.getModule("com.vmware.coe.tools").profile("executeRequestJsonText", startDate, "Null params");
return nill
}
I believe you meant to return null
Steve
Good catch. It is going to return undefined instead of null. I do not think it is going to error but yes I'd better fix this one.