WSD 다중 예약 API

  • 릴리스 버전: Washingtondc
  • 업데이트 날짜 2024년 02월 01일
  • 읽기34분
  • (WSD) 다중 예약 API는 Workplace Service Delivery 여러 직장 위치의 예약을 관리하기 위한 엔드포인트를 제공합니다.

    이 API에 접근하려면 호출자에게 sn_wsd_core.workplace_user 역할이 있어야 하며 Workplace Safety Management(sn_wsd_core) 및 Workplace Reservation Management(sn_wsd_rsv) 플러그인이 활성화되어 있어야 합니다.

    이 API는 sn_wsd_rsv 네임스페이스에서 실행됩니다.

    에 대한 Workplace Reservation Management자세한 내용은 Workplace Reservation Management를 참조하십시오.

    WSD 다중 예약 - 패치 /api/sn_wsd_rsv/multi_reservation/cancel/{sys_id}

    지정된 다중 예약을 취소합니다.

    URL 형식

    버전이 지정된 URL: /api/sn_wsd_rsv/{api_version}/ multi_reservation/cancel/{sys_id}

    기본 URL: / api/sn_wsd_rsv/multi_reservation/cancel/{sys_id}

    지원되는 요청 매개변수

    표 1. 경로 매개변수
    이름 설명
    api_version 옵션입니다. 액세스할 엔드포인트의 버전입니다. 예를 들면 v1 또는 v2입니다. 최신 버전이 아닌 엔드포인트 버전을 사용하려면 이 값만 지정합니다.

    데이터 유형: 문자열

    sys_id 취소할 다중 예약의 Sys_id입니다. 직장 예약[sn_wsd_rsv_reservation] 테이블에 있습니다.

    데이터 유형: 문자열

    표 2. 쿼리 매개변수
    이름 설명
    없음
    표 3. 요청 본문 매개변수
    이름 설명
    cancel_notes 예약 취소 이유입니다.

    데이터 유형: 문자열

    헤더

    다음 요청 및 응답 헤더는 이 HTTP 작업에만 적용되거나 이 작업에 고유한 방식으로 적용됩니다. REST API에서 사용되는 일반 헤더 목록은 지원되는 REST API 헤더를 참조하세요.

    표 4. 요청 헤더
    헤더 설명
    수용 요청 본문의 데이터 형식입니다. 지원되는 유형: application/json, 또는, text/xmlapplication/xml .

    기본값: application/json

    컨텐츠-형식 요청 본문의 데이터 형식입니다. application/json만 지원합니다.
    표 5. 응답 헤더
    헤더 설명
    없음

    상태 코드

    다음 상태 코드는 이 HTTP 작업에 적용됩니다. REST API에서 사용할 수 있는 상태 코드 목록은 REST API HTTP 응답 코드를 참조하세요.

    표 6. 상태 코드
    상태 코드 설명
    200 성공입니다. 요청이 성공적으로 처리되었습니다.
    401 승인되지 않았습니다. 사용자 자격 증명이 잘못되었거나 전달되지 않았습니다.
    404 찾을 수 없습니다. 요청한 항목을 찾을 수 없습니다.
    500 내부 서버 오류입니다. 요청을 처리하는 동안 예기치 않은 오류가 발생했습니다. 응답에는 오류에 대한 추가 정보가 포함되어 있습니다.

    응답 본문 매개변수

    이름 설명
    결과 취소 요청의 결과에 대한 상세 정보입니다.

    데이터 유형: 객체

    "result": {
      "error": "String",
      "parent": "String",
      "success": Boolean,
      "successfulReservations": [Array],
      "unSuccessfulReservations": [Array]
    }
    결과.오류 관련된 오류를 설명하는 메시지입니다.

    데이터 유형: 문자열

    결과.상위 상위 예약의 Sys_id입니다. 상위에는 하나 이상의 하위 예약이 연결되어 있을 수 있습니다.

    데이터 유형: 문자열

    결과.성공 예약이 성공적으로 취소되었는지 여부를 나타내는 플래그입니다.
    가능한 값:
    • true: 성공적으로 취소되었습니다.
    • false: 예약이 취소되지 않았습니다.

    데이터 유형: 부울

    result.successfulReservations 다중 예약의 성공적인 취소에 대한 상세 정보입니다.

    데이터 유형: 객체 배열

    "successfulReservations": [
      {
        "msg": "String",
        "success": Boolean,
        "sys_id": "String"
      }
    ]
    result.successfulReservations.msg 취소 메시지입니다.

    데이터 유형: 문자열

    결과.성공예약.성공 예약이 성공적으로 취소되었는지 여부를나타내는 플래그입니다.
    가능한 값:
    • true: 성공적으로 취소되었습니다.
    • false: 작업이 실패했습니다.

    데이터 유형: 부울

    result.successfulReservations.sys_id 취소된 예약의 Sys_id입니다. 직장 예약[sn_wsd_rsv_reservation] 테이블에 있습니다.

    데이터 유형: 문자열

    result.unSuccessfulReservations 다중 예약 취소 실패에 대한 상세 정보입니다.

    데이터 유형: 객체 배열

    "unSuccessfulReservations": [
      {
        "msg": "String",
        "success": Boolean,
        "sys_id": "String"
      }
    ]
    result.unSuccessfulReservations.msg 취소 메시지입니다.

    데이터 유형: 문자열

    결과.unSuccessfulReservations.성공 예약이 성공적으로 취소되었는지 여부를 나타내는 플래그입니다.
    가능한 값:
    • true: 성공적으로 취소되었습니다.
    • false: 작업이 실패했습니다.

    데이터 유형: 부울

    result.unSuccessfulReservations.sys_id 취소되지 않은 예약의 Sys_id입니다. 직장 예약[sn_wsd_rsv_reservation] 테이블에 있습니다.

    데이터 유형: 문자열

    cURL 요청

    다음 코드 예제에서는 다중 예약을 취소하는 방법을 보여 줍니다.

    curl "https://instance.servicenow.com/api/sn_wsd_rsv/multi_reservation/cancel/1b1fdf5987ab01506342b846dabb35ec" \
    --request PATCH \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data "{\"cancel_notes\":\"Meeting no longer needed.\"}" \ 
    --user "username":"password’"

    반환 결과:

    {
      "result": {
        "success": true,
        "successfulReservations": [
          {
            "success": true,
            "msg": "Cancelled successfully.",
            "sys_id": "5b1f9f1d87ab01506342b846dabb35a4"
          },
          {
            "success": true,
            "msg": "Cancelled successfully.",
            "sys_id": "931f9f1d87ab01506342b846dabb35a0"
          }
        ],
        "unSuccessfulReservations": [],
        "error": null,
        "parent": "1b1fdf5987ab01506342b846dabb35ec"
      }
    }

    WSD Multi Reservation - PATCH /api/sn_wsd_rsv/multi_reservation/update/{sys_id}

    Updates the reservations associated with a multi-reservation where the same reservation (meeting) has multiple workplace locations.

    This endpoint can handle four different update scenarios:
    1. Update the content of the multi-reservation record, such as the subject, date, or time.
    2. Convert the multi-reservation into a single reservation based on the parent (reservation for a single workplace location).
    3. Convert a single reservation (reservation for a single workplace location) into a multi-reservation.
    4. Add or remove a workplace location to an existing multi-reservation.

    URL 형식

    Versioned URL: /api/sn_wsd_rsv/{api_version}/multi_reservation/update/{sys_id}

    Default URL: /api/sn_wsd_rsv/multi_reservation/update/{sys_id}

    지원되는 요청 매개변수

    표 7. 경로 매개변수
    이름 설명
    api_version 옵션입니다. 액세스할 엔드포인트의 버전입니다. 예를 들면 v1 또는 v2입니다. 최신 버전이 아닌 엔드포인트 버전을 사용하려면 이 값만 지정합니다.

    데이터 유형: 문자열

    sys_id Sys_id of the reservation to update.
    • Single reservation to multi-reservation: Sys_id of the single reservation. Located in the Workplace Reservation [sn_wsd_rsv_reservation] table.
    • Update content of multi-reservation: Sys_id of the parent reservation record. Located in the Workplace Reservation [sn_wsd_rsv_reservation] table.

    To get the details of a multi parent reservation from the child record, refer to the sys_id in the source_reservation field of the child record.

    데이터 유형: 문자열
    표 8. 쿼리 매개변수
    이름 설명
    없음
    표 9. Request body parameters
    이름 설명
    종료 매개 변수가 전달되지 않은 경우 shift 필요합니다. 요청된 예약 종료 시간입니다.

    데이터 유형: 문자열

    형식: UTC 또는 현지 시간(yyyy-mm-dd hh:mm:ss)

    requested_for 예약이 이루어지는 사용자의 Sys_id 또는 이메일 주소입니다. 사용자 [sys_user] 테이블에 있습니다.

    데이터 유형: 문자열

    예약 가능 항목 List of details about the reservables associated with the reservation.

    Data type: Array of Objects

    "reservables": [
      {
        "is_private": Boolean,
        "sys_id": "String"
      }
    ]
    reservables.is_private 예약이 비공개인지 여부를 나타내는 플래그입니다. 비공개인 경우 예약은 소유자를 제외한 다른 사람에게 표시되지 않습니다.

    이러한 개인 정보 설정에 대한 자세한 내용은 위치 개인 정보 설정 및 영향을 참조하세요.

    유효한 값은 다음과 같습니다.
    • true: 예약이 비공개입니다.
    • false: 예약이 비공개가 아닙니다.

    데이터 유형: 부울

    기본값: 시스템 속성에서 개인정보 보호를 위해 설정된 값입니다.

    reservables.sys_id Sys_id of the location at which to make the reservations. Located in the Workplace Location [sn_wsd_core_workplace_location] table.

    데이터 유형: 문자열

    reservable_module 필수 예약과 연결할 예약 가능한 모듈의 Sys_id입니다. 예약 가능한 모듈은 예약 에 필요한 직장 항목을 정의합니다. 예약 가능한 모듈 [sn_wsd_rsv_reservable_module] 테이블에 있습니다.

    데이터 유형: 문자열

    Shift
    예약과 연결할 교대조의 Sys_id입니다. 교대조 [sn_wsd_core_shift] 테이블에 있습니다. 이 매개 변수가 전달 end 되면 매개 변수가 필요하지 않습니다.

    교대조 기반 예약에 대한 자세한 내용은 교대조 기반 예약 사용을 참조하세요.

    데이터 유형: 문자열

    시작 필수 요청된 예약 시작 시간입니다.

    데이터 유형: 문자열

    형식: UTC 또는 현지 시간(yyyy-mm-dd hh:mm:ss)

    제목
    예약과 연결된 회의의 주제입니다.

    데이터 유형: 문자열

    헤더

    다음 요청 및 응답 헤더는 이 HTTP 작업에만 적용되거나 이 작업에 고유한 방식으로 적용됩니다. REST API에서 사용되는 일반 헤더 목록은 지원되는 REST API 헤더를 참조하세요.

    표 10. 요청 헤더
    헤더 설명
    수용 요청 본문의 데이터 형식입니다. 지원되는 유형: application/json, 또는, text/xmlapplication/xml .

    기본값: application/json

    컨텐츠-형식 요청 본문의 데이터 형식입니다. application/json만 지원합니다.
    표 11. 응답 헤더
    헤더 설명
    없음

    상태 코드

    다음 상태 코드는 이 HTTP 작업에 적용됩니다. REST API에서 사용할 수 있는 상태 코드 목록은 REST API HTTP 응답 코드를 참조하세요.

    표 12. 상태 코드
    상태 코드 설명
    200 성공입니다. 요청이 성공적으로 처리되었습니다.
    401 승인되지 않았습니다. 사용자 자격 증명이 잘못되었거나 전달되지 않았습니다.
    404 찾을 수 없습니다. 요청한 항목을 찾을 수 없습니다.
    500 내부 서버 오류입니다. 요청을 처리하는 동안 예기치 않은 오류가 발생했습니다. 응답에는 오류에 대한 추가 정보가 포함되어 있습니다.

    Response body parameters

    이름 설명
    결과 다중 예약 생성 또는 업데이트의 결과를 반환합니다.

    데이터 유형: 객체

    "result": {
      "parent": "String",
      "success": Boolean,
      "successfulReservations": Array,
      "unSuccessfulReservations": Array
    }
    결과.상위 상위 예약의 Sys_id입니다. 상위에는 하나 이상의 하위 예약이 연결되어 있을 수 있습니다.

    데이터 유형: 문자열

    결과.성공 예약이 성공적으로 생성되었는지 여부를 나타내는 플래그입니다.
    가능한 값:
    • true: 성공적으로 생성되었습니다.
    • false: 작업이 실패했습니다.

    데이터 유형: 부울

    result.successfulReservations List of the reservations that were successfully created.

    데이터 유형: 배열

    "successfulReservations": [
      {
        "cancelled": Boolean,
        "error": "String",
        "reservable": "String"
        "success": Boolean,
        "sys_id": "String",
        "updated": Boolean
      }
    ]
    result.successfulReservations.cancelled Flag that indicates whether the reservation was successfully cancelled.
    가능한 값:
    • true: Successfully cancelled.
    • false: Not cancelled.

    데이터 유형: 부울

    결과.성공예약.오류 예약을 생성하는 동안 문제가 발생한 경우의 오류 메시지입니다.

    데이터 유형: 문자열

    result.SuccessfulReservations.insert 예약이 성공적으로 삽입되었는지 여부를 나타내는 플래그입니다. 예약이 추가되는 경우와 같습니다.
    가능한 값:
    • true: 성공적으로 삽입되었습니다.
    • false: 작업이 실패했습니다.

    데이터 유형: 부울

    result.successfulReservations.reservable 예약이 이루어진 직장의 Sys_id입니다. 직장 위치[sn_wsd_core_workplace_location] 테이블에 있습니다.

    데이터 유형: 문자열

    result.successfulReservations.success Flag that indicates whether the associated operation was successful.
    가능한 값:
    • true: Operation was successful.
    • false: Operation failed.

    데이터 유형: 부울

    result.successfulReservations.sys_id 생성된 예약의 Sys_id입니다. 직장 예약[sn_wsd_rsv_reservation] 테이블에 있습니다.

    데이터 유형: 문자열

    result.successfulReservations.update Flag that indicates whether the reservation was successfully updated.
    가능한 값:
    • true: Successfully updated.
    • false: Not updated.

    데이터 유형: 부울

    result.unSuccessfulReservations List of the reservations that were unsuccessful.

    데이터 유형: 배열

    "unSuccessfulReservations": [
      {
        "cancelled": Boolean,
        "error": "String",
        "insert": Boolean
        "reservable": "String"
        "success": Boolean,
        "sys_id": "String",
        "updated": Boolean
      }
    ]
    result.unSuccessfulReservations.cancelled Flag that indicates whether the reservation was successfully cancelled.
    가능한 값:
    • true: Successfully cancelled.
    • false: Not cancelled.

    데이터 유형: 부울

    결과.unSuccessfulReservations.error 예약을 생성하는 동안 문제가 발생한 경우의 오류 메시지입니다.

    데이터 유형: 문자열

    result.unSuccessfulReservations.insert 예약이 성공적으로 삽입되었는지 여부를 나타내는 플래그입니다.
    가능한 값:
    • true: 성공적으로 삽입되었습니다.
    • false: 작업이 실패했습니다.

    데이터 유형: 부울

    result.unSuccessfulReservations.reservable 예약하려는 직장의 Sys_id입니다. 직장 위치[sn_wsd_core_workplace_location] 테이블에 있습니다.

    데이터 유형: 문자열

    결과.unSuccessfulReservations.성공 예약이 성공적으로 생성되었는지 여부를 나타내는 플래그입니다.
    가능한 값:
    • true: 성공적으로 생성되었습니다.
    • false: 작업이 실패했습니다.

    데이터 유형: 부울

    result.unSuccessfulReservations.sys_id 실패한 예약의 Sys_id입니다.

    항상 null입니다.

    데이터 유형: 문자열

    result.unSuccessfulReservations.update Flag that indicates whether the reservation was successfully updated.
    가능한 값:
    • true: Successfully updated.
    • false: Not updated.

    데이터 유형: 부울

    cURL 요청

    The following code example shows how to modify the content of an existing multi-reservation.

    curl "https://instance.servicenow.com/api/sn_wsd_rsv/multi_reservation/update/02000d4edb7650106c731dcd13961914" \
    --request PATCH \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data "{
        \"reservables\":[
            { 
                \"sys_id\":\"fe1f744edb7650106c731dcd139619ca\" 
            }, 
            {
                \"sys_id\":\"02000d4edb7650106c731dcd13961914\"
            }
        ],
        \"reservable_module\":\"c31241cedb7650106c731dcd13961917\",
        \"subject\":\"Test 1\",
        \"start\":\"2022-05-27 13:00:00\",
        \"end\":\"2022-05-27 14:00:00\",
        \"requested_for\": \"workplace_user@example.com\"
    }" \
    --user 'username':'password'

    Return results:

    {
      "result": {
        "parent": "98ccb4348723cd106342b846dabb359a",
        "success": true,
        "successfulReservations": [
          {
            "success": true,
            "updated": true,
            "cancelled": false,
            "sys_id": "6cccb4348723cd106342b846dabb359d",
            "error": null,
            "reservable": "5eafb44edb7650106c731dcd13961943"
          },
          {
            "success": true,
            "updated": true,
            "cancelled": false,
            "sys_id": "74af283c87ef8d106342b846dabb3592",
            "error": null,
            "reservable": "fe1f744edb7650106c731dcd139619ca"
          }
        ],
        "unSuccessfulReservations": []
      }
    }

    cURL 요청

    The following code example shows how to add a workplace location to an existing multi-reservation.

    curl "https://instance.servicenow.com/api/sn_wsd_rsv/multi_reservation/update/02000d4edb7650106c731dcd13961914" \
    --request PATCH \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data "{
       \"reservables\":[
           { 
               \"sys_id\":\"fe1f744edb7650106c731dcd139619ca\",
               \"is_private\": false 
           }, 
           {
               \"sys_id\":\"5eafb44edb7650106c731dcd13961943\",
               \"is_private\": false
           },
        {
               \"sys_id\":\"c4308d4edb7650106c731dcd1396194c\",
               \"is_private\": false
           }
       ],
       \"reservable_module\":\"c31241cedb7650106c731dcd13961917\",
       \"subject\":\"Test 1\",
       \"start\":\"2022-05-27 13:00:00\",
       \"end\":\"2022-05-27 14:00:00\",
       \"requested_for\": \"workplace_user@example.com\"
    }" \
    --user 'username':'password'

    Return results:

    {
      "result": {
        "parent": "98ccb4348723cd106342b846dabb359a",
        "success": true,
        "successfulReservations": [
          {
            "success": true,
            "updated": true,
            "cancelled": false,
            "sys_id": "6cccb4348723cd106342b846dabb359d",
            "error": null,
            "reservable": "5eafb44edb7650106c731dcd13961943"
          },
          {
            "success": true,
            "updated": true,
            "cancelled": false,
            "sys_id": "74af283c87ef8d106342b846dabb3592",
            "error": null,
            "reservable": "fe1f744edb7650106c731dcd139619ca"
          },
          {
            "success": true,
            "inserted": true,
            "sys_id": "9e6d78748723cd106342b846dabb35a5",
            "error": null,
            "reservable": "c4308d4edb7650106c731dcd1396194c"
          }
        ],
        "unSuccessfulReservations": []
      }
    }
    

    cURL 요청

    The following code example shows how to convert a single reservation to a multi-reservation.

    curl "https://instance.servicenow.com/api/sn_wsd_rsv/multi_reservation/update/02000d4edb7650106c731dcd13961914" \
    --request PATCH \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data "{
       \"reservables\":[
           { 
               \"sys_id\":\"fe1f744edb7650106c731dcd139619ca\",
               \"is_private\": false
           }, 
           {
               \"sys_id\":\"5eafb44edb7650106c731dcd13961943\",
               \"is_private\": false
           }
       ],
       \"reservable_module\":\"c31241cedb7650106c731dcd13961917\",
       \"subject\":\"Test 1\",
       \"start\":\"2022-05-27 13:00:00\",
       \"end\":\"2022-05-27 14:00:00\",
       \"requested_for\": \"workplace_user@example.com\"
    }" \
    --user 'username':'password'

    Return results:

    {
      "result": {
        "success": true,
        "parent": "98ccb4348723cd106342b846dabb359a",
        "successfulReservations": [
          {
            "success": true,
            "inserted": true,
            "sys_id": "6cccb4348723cd106342b846dabb359d",
            "error": null,
            "reservable": "5eafb44edb7650106c731dcd13961943"
          },
          {
            "success": true,
            "insert": false,
            "update": true,
            "cancel": false,
            "sys_id": "74af283c87ef8d106342b846dabb3592",
            "reservable": "fe1f744edb7650106c731dcd139619ca"
          }
        ],
        "unSuccessfulReservations": [],
        "error": null
      }
    }

    cURL 요청

    The following code example shows how to convert a multi-reservation into a single reservation.

    curl "https://instance.servicenow.com/api/sn_wsd_rsv/multi_reservation/update/02000d4edb7650106c731dcd13961914" \
    --request PATCH \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data "{
       \"reservables\":[
           { 
               \"sys_id\":\"fe1f744edb7650106c731dcd139619ca\",
               \"is_private\": false
           }
       ],
       \"reservable_module\":\"c31241cedb7650106c731dcd13961917\",
       \"subject\":\"Test 1\",
       \"start\":\"2022-05-27 13:00:00\",
       \"end\":\"2022-05-27 14:00:00\",
       \"requested_for\": \"workplace_user@example.com\"
    }" \
    --user 'username':'password'

    Return results:

    {
      "result": {
        "sys_id": "74af283c87ef8d106342b846dabb3592",
        "success": true,
        "successfulReservations": [
          {
            "success": true,
            "insert": false,
            "update": true,
            "cancel": false,
            "sys_id": "74af283c87ef8d106342b846dabb3592",
            "reservable": "fe1f744edb7650106c731dcd139619ca",
            "error": ""
          },
          {
            "success": true,
            "insert": false,
            "update": true,
            "cancel": true,
            "sys_id": "3caf283c87ef8d106342b846dabb3596",
            "reservable": "5eafb44edb7650106c731dcd13961943"
          }
        ],
        "unSuccessfulReservations": [],
        "error": null
      }
    }

    WSD Multi Reservation - POST /api/sn_wsd_rsv/multi_reservation/add

    Creates workplace reservations for the same time at different workplace locations.

    URL 형식

    Versioned URL: /api/sn_wsd_rsv/{api_version}/multi_reservation/add

    Default URL: /api/sn_wsd_rsv/multi_reservation/add

    지원되는 요청 매개변수

    표 13. 경로 매개변수
    이름 설명
    api_version 옵션입니다. 액세스할 엔드포인트의 버전입니다. 예를 들면 v1 또는 v2입니다. 최신 버전이 아닌 엔드포인트 버전을 사용하려면 이 값만 지정합니다.

    데이터 유형: 문자열

    표 14. 쿼리 매개변수
    이름 설명
    없음
    표 15. Request body parameters
    이름 설명
    종료 매개 변수가 전달되지 않은 경우 shift 필요합니다. 요청된 예약 종료 시간입니다.

    데이터 유형: 문자열

    형식: UTC 또는 현지 시간(yyyy-mm-dd hh:mm:ss)

    requested_for 예약이 이루어지는 사용자의 Sys_id 또는 이메일 주소입니다. 사용자 [sys_user] 테이블에 있습니다.

    데이터 유형: 문자열

    예약 가능 항목 List of details about the reservables associated with the reservation.

    Data type: Array of Objects

    "reservables": [
      {
        "is_private": Boolean,
        "sys_id": "String"
      }
    ]
    reservables.is_private 예약이 비공개인지 여부를 나타내는 플래그입니다. 비공개인 경우 예약은 소유자를 제외한 다른 사람에게 표시되지 않습니다.

    이러한 개인 정보 설정에 대한 자세한 내용은 위치 개인 정보 설정 및 영향을 참조하세요.

    유효한 값은 다음과 같습니다.
    • true: 예약이 비공개입니다.
    • false: 예약이 비공개가 아닙니다.

    데이터 유형: 부울

    기본값: 시스템 속성에서 개인정보 보호를 위해 설정된 값입니다.

    reservables.sys_id Sys_id of the location at which to make the reservations. Located in the Workplace Location [sn_wsd_core_workplace_location] table.

    데이터 유형: 문자열

    reservable_module 필수 예약과 연결할 예약 가능한 모듈의 Sys_id입니다. 예약 가능한 모듈은 예약 에 필요한 직장 항목을 정의합니다. 예약 가능한 모듈 [sn_wsd_rsv_reservable_module] 테이블에 있습니다.

    데이터 유형: 문자열

    Shift
    예약과 연결할 교대조의 Sys_id입니다. 교대조 [sn_wsd_core_shift] 테이블에 있습니다. 이 매개 변수가 전달 end 되면 매개 변수가 필요하지 않습니다.

    교대조 기반 예약에 대한 자세한 내용은 교대조 기반 예약 사용을 참조하세요.

    데이터 유형: 문자열

    시작 필수 요청된 예약 시작 시간입니다.

    데이터 유형: 문자열

    형식: UTC 또는 현지 시간(yyyy-mm-dd hh:mm:ss)

    제목 필수
    예약과 연결된 회의의 주제입니다.

    데이터 유형: 문자열

    헤더

    다음 요청 및 응답 헤더는 이 HTTP 작업에만 적용되거나 이 작업에 고유한 방식으로 적용됩니다. REST API에서 사용되는 일반 헤더 목록은 지원되는 REST API 헤더를 참조하세요.

    표 16. 요청 헤더
    헤더 설명
    수용 요청 본문의 데이터 형식입니다. 지원되는 유형: application/json, 또는, text/xmlapplication/xml .

    기본값: application/json

    컨텐츠-형식 요청 본문의 데이터 형식입니다. application/json만 지원합니다.
    표 17. 응답 헤더
    헤더 설명
    없음

    상태 코드

    다음 상태 코드는 이 HTTP 작업에 적용됩니다. REST API에서 사용할 수 있는 상태 코드 목록은 REST API HTTP 응답 코드를 참조하세요.

    표 18. 상태 코드
    상태 코드 설명
    200 성공입니다. 요청이 성공적으로 처리되었습니다.
    401 승인되지 않았습니다. 사용자 자격 증명이 잘못되었거나 전달되지 않았습니다.
    404 찾을 수 없습니다. 요청한 항목을 찾을 수 없습니다.
    500 내부 서버 오류입니다. 요청을 처리하는 동안 예기치 않은 오류가 발생했습니다. 응답에는 오류에 대한 추가 정보가 포함되어 있습니다.

    Response body parameters

    이름 설명
    결과 다중 예약 생성 또는 업데이트의 결과를 반환합니다.

    데이터 유형: 객체

    "result": {
      "parent": "String",
      "success": Boolean,
      "successfulReservations": Array,
      "unSuccessfulReservations": Array
    }
    결과.상위 상위 예약의 Sys_id입니다. 상위에는 하나 이상의 하위 예약이 연결되어 있을 수 있습니다.

    데이터 유형: 문자열

    결과.성공 예약이 성공적으로 생성되었는지 여부를 나타내는 플래그입니다.
    가능한 값:
    • true: 성공적으로 생성되었습니다.
    • false: 작업이 실패했습니다.

    데이터 유형: 부울

    result.successfulReservations 성공적으로 생성된 예약 목록입니다.

    데이터 유형: 배열

    "successfulReservations": [
      {
        "error": "String",
        "inserted": Boolean,
        "reservable": "String"
        "success": Boolean,
        "sys_id": "String"
      }
    ]
    결과.성공예약.오류 예약을 생성하는 동안 문제가 발생한 경우의 오류 메시지입니다.

    데이터 유형: 문자열

    result.successfulReservations.inserted 예약이 성공적으로 삽입되었는지 여부를 나타내는 플래그입니다. 예약이 추가되는 경우와 같습니다.
    가능한 값:
    • true: 성공적으로 삽입되었습니다.
    • false: 작업이 실패했습니다.

    데이터 유형: 부울

    result.successfulReservations.reservable 예약이 이루어진 직장의 Sys_id입니다. 직장 위치[sn_wsd_core_workplace_location] 테이블에 있습니다.

    데이터 유형: 문자열

    결과.성공예약.성공 예약이 성공적으로 생성되었는지 여부를 나타내는 플래그입니다.
    가능한 값:
    • true: 성공적으로 생성되었습니다.
    • false: 작업이 실패했습니다.

    데이터 유형: 부울

    result.successfulReservations.sys_id 생성된 예약의 Sys_id입니다. 직장 예약[sn_wsd_rsv_reservation] 테이블에 있습니다.

    데이터 유형: 문자열

    result.unSuccessfulReservations 실패한 예약 목록입니다.

    데이터 유형: 배열

    "unSuccessfulReservations": [
      {
        "error": "String",
        "inserted": Boolean,
        "reservable": "String"
        "success": Boolean,
        "sys_id": "String"
      }
    ]
    결과.unSuccessfulReservations.error 예약을 생성하는 동안 문제가 발생한 경우의 오류 메시지입니다.

    데이터 유형: 문자열

    result.unSuccessfulReservations.inserted 예약이 성공적으로 삽입되었는지 여부를 나타내는 플래그입니다.
    가능한 값:
    • true: 성공적으로 삽입되었습니다.
    • false: 작업이 실패했습니다.

    데이터 유형: 부울

    result.unSuccessfulReservations.reservable 예약하려는 직장의 Sys_id입니다. 직장 위치[sn_wsd_core_workplace_location] 테이블에 있습니다.

    데이터 유형: 문자열

    결과.unSuccessfulReservations.성공 예약이 성공적으로 생성되었는지 여부를 나타내는 플래그입니다.
    가능한 값:
    • true: 성공적으로 생성되었습니다.
    • false: 작업이 실패했습니다.

    데이터 유형: 부울

    result.unSuccessfulReservations.sys_id 실패한 예약의 Sys_id입니다.

    항상 null입니다.

    데이터 유형: 문자열

    cURL 요청

    This code example shows how to reserve two different workplaces for the same reservation.

    curl "https://instance.servicenow.com/api/sn_wsd_rsv/multi_reservation/add" \
    --request POST \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data "{
        \"reservable_module\": \"c31241cedb7650106c731dcd13961917\",
        \"subject\": \"Test-123\",
        \"reservation_purpose\": \"meeting\",
        \"timezone\": \"US/Pacific\",
        \"requested_for\": \"6816f79cc0a8016401c5a33be04be441\",
        \"reservables\": [
            {
                \"sys_id\": \"fe1f744edb7650106c731dcd139619ca\",
                \"is_private\": false
            },
            {
                \"sys_id\": \"d1208d4edb7650106c731dcd1396194a\",
                \"is_private\": false
            }
        ],
        \"start\": \"2023-01-12T11:30:00Z\",
        \"end\": \"2023-01-12T12:30:00Z\",
        \"reservation_type\": \"space\"
    }" \
    --user "username":"password"

    Return results:

    {
      "result": {
        "success": true,
        "parent": "08e8a18687586550cfaa99b73cbb354f",
        "successfulReservations": [
          {
            "success": true,
            "inserted": true,
            "sys_id": "44e8a18687586550cfaa99b73cbb3552",
            "error": null,
            "reservable": "fe1f744edb7650106c731dcd139619ca"
          },
          {
            "success": true,
            "inserted": true,
            "sys_id": "04e8a18687586550cfaa99b73cbb3555",
            "error": null,
            "reservable": "d1208d4edb7650106c731dcd1396194a"
          }
        ],
        "unSuccessfulReservations": []
      }
    }