JSON 데이터 수정 API
HTTPS POST 요청을 인스턴스에 전송하여 JSON 웹 서비스를 사용하여 데이터를 수정합니다.
sysparm_action 매개 변수가 포함되어야 하며, 본문에는 들어오는 JSON 개체 post가 있어야 합니다.삽입
에서 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"}insert다중
{ "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로 식별된 인시던트 기록을 삭제합니다.
delete다중
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으로 업데이트됨" 값이 포함된 모든 인시던트 기록을 삭제합니다.