Table API - PUT /now/table/{tableName}/{sys_id}

This method updates the specified record with the request body.

URL format

Versioned URL: /api/now/v2/table/{tableName}/{sys_id}

Default URL: /api/now/table/{tableName}/{sys_id}

Supported request parameters

Table 1. Parameters
Parameter Description
sysparm_display_value Data retrieval operation for reference and choice fields.
Based on this value, retrieves the display value and/or the actual value from the database.
  • true returns display values for all fields.
  • false returns actual values from the database. If a value is not specified, this parameter defaults to false.
  • all returns both actual and display values.
Note: There is no preferred method for setting this parameter. However, specifying the display value may cause performance issues since it is not reading directly from the database and may include referencing other fields and records. For more information on display values and actual values, see Table API FAQs (KB0534905).
sysparm_fields Comma-separated field names to return in the response.
sysparm_view UI view to determine fields returned in the response.
Note: If both sysparm_fields and sysparm_view are specified, the sysparm_fields parameter takes priority.
sysparm_exclude_reference_link Additional information provided for reference fields, such as the URI to the reference resource, is suppressed.
sysparm_input_display_value Data insert or update operations.
For values in the request:
  • true treats input values as display values and they are manipulated so they can be stored properly in the database.
  • false treats input values as actual values and stored them in the database without manipulation.
Note:
  • If this parameter is set to true, pay attention to input values, especially date values, as these are interpreted as being supplied via the user time zone preference and are transformed into UTC format.
  • To set the value of an encrypted field, you must set this parameter to true. If this parameter is not set to true, values submitted to encrypted fields are not saved. Additionally, the requesting user must have the appropriate encryption context prior to submitting the request. Encrypted fields are hidden for users without the appropriate encryption context. For more information on display values and actual values, see Table API FAQs (KB0534905). For more information on field encryption see Use an encrypted text field.

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 REST API headers.

Table 2. Request headers
Header Description
X-no-response-body By default, responses include body content detailing the modified record. Set this header to true in the request to suppress the response body.
Content-Type The data format of the request body.
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 API response codes.

Table 4. Status codes
Status code Description
200 Indicates the request completed successfully.

Sample cURL request

curl "https://instance.service-now.com/api/now/table/incident/ef43c6d40a0a0b5700c77f9bf387afe3" \
--request PUT \
--header "Accept:application/json"\
--header "Content-Type:application/json" \
--data "{'assigned_to':'681b365ec0a80164000fb0b05854a0cd','urgency':'1','comments':'Elevating urgency, this is a blocking issue'}" \
--user 'admin':'admin'
{
  "result": {
    "upon_approval": "proceed",
    "location": {
      "link": "https://instance.service-now.com/api/now/table/cmn_location/108752c8c611227501d4ab0e392ba97f",
      "value": "108752c8c611227501d4ab0e392ba97f"
    },
    "expected_start": "",
    "reopen_count": "",
    "close_notes": "",
    "additional_assignee_list": "",
    "impact": "1",
    "urgency": "1",
    "correlation_id": "",
    "sys_tags": "",
    "sys_domain": {
      "link": "https://instance.service-now.com/api/now/table/sys_user_group/global",
      "value": "global"
    },
    "description": "",
    "group_list": "",
    "priority": "1",
    "delivery_plan": "",
    "sys_mod_count": "7",
    "work_notes_list": "",
    "business_service": "",
    "follow_up": "",
    "closed_at": "",
    "sla_due": "2017-07-05 05:58:24",
    "delivery_task": "",
    "sys_updated_on": "2016-01-22 14:12:37",
    "parent": "",
    "work_end": "",
    "number": "INC0000050",
    "closed_by": "",
    "work_start": "",
    "calendar_stc": "",
    "category": "hardware",
    "business_duration": "",
    "incident_state": "2",
    "activity_due": "2016-01-22 16:12:37",
    "correlation_display": "",
    "company": {
      "link": "https://instance.service-now.com/api/now/table/core_company/31bea3d53790200044e0bfc8bcbe5dec",
      "value": "31bea3d53790200044e0bfc8bcbe5dec"
    },
    "active": "true",
    "due_date": "",
    "assignment_group": {
      "link": "https://instance.service-now.com/api/now/table/sys_user_group/8a5055c9c61122780043563ef53438e3",
      "value": "8a5055c9c61122780043563ef53438e3"
    },
    "caller_id": {
      "link": "https://instance.service-now.com/api/now/table/sys_user/5b7c200d0a640069006b3845b5d0fa7c",
      "value": "5b7c200d0a640069006b3845b5d0fa7c"
    },
    "knowledge": "false",
    "made_sla": "true",
    "comments_and_work_notes": "",
    "parent_incident": "",
    "state": "2",
    "user_input": "",
    "sys_created_on": "2015-11-02 18:05:40",
    "approval_set": "",
    "reassignment_count": "0",
    "rfc": "",
    "child_incidents": "",
    "opened_at": "2015-11-02 21:58:24",
    "short_description": "Can't access Exchange server - is it down?",
    "order": "",
    "sys_updated_by": "admin",
    "resolved_by": "",
    "notify": "1",
    "upon_reject": "cancel",
    "approval_history": "",
    "problem_id": "",
    "work_notes": "",
    "calendar_duration": "",
    "close_code": "",
    "sys_id": "ef43c6d40a0a0b5700c77f9bf387afe3",
    "approval": "not requested",
    "caused_by": "",
    "severity": "3",
    "sys_created_by": "glide.maint",
    "resolved_at": "",
    "assigned_to": {
      "link": "https://instance.service-now.com/api/now/table/sys_user/681b365ec0a80164000fb0b05854a0cd",
      "value": "681b365ec0a80164000fb0b05854a0cd"
    },
    "business_stc": "",
    "wf_activity": "",
    "sys_domain_path": "/",
    "cmdb_ci": {
      "link": "https://instance.service-now.com/api/now/table/cmdb_ci/281190e3c0a8000b003f593aa3f20ca6",
      "value": "281190e3c0a8000b003f593aa3f20ca6"
    },
    "opened_by": {
      "link": "https://instance.service-now.com/api/now/table/sys_user/glide.maint",
      "value": "glide.maint"
    },
    "subcategory": "",
    "rejection_goto": "",
    "sys_class_name": "incident",
    "watch_list": "",
    "time_worked": "",
    "contact_type": "phone",
    "escalation": "3",
    "comments": ""
  }
}

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/now/table/incident/ef43c6d40a0a0b5700c77f9bf387afe3'

