The CreatorCon Call for Content is officially open! Get started here.

modify output from REST API - integration

sammarcow
Mega Expert

i need a simple integration to return fields with certain parameters on utilizing of Post.   I basically need to rename some of the fields on the response body.     Does ServiceNow have the ability to retrieve the results of a Post, utilize server side code and generate a new return body, or will I need to create a web service in order to handle the out-of-box return messages?   I am doing a custom integration for Slack if that matters.    

1 ACCEPTED SOLUTION

Scripted REST was introduced with the Geneva release, so this won't be an option for you then. Any chance you have a G upgrade on the horizon?



If not, this can also be accomplished with a custom Processor, but beware these are a bit trickier to work with. Here's a bare-bones tutorial to get you started:



http://wiki.servicenow.com/index.php?title=Tutorial_4_Creating_a_Custom_Processor


View solution in original post

7 REPLIES 7

josh_nerius
ServiceNow Employee
ServiceNow Employee

Hi William,



Just to clarify, in this scenario is ServiceNow calling Slack, or is Slack calling ServiceNow? (I believe the latter) If Slack is calling ServiceNow, a simple Scripted REST API may be just what you meed. This allows you to process an inbound POST request and respond with a body that conforms to whatever you need.



Out of curiosity, can you share some additional info about which Slack APIs / features you're integrating with? I've worked with a few Slack-to-ServiceNow integrations, and may be able to share some additional insight if your use case is similar.


I am on Fuji and don't seem to have "Scripted Rest API" but only have "Scripted Web Services."   Slack is calling ServiceNow.   To be honest I am not entirely sure of the full scope of requirements yet but should not effect the integration needs.   For now we are creating a Slack bot that will ask a few questions, create a SerivceNow incident, and return a body Slack can read to contain a link to the newly created incident with the title of ticket created... something simple to start.    


Scripted REST was introduced with the Geneva release, so this won't be an option for you then. Any chance you have a G upgrade on the horizon?



If not, this can also be accomplished with a custom Processor, but beware these are a bit trickier to work with. Here's a bare-bones tutorial to get you started:



http://wiki.servicenow.com/index.php?title=Tutorial_4_Creating_a_Custom_Processor


We do have an upgrade on the horizon but I don't think we'll be waiting.   This works for what we need in the meantime - thanks!