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

This method retrieves all the information about a requested catalog.

URL format

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

Default URL: /api/sn_sc/servicecatalog/catalogs/{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, seeREST response codes.

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

Response body values

Following are JSON or XML response parameters for a request completed successfully. The response consists of details of the catalog item.

Table 5. Response parameters
Parameter Description
title Title of the catalog.
sys_id SysId of the catalog.
has_categories Returns true if the catalog has any categories created in it otherwise returns false.
categories A list of categories with the following details for each category:
  • title: title of the category.
  • description:description about the category.
  • sys_id: sysId of the category.
  • header_image: header image of the category.
has_items Returns true if the catalog has any items associated with it otherwise returns false.
description Description about the catalog.
desktop_image The source of the image used to display with catalog.

Sample cURL request

curl "https://instance.service-now.com/api/sn_sc/servicecatalog/catalogs/e0d08b13c3330100c8b837659bba8fb4" \
    --request GET \
    --header "Accept:application/json" \
    --user 'admin':'admin'

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/catalogs/e0d08b13c3330100c8b837659bba8fb4'

    # 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>
      <sys_id>e0d08b13c3330100c8b837659bba8fb4</sys_id>
         <desktop_image>adbcc271475211002ee987e8dee49001.iix</desktop_image>
          <has_categories />
          <description>Service Catalog - IT Now</description>
          <categories>
             <header_image />
             <sys_id>e15706fc0a0a0aa7007fc21e1ab70c2f</sys_id>
             <description>Your IT gateway. Report issues and submit requests.</description>
             <title>Can We Help You?</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>95fc11615f1211001c9b2572f2b477c6</sys_id>
             <description>Services offered by different departments in the organization</description>
             <title>Departmental Services</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>900682363731300054b6a3549dbe5d5f</sys_id>
             <description>Desktop computers for your work area.</description>
             <title>Desktops</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>d2f716fcc611227a015a142fa0b262c1</sys_id>
             <description>Order new furniture, and fixtures, or request for
      		furniture to be repaired. Cubicle modifications can also be ordered
      		here</description>
             <title>Furniture and Decor</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>d258b953c611227a0146101fb1be7c31</sys_id>
             <description>Order from a variety of hardware to meet your business
      		needs, including phones, tablets and laptops.</description>
             <title>Hardware</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>d2f83003c611227a01a81bd5bd54b1aa</sys_id>
             <description>Request for cleaning services to be performed</description>
             <title>Janitorial</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>59f586f23731300054b6a3549dbe5db7</sys_id>
             <description>Laptop computers for mobile workers.</description>
             <title>Laptops</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>d2f86388c611227a002209db6966d5ad</sys_id>
             <description>Request for a shared office equipment to be repaired</description>
             <title>Maintenance and Repair</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>d68eb4d637b1300054b6a3549dbe5db2</sys_id>
             <description>Cell phones to meet your business needs.</description>
             <title>Mobiles</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>abbcbbbf47700200e90d87e8dee49041</sys_id>
             <description>Standard change templates relating to network related changes: Adding new switches, upgrading IOS etc</description>
             <title>Network Standard Changes</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>109cdff8c6112276003b17991a09ad65</sys_id>
             <description>Office services such as printing, supplies requisition
      		and document shipping and delivery.</description>
             <title>Office</title>
         </categories>
         <categories>
            <header_image />
            <sys_id>2c0b59874f7b4200086eeed18110c71f</sys_id>
            <description>End user peripherals such as mobile phone cases, dongles,
      	  and cables</description>
            <title>Peripherals</title>
         </categories>
         <categories>
             <header_image />
             <sys_id>5d643c6a3771300054b6a3549dbe5db0</sys_id>
             <description>A range of printers for office installation, providing
      	  different feature sets.</description>
             <title>Printers</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>91a9e0510a0a3c7401d20d86782fc9a0</sys_id>
             <description>Quick access to other company information and portals.</description>
             <title>Quick Links</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>496a3a7e0a0a0bc00089b39df14eb56e</sys_id>
             <description>Delegate your roles to another user or group</description>
             <title>Role Delegation</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>d2f7cae4c611227a018ddc481b34e099</sys_id>
             <description>Security related services including badge and keys
      	  requisitions</description>
             <title>Security and Access</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>b3ecbbbf47700200e90d87e8dee49081</sys_id>
             <description>Standard change templates related to servers and attached storage. Reboot server, increase size of storage LUN etc</description>
             <title>Server Standard Changes</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>109f0438c6112276003ae8ac13e7009d</sys_id>
             <description>Document production services. Create and produce
      		high-quality, professional documents.</description>
             <title>Services</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>2809952237b1300054b6a3549dbe5dd4</sys_id>
             <description>A range of software products available for installation
      		on your corporate laptop or desktop computer.</description>
             <title>Software</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>b0fdfb01932002009ca87a75e57ffbe9</sys_id>
             <description>Standard Change Template Library</description>
             <title>Standard Changes</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>b06546f23731300054b6a3549dbe5dd8</sys_id>
             <description>A range of tablet devices for employees in the field.</description>
             <title>Tablets</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>00728916937002002dcef157b67ffb6d</sys_id>
             <description>Propose a new Standard Change Template. Modify or Retire an existing  Standard Change Template.</description>
             <title>Template Management</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>c3d3e02b0a0a0b12005063c7b2fa4f93</sys_id>
             <description>The most commonly requested items from the service
      		catalog over the previous 7 days.</description>
             <title>Top Requests</title>
          </categories>
          <categories>
             <header_image />
             <sys_id>566c3007c3413000ed4860eb5bba8f7e</sys_id>
             <description>null</description>
             <title>Virtual Resources</title>
         </categories>
          <title>Service Catalog</title>
          <has_items />
   </result>
</response>