# 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.put(url, auth=(user, pwd), headers=headers ,data="<request><entry><assigned_to>681b365ec0a80164000fb0b05854a0cd</assigned_to><urgency>1</urgency><comments>Elevating urgency, this is a blocking issue</comments></entry></request>")

# 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>
      <upon_approval>proceed</upon_approval>
      <location>
         <link>https://instance.service-now.com/api/now/table/cmn_location/108752c8c611227501d4ab0e392ba97f</link>
         <value>108752c8c611227501d4ab0e392ba97f</value>
      </location>
      <expected_start />
      <reopen_count />
      <close_notes />
      <additional_assignee_list />
      <impact>1</impact>
      <urgency>1</urgency>
      <correlation_id />
      <priority>1</priority>
      <sys_tags />
      <sys_domain>
         <link>https://instance.service-now.com/api/now/table/sys_user_group/global</link>
         <value>global</value>
      </sys_domain>
      <description />
      <group_list />
      <delivery_plan />
      <sys_mod_count>8</sys_mod_count>
      <work_notes_list />
      <follow_up />
      <business_service />
      <closed_at />
      <sla_due>2017-07-05 05:58:24</sla_due>
      <delivery_task />
      <sys_updated_on>2016-01-22 14:14:54</sys_updated_on>
      <parent />
      <work_end />
      <number>INC0000050</number>
      <closed_by />
      <work_start />
      <calendar_stc />
      <category>hardware</category>
      <business_duration />
      <incident_state>2</incident_state>
      <activity_due>2016-01-22 16:14:54</activity_due>
      <correlation_display />
      <company>
         <link>https://instance.service-now.com/api/now/table/core_company/31bea3d53790200044e0bfc8bcbe5dec</link>
         <value>31bea3d53790200044e0bfc8bcbe5dec</value>
      </company>
      <active>true</active>
      <due_date />
      <assignment_group>
         <link>https://instance.service-now.com/api/now/table/sys_user_group/8a5055c9c61122780043563ef53438e3</link>
         <value>8a5055c9c61122780043563ef53438e3</value>
      </assignment_group>
      <caller_id>
         <link>https://instance.service-now.com/api/now/table/sys_user/5b7c200d0a640069006b3845b5d0fa7c</link>
         <value>5b7c200d0a640069006b3845b5d0fa7c</value>
      </caller_id>
      <knowledge>false</knowledge>
      <made_sla>true</made_sla>
      <comments_and_work_notes />
      <parent_incident />
      <state>2</state>
      <user_input />
      <sys_created_on>2015-11-02 18:05:40</sys_created_on>
      <approval_set />
      <reassignment_count>0</reassignment_count>
      <rfc />
      <opened_at>2015-11-02 21:58:24</opened_at>
      <child_incidents />
      <order />
      <short_description>Can't access Exchange server - is it down?</short_description>
      <resolved_by />
      <sys_updated_by>admin</sys_updated_by>
      <notify>1</notify>
      <upon_reject>cancel</upon_reject>
      <approval_history />
      <problem_id />
      <calendar_duration />
      <work_notes />
      <close_code />
      <approval>not requested</approval>
      <sys_id>ef43c6d40a0a0b5700c77f9bf387afe3</sys_id>
      <caused_by />
      <severity>3</severity>
      <sys_created_by>glide.maint</sys_created_by>
      <assigned_to>
         <link>https://instance.service-now.com/api/now/table/sys_user/681b365ec0a80164000fb0b05854a0cd</link>
         <value>681b365ec0a80164000fb0b05854a0cd</value>
      </assigned_to>
      <resolved_at />
      <business_stc />
      <cmdb_ci>
         <link>https://instance.service-now.com/api/now/table/cmdb_ci/281190e3c0a8000b003f593aa3f20ca6</link>
         <value>281190e3c0a8000b003f593aa3f20ca6</value>
      </cmdb_ci>
      <sys_domain_path>/</sys_domain_path>
      <wf_activity />
      <opened_by>
         <link>https://instance.service-now.com/api/now/table/sys_user/glide.maint</link>
         <value>glide.maint</value>
      </opened_by>
      <rejection_goto />
      <subcategory />
      <sys_class_name>incident</sys_class_name>
      <watch_list />
      <escalation>3</escalation>
      <contact_type>phone</contact_type>
      <time_worked />
      <comments />
   </result>
</response>