JSON 데이터 수정 API
인스턴스에 HTTPS POST 요청을 전송하여 JSON 웹 서비스를 사용하여 데이터를 수정합니다.
sysparm_action 매개변수가 포함되어야 합니다.삽입
에서 ServiceNow새 레코드를 만듭니다. JSON 객체는 본문으로 POST되어야 합니다(content-type은 일반적으로 application/json이지만 적용되지는 않음). 기록 생성의 응답은 생성된 인시던트의 JSON 객체입니다.
{"short_description":"this is a test","priority":"1"}https://your_instance.service-now.com/incident.do?JSONv2&sysparm_action=insert인시던트를 만듭니다.
{"sysparm_action":"insert","short_description":"this is a test","priority":"1"}삽입다중
{ "records" : [ { "short_description" : "this was inserted with python using JSON 1" , "priority" : "1 - Critical" , "impact" : "1" , "caller_id" : "Fred Luddy" } , { "short_description" : "this was inserted with python using JSON 2" , "priority" : "1 - Critical" , "impact" : "1" , "caller_id" : "Fred Luddy" } ] }https://<instance name>.service-now.com/incident.do?JSONv2&sysparm_action=insert
https://<instance name>.service-now.com/incident.do?JSONv2&sysparm_action=insertMultiple
는 두 개의 인시던트를 만듭니다. records 필드의 배열 값으로 설명된 필드를 확인합니다.
업데이트
sysparm_query URL 매개변수로 지정된 인코딩된 쿼리 문자열로 필터링된 기록 또는 기록 목록을 업데이트합니다. JSON 객체는 본문으로 게시되어야 합니다(content-type은 일반적으로 application/json이지만 적용되지는 않음). 기록 생성의 응답은 업데이트된 기록을 나타내는 JSON 객체의 배열입니다.
{"short_description":"this was updated with python", "priority": "3", "impact":"1"}https://instance_name.service-now.com/incident.do?JSONv2&sysparm_query=priority=3&sysparm_action=update
모든 인시던트를 우선순위 3으로 업데이트하고 JSON 객체로 지정된 값을 설정합니다.
삭제 기록
대상 테이블에서 sysparm_sys_id 매개변수로 식별되는 단일 기록을 삭제합니다. 매개변수는 입력 JSON 객체로 인코딩되거나 URL 매개변수로 제공될 수 있습니다.
{"sysparm_sys_id":"fd4001f80a0a0b380032ffa2b749927b"}
http://instance_name.service-now.com/incident.do?JSONv2&sysparm_action=deleteRecord
sys_id FD4001F80A0A0B380032FFA2B749927B로 식별되는 인시던트 기록을 삭제합니다.
여러 삭제(deleteMultiple)
sysparm_query URL 매개변수에 지정된 인코딩 쿼리 문자열로 필터링된 대상 테이블에서 여러 기록을 삭제합니다. 필터는 입력 JSON 객체에 인코딩될 수도 있습니다.
{"sysparm_query":"short_description=this was updated with python"}http://instance_name.service-now.com/incident.do?JSONv2&sysparm_action=deleteMultipleshort_description 필드에 "Python으로 업데이트되었습니다" 값이 포함된 모든 인시던트 기록을 삭제합니다.