Consumer API
-
- UpdatedJan 30, 2025
- 13 minutes to read
- Yokohama
- API reference
The Consumer API provides endpoints to retrieve and update Customer Service Management (CSM) consumer records.
In addition, you can generate new social media profile records when creating a consumer.
The Consumer API requires the Customer Service plugin (com.sn_customerservice) and is provided within the now
namespace.
Users require the csm_ws_integration role for full API access.
Consumer - GET /now/consumer
Retrieves a specified set of Customer Service Management (CSM) consumer records.
URL format
Versioned URL: /api/now/{api_version}/consumer
Default URL: /api/now/consumer
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
sysparm_limit | Maximum number of records to return. For requests that exceed this number of records, use the sysparm_offset parameter to paginate record retrieval.
In the response, the boolean parameter hasMore is returned. It indicates whether there are more records to return that meet the filter criteria. Data type: Number Default: 10 |
sysparm_offset | Starting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number
of records, in small manageable chunks.
For example, the first time you call this endpoint, sysparm_offset is set to "0". To simply page through all available records, use
Do not pass a negative number in the sysparm_offset parameter. Data type: Number Default: 0 |
sysparm_query | Encoded query used to filter the result set. For example:
The encoded query supports order
by. To sort responses based on certain fields, use the ORDERBY and ORDERBYDESC clauses in sysparm_query. For example,
If part of the query is invalid, such as by specifying an invalid field name, the instance ignores the invalid part. It then returns rows using only the valid portion of the query. You can control
this behavior using the property glide.invalid_query.returns_no_rows. Set this property to true to return no rows on an invalid query. Note: The
glide.invalid_query.returns_no_rows property controls the behavior of all queries across the instance, such as in lists, scripts (GlideRecord.query()), and web service
APIs. Data type: String |
Element | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters (JSON or XML)
The endpoint may return the following JSON or XML elements in the response body. In addition to the list of elements defined below (which define the elements in a base system), the endpoint also returns any custom fields added to the Consumer [csm_consumer] table. For additional information on these elements, refer to your specific table definition [
].Example: cURL request
Consumer - GET /now/consumer/{id}
Retrieves the specified Customer Service Management (CSM) consumer record.
URL format
Versioned URL: /api/now/{api_version}/consumer/{id}
Default URL: /api/now/consumer/{id}
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
id | Sys_id of the consumer record to return. Data type: String Table: Consumer [csm_consumer] |
Name | Description |
---|---|
None |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters (JSON or XML)
The endpoint may return the following JSON or XML elements in the response body. In addition to the list of elements defined below (which define the elements in a base system), the endpoint also returns any custom fields added to the Consumer [csm_consumer] table. For additional information on these elements, refer to your specific table definition [
].Example: cURL request
Consumer - POST /now/consumer
Creates a new Customer Service Management (CSM) consumer.
- social_channel
- social_handle
- social_handle_url
URL format
Versioned URL: /api/now/{api_version}/consumer
Default URL: /api/now/consumer
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Response body parameters (JSON or XML)
Element | Description |
---|---|
result | Sys_id of the newly created consumer record. Data type: String |