Service Catalog API - GET /sn_sc/servicecatalog/items/{sys_id}

This method retrieves the catalog item with the specified sys_id.

URL format

Versioned URL: /api/sn_sc/v1/servicecatalog/items/{sys_id}

Default URL: /api/sn_sc/servicecatalog/items/{sys_id}

Supported request parameters

Table 1. Parameters
Parameter Description
sysparm_view Defines the device that displays the Item:
  • Desktop(desktop)
  • Mobile(mobile)
  • Desktop and Mobile(both)

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.

Table 2. Request headers
Header Description
None
Table 3. Response headers
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 response codes .

Table 4. Status codes
Status code Description
200 Indicates that the request has completed successfully and returns the details of the catalog item.
400 Indicates that request is invalid for one of the following reasons:
  • User does not have access to the catalog item.
  • Invalid sys_id.
500 Internal error occurred while executing the request.

Request body

The API accepts these JSON or XML elements in the request body.

Table 5. Elements accepted in the request body
Element Description
None

Response body

The API returns these JSON or XML elements in the response body to describe the catalog item.

Table 6. Elements returned in the response body
Element Description
name Name of the catalog Item.
sys_id SysID of the catalog item.
type Item type can be:
  • catalog item
  • record producer item
  • order guide
short_description Text on the service catalog homepage or search results page, or the title on the order form of the catalog item.
description Full description of catalog item.
icon Path of the image that appears as an icon beside the catalog item.
category List of categories that the item belongs and each category title and sys_id of the category.
show_price A Boolean value, if true, returns the following details.
  • price
  • localized_price
  • recurring_price
  • localized_recurring_price
  • recurring_frequency
  • local_currency
  • price_currency
  • recurring_price_currency
catalogs List of all the catalogs the item belongs and each catalog title and sys_id of the catalog.
variables List of all the variables of the catalog item.
ui_policy List of all Catalog UI policies defined on the catalog item.
client_script List of all the catalog client scripts defined on the catalog item.
data_lookup Array of data lookups defined on the catalog item.

Sample cURL request

curl "https://instance.service-now.com/api/sn_sc/servicecatalog/items/0cf7477237153000158bbfc8bcbe5dec" \
  --request GET \
  --header "Accept:application/json" \
  --user 'admin':'admin'
  "result": {
  "short_description": "Google Nexus 7",
  "icon": "images/service_catalog/generic_small.gifx",
  "description": "\n<h3>Google Nexus 7 Black Wi-Fi 16GB Tablet, Model NEXUS7ASUS1B16</h3>\n<p style=\"margin-bottom: 0px;\"><b>Key Features:</b></p>\n<li>The world&#39;s 1st Android™ 4.1 Jelly Bean tablet</li>\n<li>World’s first 7” quad-core tablet delivers an advanced multimedia experience with up to 9.5* hours of battery life</li>\n<li>World&#39;s best NFC experience on a tablet with a textured tactile design for enhanced comfort measuring just 10.45mm thin and 340g light</li>\n<li>ASUS TruVivid technology with Corning® Fit Glass for improved color clarity and scratch resistance</li>\n<li>178 wide-viewing angle IPS display ensures unrivaled visual acuity</li>\n",
  "show_price": true,
  "recurring_price": "$10.00",
  "type": "catalog_item",
  "local_currency": "USD",
  "sys_id": "0cf7477237153000158bbfc8bcbe5dec",
  "recurring_price_currency": "USD",
  "localized_price": "$199.99",
  "price": "$199.99",
  "catalogs": [
    {
      "sys_id": "e0d08b13c3330100c8b837659bba8fb4",
       "title": "Service Catalog"
     }
  ],
  "recurring_frequency": "Weekly",
  "name": "Google Nexus 7",
  "localized_recurring_price": "$10.00",
  "category": {
    "sys_id": "b06546f23731300054b6a3549dbe5dd8",
    "title": "Tablets"
  },
  "price_currency": "USD",
  "categories": [
    {
      "sys_id": "d258b953c611227a0146101fb1be7c31",
      "active": true,
      "category": {
        "sys_id": "b06546f23731300054b6a3549dbe5dd8",
        "active": true,
        "title": "Tablets"
       },
        "title": "Hardware"
    }
  ],
  "variables": [],
  "ui_policy": [],
  "client_script": {
    "onChange": [],
    "onSubmit": [],
    "onLoad": []
  },
  "data_lookup": []
}

Sample Python request

#Need to install requests package for python
  #easy_install requests
  import requests

  # Set the request parameters
  url = 'https://instance.service-now.com/api/sn_sc/servicecatalog/items/0cf7477237153000158bbfc8bcbe5dec'

  # Eg. User name="admin", Password="admin" for this code sample.
  user = 'admin'
  pwd = 'admin'

  # Set proper headers
  headers = {"Content-Type":"application/xml","Accept":"application/xml"}

  # Do the HTTP request
  response = requests.get(url, auth=(user, pwd), headers=headers )

  # Check for HTTP codes other than 200
  if response.status_code != 200:
      print('Status:', response.status_code, 'Headers:', response.headers, 'Error Response:',response.json())
      exit()

  # Decode the JSON response into a dictionary and use the data
  data = response.json()
  print(data)
<?xml version="1.0" encoding="UTF-8"?>
<response>
 <result>
    <short_description>Google Nexus 7</short_description>
    <icon>images/service_catalog/generic_small.gifx</icon>
    <description>&lt;h3&gt;Google Nexus 7 Black Wi-Fi 16GB Tablet, Model NEXUS7ASUS1B16&lt;/h3&gt;
&lt;p style="margin-bottom: 0px;"&gt;&lt;b&gt;Key Features:&lt;/b&gt;&lt;/p&gt;
&lt;li&gt;The world&amp;#39;s 1st Android™ 4.1 Jelly Bean tablet&lt;/li&gt;
&lt;li&gt;World’s first 7” quad-core tablet delivers an advanced multimedia experience with up to 9.5* hours of battery life&lt;/li&gt;
&lt;li&gt;World&amp;#39;s best NFC experience on a tablet with a textured tactile design for enhanced comfort measuring just 10.45mm thin and 340g light&lt;/li&gt;
&lt;li&gt;ASUS TruVivid technology with Corning® Fit Glass for improved color clarity and scratch resistance&lt;/li&gt;
&lt;li&gt;178 wide-viewing angle IPS display ensures unrivaled visual acuity&lt;/li&gt;</description>
    <show_price />
    <recurring_price>$10.00</recurring_price>
    <type>catalog_item</type>
    <local_currency>USD</local_currency>
    <sys_id>0cf7477237153000158bbfc8bcbe5dec</sys_id>
    <recurring_price_currency>USD</recurring_price_currency>
    <localized_price>$199.99</localized_price>
    <client_script />
    <price>$199.99</price>
    <catalogs>
       <sys_id>e0d08b13c3330100c8b837659bba8fb4</sys_id>
       <title>Service Catalog</title>
    </catalogs>
    <recurring_frequency>Weekly</recurring_frequency>
    <name>Google Nexus 7</name>
    <localized_recurring_price>$10.00</localized_recurring_price>
    <categories>
       <sys_id>d258b953c611227a0146101fb1be7c31</sys_id>
       <active />
       <category>
          <sys_id>b06546f23731300054b6a3549dbe5dd8</sys_id>
          <active />
          <title>Tablets</title>
       </category>
       <title>Hardware</title>
    </categories>
    <category>
       <sys_id>b06546f23731300054b6a3549dbe5dd8</sys_id>
       <title>Tablets</title>
    </category>
    <price_currency>USD</price_currency>
 </result>
</response>