Integrations 101 - jcmings/sn GitHub Wiki
[This is in progress]
Integrations 101
Follow along with me in this intro-to-integrations post! We're going to focus on REST (or Representational State Transfer) APIs in this post.
Methods
There are a few different "methods" for us to interact with data with a REST API. I'll explain how they would relate to ServiceNow records (but these methods would apply to any system). They are:
GET-- to "read" a recordPOST-- to "create" a recordPATCH-- to "update" a record with specific info; for example, if we just wanted to update the Short Description of a recordPUT-- to "update" a record entirely; this basically clears out fields not mentioned in the requestDELETE-- to "delete" a record
How we pass data
There are a few different components to a REST message. These include:
- Query parameters (often has the format of
name=value) - Path parameters (often has the format of
parameter1/parameter2and is part of the endpoint) - Headers (usually passes authentication info)
- Request body (the actual meat and potatoes of the message; we use the methods as part of the body)
Here's an example with the first two:
instance.service-now.com/now/nav/ui/classic/params/target/incident_list.do?sysparm_query=state=1&sysparm_first_row=1
target/incident_list is the path parameter and state=1 is an example of a query parameter here.