Scripted REST API or OOTB API

Joshua Cassity
Kilo Guru

We have a requirement to allow an external system to submit an item out on our service catalog.   Here's what we are doing using the 'Buy Item' resource using the 'SN_SC' api:

1. Peoplesoft initiates a REST call to begin an onboarding catalog item once approval is gathered for the hire. (this is working)

2. RITM is created and populated with that employee's information. (this is working)

3. Response is sent back to Peoplesoft with the RITM number to save on the approval record.

Item 3 poses an issue for us because the response only gives the REQ number and we really need the RITM number to be sent back in the response (which they'll store in their system) instead because if they need to update the RITM with new information (say Mary's last name changes during onboarding because she got married or her first day was going to be Monday but is now Friday, etc...).

Is the only way to handle such a thing is to create a scripted REST api (which we've never done before so it'll be a learning curve for me) or is there some other mechanism in the header or body to specify what needs to go back in the response?

Thanks for your assistance.

24 REPLIES 24

Dave Smith1
ServiceNow Employee
ServiceNow Employee

Is the only way to handle such a thing is to create a scripted REST api (which we've never done before so it'll be a learning curve for me) or is there some other mechanism in the header or body to specify what needs to go back in the response?


It sounds like you merely want to edit the baseline API so that it returns more information in the response - details that make sense on the receiving end (PeopleSoft).



Is that the case?   In which case, do you know the API details at PeopleSoft to define the response body at all? (I think this may be a JSON packet, but not sure).


Yes that is the case.. we are using the following ootb rest call:



POST https://{instancename}.service-now.com/api/sn_sc/servicecatalog/items/{sys_id}/order_now



Where the sys_id is the id of the catalog item.


And no.. I know zero about how they are doing this in PeopleSoft. Are you saying at the message they send to the ServiceNow instance can define what's supposed to come back?


Are you saying at the message they send to the ServiceNow instance can define what's supposed to come back?


No, more that once you configure the instance to add further info that is passed back, how PeopleSoft will accept and parse that returned information.