Scripted REST API or OOTB API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2017 08:02 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2017 10:32 AM
You should be able to use:
ritmGR.variables['<variable_name>'] = '<my_new_value>';
to interface with variables on record.
As per your question around passing in the body, you can access other properties of the "request" object, such as request.body and request.queryParams.my_param.
Full documentation at: RESTAPIRequest - Scoped, Global
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2017 05:51 AM
Unfortunately I think that's only available in the scoped application for the Service Catalog API.
I ended up figuring it out by simply not adding any parameters in the pathway and using request.body.variablename where my body was {"variablename":"variablevalue"}.
Ex.
{"start_date":"2017-08-20"}
Thank you guys for all your assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2017 10:45 AM
Our instance is setup so that we do not work any RITM directly but only tasks under the RITM so the RITM would never close until all tasking is completed (which closes the RITM automatically), at which point the PeopleSoft record would be closed for any updates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2017 02:41 AM
Joshua Cassity wrote:
Our instance is setup so that we do not work any RITM directly but only tasks under the RITM so the RITM would never close until all tasking is completed (which closes the RITM automatically), at which point the PeopleSoft record would be closed for any updates.
In which case... is it simply the SCTASKs that need to be pushed over to PeopleSoft, and when each is closed, it messages back to the platform to close, advance and retrieve the next one?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2017 05:51 AM
Nothing needs to be pushed over to the PeopleSoft platform other than the RITM number of the onboarding. I'll likely just try to do a scripted api for any updates to RITMs.
~ J ~