WSD Group Reservation API
ワークプレイスサービスデリバリ (WSD) Group Reservation API は、グループ予約を管理するためのエンドポイントを提供します。
グループ予約を使用すると、同じ会議のさまざまな人 (グループ) に対して異なる場所を予約できます。
この API は sn_wsd_rsv 名前空間で実行されます。この API にアクセスするには、問い合わせユーザーに sn_wsd_core.workplace_user ロールが必要であり、Workplace Reservation Management (sn_wsd_rsv) プラグインを有効にする必要があります。
ワークプレイス予約管理の詳細については、「ワークプレイス予約管理」を参照してください。
WSD Group Reservation - GET /api/sn_wsd_rsv/group_reservation/{parent_id}
指定されたグループ予約の親予約とすべての子予約を返します。
URL 形式
バージョニングされている URL:/api/sn_wsd_rsv/{api_version}/group_reservation/{parent_id}
デフォルトの URL:/api/sn_wsd_rsv/group_reservation/{parent_id}
サポートされている要求パラメーター
| 名前 | 説明 |
|---|---|
| api_version | オプションアクセスするエンドポイントのバージョン。たとえば、v1 や v2。最新以外のエンドポイントバージョンを使用する場合にのみ、この値を指定してください。 データタイプ:文字列 |
| parent_id | 親予約レコードの sys_id。職場予約 [sn_wsd_rsv_reservation] テーブルにあります。 グループ予約が作成されると、1 つのグループ親レコードと 1 つ以上の子予約レコードが作成されます。予約レコードには、予約レコードのタイプを示す reservation_subtype と呼ばれるフィールドが含まれています。グループの親レコードの場合、このフィールドは「グループの親」に設定され、グループの親レコードであることを示します。子レコードの場合、このフィールドは「単一」に設定されます。 子レコード内で、関連する親予約レコードの sys_id は source_reservation フィールドにあります。 データタイプ:文字列 |
| 名前 | 説明 |
|---|---|
| なし |
| 名前 | 説明 |
|---|---|
| なし |
ヘッダー
次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 サポートされている REST API ヘッダー」を参照してください。
| ヘッダー | 説明 |
|---|---|
| 承認 | 要求本文のデータ形式。サポートされるタイプ:application/json、application/xml、または text/xml。 デフォルト: application/json |
| ヘッダー | 説明 |
|---|---|
| なし |
ステータスコード
この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 REST API HTTP 応答コード」を参照してください。
| ステータスコード | 説明 |
|---|---|
| 200 | 成功。要求が正常に処理されました。 |
| 400 | 要求が正しくありません。無効な要求であるか、親予約 sys_id が指定されていません。 |
| 404 | アクセスが拒否されました。グループ予約をキャンセルできません。ユーザーには、要求されたグループ予約をキャンセルする十分な権限がありません。 |
| 500 | 内部サーバーエラー。要求の処理中に予期しないエラーが発生しました。応答に、エラーに関する追加情報が含まれます。 |
応答本文のパラメーター
| 名前 | 説明 |
|---|---|
| result | グループ予約に関連付けられた親と子の予約に関する詳細。 データタイプ:オブジェクト |
cURL 要求
次のコード例は、グループ予約の詳細を取得する方法を示しています。
curl "http://instance.servicenow.com/api/sn_wsd_rsv/group_reservation/e2245051533b01103cf7ddeeff7b12d6" \
--request GET \
--header "Accept:application/json" \
--user 'username':'password'
返される結果:
{
"result": {
"parent": {
"sys_id": "e2245051533b01103cf7ddeeff7b12d6",
"number": "WRES0001142",
"start": "2022-05-30T04:30:00Z",
"end": "2022-05-30T05:30:00Z",
"sys_created_on": "2022-05-30T04:19:02Z",
"sys_updated_on": "2022-05-30T04:19:04Z",
"source_reservation": null,
"check_in_state": {
"value": "not_required",
"display_value": "Not required"
},
"external_id": null,
"external_ical": null,
"active": true,
"state": {
"value": "confirmed",
"display_value": "Confirmed"
},
"sensitivity": {
"value": "normal",
"display_value": "Normal"
},
"reservation_type": {
"value": "space",
"display_value": "Space"
},
"reservation_subtype": {
"value": "group_parent",
"display_value": "Group parent"
},
"reservation_purpose": {
"value": "meeting",
"display_value": "Meeting"
},
"attendees": null,
"number_of_attendees": 1,
"is_parent": true,
"subject": "Test#52",
"virtual_meeting": null,
"recording_details": [],
"sync_state": {
"value": "not_required",
"display_value": "Synchronization not required"
},
"sub_source": {
"value": "servicenow_workplace_service_delivery",
"display_value": "ServiceNow Workplace Service Delivery"
},
"last_updated_sub_source": {
"value": "servicenow_workplace_service_delivery",
"display_value": "ServiceNow Workplace Service Delivery"
},
"reservable_module": {
"sys_id": "5db44502dbb650106c731dcd13961937",
"name": "Desks",
"title": "Desks",
"inline_title": "desk",
"font_awesome_icon": "fa-desktop",
"reservable_table": "sn_wsd_core_space",
"reservable_filter": "active=true^is_reservable=true^location_type=5f017383eb512010b89bfdfc9c5228c8^building.is_reservable=true^floor.is_reservable=true^EQ",
"short_description": "Reserve a single desks",
"reservable_type": "location",
"require_subject": null,
"require_cancel_notes": false,
"virtual_meeting_provider": {
"sys_id": "e33d9e6853c201103cf7ddeeff7b1205",
"display_value": "Template"
},
"allow_invitees": null,
"display_number_of_attendees": null,
"display_on_behalf_of": "1",
"display_sensitivity": null,
"max_days_in_future": "90",
"allow_whole_day": "1",
"require_whole_day": null,
"selection_type": "unit",
"reservable_container_field": null,
"reservable_quantity_field": null,
"apply_to_shift": null,
"max_occurrences": "90",
"enable_facet_filter": false,
"search_limit": 10000,
"enable_ical_generation": null,
"enable_group_reservations": "1",
"enable_browse_near_a_person": "1",
"enable_browse_by_area": "1",
"display_value": "Desks",
"browse_near_a_person_enabled": true,
"browse_by_area_enabled": true,
"reservable_columns": [
"sys_id",
"external_id",
"email",
"name",
"title",
"description",
"image",
"number",
"site",
"campus",
"building",
"floor",
"area",
"capacity",
"reservable_quantity",
"location_type",
"order",
"requires_check_in",
"is_reservable"
],
"layout_mapping": {
"title": [
"name"
],
"description": [
"description"
],
"subtitle": [
"campus",
"building",
"floor",
"area"
],
"subtitle_asc": [
"area",
"floor",
"building",
"campus"
],
"image": "image",
"body": [
{
"label": "Capacity",
"icon": "fa-users",
"field": "capacity",
"field_to_display": ""
},
{
"label": "Standard services",
"icon": "fa-check",
"field": "standard_services",
"field_to_display": "name"
},
{
"label": "Reservable purposes",
"icon": "fa-tags",
"field": "reservable_purposes",
"field_to_display": "name"
}
]
},
"timeSlots": [
{
"sys_id": "d5331cf2dbb5f01038e42b24ca961906",
"name": "All day",
"short_description": "8am - 6pm",
"slot_start": "08:00",
"slot_end": "18:00"
},
{
"sys_id": "de131cf2dbb5f01038e42b24ca961931",
"name": "Before noon",
"short_description": "8am - 12pm",
"slot_start": "08:00",
"slot_end": "12:00"
},
{
"sys_id": "6e99ab5ddbb930102e8e853e68961929",
"name": "After noon",
"short_description": "1pm - 6pm",
"slot_start": "13:00",
"slot_end": "18:00"
}
],
"buildingSysIds": [
"9e0364cedb3650106c731dcd1396192b"
],
"reservable_views": [
{
"type": "card",
"label": "Card view",
"iconClass": "fa-th-large",
"isDefault": true,
"order": "1"
},
{
"type": "schedule",
"label": "Schedule view",
"iconClass": "fa-calendar-o",
"isDefault": false,
"order": "2"
}
],
"checkin_before_minutes": 30,
"reservation_paths": [
{
"value": "browse_all",
"displayValue": "Browse all"
},
{
"value": "browse_near_a_person",
"displayValue": "Browse near a person"
},
{
"value": "browse_by_area",
"displayValue": "Browse by area"
}
],
"override_approval_policy": "never_required"
},
"notification_recipients": null,
"notification_custom_message": null,
"opened_by": {
"sys_id": "6816f79cc0a8016401c5a33be04be441",
"value": "6816f79cc0a8016401c5a33be04be441",
"displayValue": "System Administrator",
"display_value": "System Administrator",
"name": "System Administrator",
"user_name": "admin",
"table": "sys_user",
"avatar": "c148e1d13741310042106710ce41f149.iix?t=small",
"initials": "SA",
"email": "admin@example.com",
"label": "System Administrator, Finance"
},
"requested_for": {
"sys_id": "6816f79cc0a8016401c5a33be04be441",
"value": "6816f79cc0a8016401c5a33be04be441",
"displayValue": "System Administrator",
"display_value": "System Administrator",
"name": "System Administrator",
"user_name": "admin",
"table": "sys_user",
"avatar": "c148e1d13741310042106710ce41f149.iix?t=small",
"initials": "SA",
"email": "admin@example.com",
"label": "System Administrator, Finance"
},
"edit_restriction": {
"value": "no_restriction",
"display_value": "No restriction"
},
"source": {
"value": "servicenow",
"display_value": "Workplace Services"
},
"source_icon": {
"classNames": "fa fa-calendar-check-o",
"tooltip": "Reservation is confirmed",
"imgSrc": ""
},
"shift": null,
"locations": [
{
"sys_id": "73c2698adb7210106c731dcd13961968",
"name": "B1-03-03",
"description": "Desk reserved for the Team-C. After 10am, free to reserve for everyone.",
"display_value": "B1-03-03",
"capacity": 1,
"label_value": "Workspace/Desk name",
"email": null,
"reservable_module": {
"sys_id": "5db44502dbb650106c731dcd13961937",
"name": "Desks",
"title": "Desks",
"inline_title": "desk"
},
"region": {
"sys_id": "2d626c4edb3650106c731dcd1396194b",
"display_value": "Europe",
"active": true
},
"site": {
"sys_id": "b17220cedb3650106c731dcd1396197a",
"display_value": "Western Europe",
"active": true
},
"campus": {
"sys_id": "44d2e0cedb3650106c731dcd13961988",
"display_value": "Amsterdam Campus",
"active": true
},
"building": {
"sys_id": "9e0364cedb3650106c731dcd1396192b",
"display_value": "AMS-B1",
"active": true,
"timezone": {
"value": "Europe/Amsterdam",
"displayValue": "Europe/Amsterdam"
}
},
"floor": {
"sys_id": "5373a8cedb3650106c731dcd1396198a",
"display_value": "Floor 3",
"active": true
},
"area": {
"sys_id": "410ff04edb7650106c731dcd13961973",
"display_value": "Desks C1",
"active": true
},
"reservation": {
"sys_id": "2a24d0d1533b01103cf7ddeeff7b126b",
"number_of_attendees": 1,
"state": {
"value": "confirmed",
"display_value": "Confirmed"
},
"requested_for": {
"sys_id": "62826bf03710200044e0bfc8bcbe5df1",
"value": "62826bf03710200044e0bfc8bcbe5df1",
"displayValue": "Abel Tuter",
"display_value": "Abel Tuter",
"name": "Abel Tuter",
"user_name": "abel.tuter",
"table": "sys_user",
"avatar": "063e38383730310042106710ce41f13b.iix?t=small",
"initials": "AT",
"email": "abel.tuter@example.com",
"label": "Product Management"
},
"number": "WRES0001143",
"active": true
},
"number_of_attendees": 1,
"state": {
"value": "confirmed",
"display_value": "Confirmed"
},
"number": "WRES0001143",
"requested_for": {
"sys_id": "62826bf03710200044e0bfc8bcbe5df1",
"value": "62826bf03710200044e0bfc8bcbe5df1",
"displayValue": "Abel Tuter",
"display_value": "Abel Tuter",
"name": "Abel Tuter",
"user_name": "abel.tuter",
"table": "sys_user",
"avatar": "063e38383730310042106710ce41f13b.iix?t=small",
"initials": "AT",
"email": "abel.tuter@example.com",
"label": "Product Management"
}
},
{
"sys_id": "32f2a98adb7210106c731dcd13961972",
"name": "B1-03-04",
"description": "Desk reserved for the Team-C. After 10am, free to reserve for everyone.",
"display_value": "B1-03-04",
"capacity": 1,
"label_value": "Workspace/Desk name",
"email": null,
"reservable_module": {
"sys_id": "5db44502dbb650106c731dcd13961937",
"name": "Desks",
"title": "Desks",
"inline_title": "desk"
},
"region": {
"sys_id": "2d626c4edb3650106c731dcd1396194b",
"display_value": "Europe",
"active": true
},
"site": {
"sys_id": "b17220cedb3650106c731dcd1396197a",
"display_value": "Western Europe",
"active": true
},
"campus": {
"sys_id": "44d2e0cedb3650106c731dcd13961988",
"display_value": "Amsterdam Campus",
"active": true
},
"building": {
"sys_id": "9e0364cedb3650106c731dcd1396192b",
"display_value": "AMS-B1",
"active": true,
"timezone": {
"value": "Europe/Amsterdam",
"displayValue": "Europe/Amsterdam"
}
},
"floor": {
"sys_id": "5373a8cedb3650106c731dcd1396198a",
"display_value": "Floor 3",
"active": true
},
"area": {
"sys_id": "410ff04edb7650106c731dcd13961973",
"display_value": "Desks C1",
"active": true
},
"reservation": {
"sys_id": "6a24d0d1533b01103cf7ddeeff7b126e",
"number_of_attendees": 1,
"state": {
"value": "confirmed",
"display_value": "Confirmed"
},
"requested_for": {
"sys_id": "a8f98bb0eb32010045e1a5115206fe3a",
"value": "a8f98bb0eb32010045e1a5115206fe3a",
"displayValue": "Abraham Lincoln",
"display_value": "Abraham Lincoln",
"name": "Abraham Lincoln",
"user_name": "abraham.lincoln",
"table": "sys_user",
"avatar": null,
"initials": "AL",
"email": "abraham.lincoln@example.com",
"label": ""
},
"number": "WRES0001144",
"active": true
},
"number_of_attendees": 1,
"state": {
"value": "confirmed",
"display_value": "Confirmed"
},
"number": "WRES0001144",
"requested_for": {
"sys_id": "a8f98bb0eb32010045e1a5115206fe3a",
"value": "a8f98bb0eb32010045e1a5115206fe3a",
"displayValue": "Abraham Lincoln",
"display_value": "Abraham Lincoln",
"name": "Abraham Lincoln",
"user_name": "abraham.lincoln",
"table": "sys_user",
"avatar": null,
"initials": "AL",
"email": "abraham.lincoln@example.com",
"label": ""
}
}
],
"reservationAcl": {
"write": {
"record": true,
"fields": {
"subject": true,
"sensitivity": true,
"requested_for": true,
"number_of_attendees": true,
"location": true
},
"allFields": true
},
"read": true
}
},
"children": [
{
"sys_id": "2a24d0d1533b01103cf7ddeeff7b126b",
"number": "WRES0001143",
"location": {
"sys_id": "73c2698adb7210106c731dcd13961968",
"name": "B1-03-03",
"description": "Desk reserved for the Team-C. After 10am, free to reserve for everyone.",
"display_value": "B1-03-03",
"capacity": 1,
"label_value": "Workspace/Desk name",
"email": null,
"reservable_module": {
"sys_id": "5db44502dbb650106c731dcd13961937",
"name": "Desks",
"title": "Desks",
"inline_title": "desk"
},
"region": {
"sys_id": "2d626c4edb3650106c731dcd1396194b",
"display_value": "Europe",
"active": true
},
"site": {
"sys_id": "b17220cedb3650106c731dcd1396197a",
"display_value": "Western Europe",
"active": true
},
"campus": {
"sys_id": "44d2e0cedb3650106c731dcd13961988",
"display_value": "Amsterdam Campus",
"active": true
},
"building": {
"sys_id": "9e0364cedb3650106c731dcd1396192b",
"display_value": "AMS-B1",
"active": true,
"timezone": {
"value": "Europe/Amsterdam",
"displayValue": "Europe/Amsterdam"
}
},
"floor": {
"sys_id": "5373a8cedb3650106c731dcd1396198a",
"display_value": "Floor 3",
"active": true
},
"area": {
"sys_id": "410ff04edb7650106c731dcd13961973",
"display_value": "Desks C1",
"active": true
},
"reservation": {
"sys_id": "2a24d0d1533b01103cf7ddeeff7b126b",
"number_of_attendees": 1,
"state": {
"value": "confirmed",
"display_value": "Confirmed"
},
"requested_for": {
"sys_id": "62826bf03710200044e0bfc8bcbe5df1",
"name": "Abel Tuter",
"user_name": "abel.tuter"
},
"number": "WRES0001143",
"active": true
},
"number_of_attendees": 1,
"state": {
"value": "confirmed",
"display_value": "Confirmed"
},
"number": "WRES0001143",
"requested_for": {
"sys_id": "62826bf03710200044e0bfc8bcbe5df1",
"name": "Abel Tuter",
"user_name": "abel.tuter"
}
},
"start": "2022-05-30T04:30:00Z",
"end": "2022-05-30T05:30:00Z",
"sys_created_on": "2022-05-30T04:19:02Z",
"sys_updated_on": "2022-05-30T04:19:04Z",
"source_reservation": {
"sys_id": "e2245051533b01103cf7ddeeff7b12d6",
"display_value": "WRES0001142",
"name": "WRES0001142"
},
"check_in_state": {
"value": "awaiting_check_in",
"display_value": "Awaiting check-in"
},
"external_id": null,
"external_ical": null,
"active": true,
"state": {
"value": "confirmed",
"display_value": "Confirmed"
},
"sensitivity": {
"value": "normal",
"display_value": "Normal"
},
"reservation_type": {
"value": "space",
"display_value": "Space"
},
"reservation_subtype": {
"value": "single",
"display_value": "Single"
},
"reservation_purpose": {
"value": "meeting",
"display_value": "Meeting"
},
"attendees": null,
"number_of_attendees": 1,
"is_parent": false,
"subject": "Test#52",
"virtual_meeting": null,
"recording_details": [],
"sync_state": {
"value": "not_required",
"display_value": "Synchronization not required"
},
"sub_source": {
"value": "servicenow_workplace_service_delivery",
"display_value": "ServiceNow Workplace Service Delivery"
},
"last_updated_sub_source": {
"value": "servicenow_workplace_service_delivery",
"display_value": "ServiceNow Workplace Service Delivery"
},
"reservable_module": {
"sys_id": "5db44502dbb650106c731dcd13961937",
"name": "Desks",
"title": "Desks",
"inline_title": "desk",
"font_awesome_icon": "fa-desktop",
"reservable_table": "sn_wsd_core_space",
"reservable_filter": "active=true^is_reservable=true^location_type=5f017383eb512010b89bfdfc9c5228c8^building.is_reservable=true^floor.is_reservable=true^EQ",
"short_description": "Reserve a single desks",
"reservable_type": "location",
"require_subject": null,
"require_cancel_notes": false,
"virtual_meeting_provider": {
"sys_id": "e33d9e6853c201103cf7ddeeff7b1205",
"display_value": "Template"
},
"allow_invitees": null,
"display_number_of_attendees": null,
"display_on_behalf_of": "1",
"display_sensitivity": null,
"max_days_in_future": "90",
"allow_whole_day": "1",
"require_whole_day": null,
"selection_type": "unit",
"reservable_container_field": null,
"reservable_quantity_field": null,
"apply_to_shift": null,
"max_occurrences": "90",
"enable_facet_filter": false,
"search_limit": 10000,
"enable_ical_generation": null,
"enable_group_reservations": "1",
"enable_browse_near_a_person": "1",
"enable_browse_by_area": "1",
"display_value": "Desks",
"browse_near_a_person_enabled": true,
"browse_by_area_enabled": true,
"reservable_columns": [
"sys_id",
"external_id",
"email",
"name",
"title",
"description",
"image",
"number",
"site",
"campus",
"building",
"floor",
"area",
"capacity",
"reservable_quantity",
"location_type",
"order",
"requires_check_in",
"is_reservable"
],
"layout_mapping": {
"title": [
"name"
],
"description": [
"description"
],
"subtitle": [
"campus",
"building",
"floor",
"area"
],
"subtitle_asc": [
"area",
"floor",
"building",
"campus"
],
"image": "image",
"body": [
{
"label": "Capacity",
"icon": "fa-users",
"field": "capacity",
"field_to_display": ""
},
{
"label": "Standard services",
"icon": "fa-check",
"field": "standard_services",
"field_to_display": "name"
},
{
"label": "Reservable purposes",
"icon": "fa-tags",
"field": "reservable_purposes",
"field_to_display": "name"
}
]
},
"timeSlots": [
{
"sys_id": "d5331cf2dbb5f01038e42b24ca961906",
"name": "All day",
"short_description": "8am - 6pm",
"slot_start": "08:00",
"slot_end": "18:00"
},
{
"sys_id": "de131cf2dbb5f01038e42b24ca961931",
"name": "Before noon",
"short_description": "8am - 12pm",
"slot_start": "08:00",
"slot_end": "12:00"
},
{
"sys_id": "6e99ab5ddbb930102e8e853e68961929",
"name": "After noon",
"short_description": "1pm - 6pm",
"slot_start": "13:00",
"slot_end": "18:00"
}
],
"buildingSysIds": [
"9e0364cedb3650106c731dcd1396192b"
],
"reservable_views": [
{
"type": "card",
"label": "Card view",
"iconClass": "fa-th-large",
"isDefault": true,
"order": "1"
},
{
"type": "schedule",
"label": "Schedule view",
"iconClass": "fa-calendar-o",
"isDefault": false,
"order": "2"
}
],
"checkin_before_minutes": 30,
"reservation_paths": [
{
"value": "browse_all",
"displayValue": "Browse all"
},
{
"value": "browse_near_a_person",
"displayValue": "Browse near a person"
},
{
"value": "browse_by_area",
"displayValue": "Browse by area"
}
],
"override_approval_policy": "never_required"
},
"notification_recipients": null,
"notification_custom_message": null,
"opened_by": {
"sys_id": "6816f79cc0a8016401c5a33be04be441",
"value": "6816f79cc0a8016401c5a33be04be441",
"displayValue": "System Administrator",
"display_value": "System Administrator",
"name": "System Administrator",
"user_name": "admin",
"table": "sys_user",
"avatar": "c148e1d13741310042106710ce41f149.iix?t=small",
"initials": "SA",
"email": "admin@example.com",
"label": "System Administrator, Finance"
},
"requested_for": {
"sys_id": "62826bf03710200044e0bfc8bcbe5df1",
"value": "62826bf03710200044e0bfc8bcbe5df1",
"displayValue": "Abel Tuter",
"display_value": "Abel Tuter",
"name": "Abel Tuter",
"user_name": "abel.tuter",
"table": "sys_user",
"avatar": "063e38383730310042106710ce41f13b.iix?t=small",
"initials": "AT",
"email": "abel.tuter@example.com",
"label": "Product Management"
},
"edit_restriction": {
"value": "fully_restricted",
"display_value": "Fully restricted"
},
"source": {
"value": "servicenow",
"display_value": "Workplace Services"
},
"source_reservation_requester": {
"sys_id": "6816f79cc0a8016401c5a33be04be441",
"name": "System Administrator",
"user_name": "admin"
},
"source_icon": {
"classNames": "fa fa-calendar-check-o",
"tooltip": "Reservation is confirmed",
"imgSrc": ""
},
"shift": null,
"reservationAcl": {
"write": {
"record": true,
"fields": {
"subject": true,
"sensitivity": true,
"requested_for": true,
"number_of_attendees": true,
"location": true
},
"allFields": true
},
"read": true
}
},
{
"sys_id": "6a24d0d1533b01103cf7ddeeff7b126e",
"number": "WRES0001144",
"location": {
"sys_id": "32f2a98adb7210106c731dcd13961972",
"name": "B1-03-04",
"description": "Desk reserved for the Team-C. After 10am, free to reserve for everyone.",
"display_value": "B1-03-04",
"capacity": 1,
"label_value": "Workspace/Desk name",
"email": null,
"reservable_module": {
"sys_id": "5db44502dbb650106c731dcd13961937",
"name": "Desks",
"title": "Desks",
"inline_title": "desk"
},
"region": {
"sys_id": "2d626c4edb3650106c731dcd1396194b",
"display_value": "Europe",
"active": true
},
"site": {
"sys_id": "b17220cedb3650106c731dcd1396197a",
"display_value": "Western Europe",
"active": true
},
"campus": {
"sys_id": "44d2e0cedb3650106c731dcd13961988",
"display_value": "Amsterdam Campus",
"active": true
},
"building": {
"sys_id": "9e0364cedb3650106c731dcd1396192b",
"display_value": "AMS-B1",
"active": true,
"timezone": {
"value": "Europe/Amsterdam",
"displayValue": "Europe/Amsterdam"
}
},
"floor": {
"sys_id": "5373a8cedb3650106c731dcd1396198a",
"display_value": "Floor 3",
"active": true
},
"area": {
"sys_id": "410ff04edb7650106c731dcd13961973",
"display_value": "Desks C1",
"active": true
},
"reservation": {
"sys_id": "6a24d0d1533b01103cf7ddeeff7b126e",
"number_of_attendees": 1,
"state": {
"value": "confirmed",
"display_value": "Confirmed"
},
"requested_for": {
"sys_id": "a8f98bb0eb32010045e1a5115206fe3a",
"name": "Abraham Lincoln",
"user_name": "abraham.lincoln"
},
"number": "WRES0001144",
"active": true
},
"number_of_attendees": 1,
"state": {
"value": "confirmed",
"display_value": "Confirmed"
},
"number": "WRES0001144",
"requested_for": {
"sys_id": "a8f98bb0eb32010045e1a5115206fe3a",
"name": "Abraham Lincoln",
"user_name": "abraham.lincoln"
}
},
"start": "2022-05-30T04:30:00Z",
"end": "2022-05-30T05:30:00Z",
"sys_created_on": "2022-05-30T04:19:02Z",
"sys_updated_on": "2022-05-30T04:19:04Z",
"source_reservation": {
"sys_id": "e2245051533b01103cf7ddeeff7b12d6",
"display_value": "WRES0001142",
"name": "WRES0001142"
},
"check_in_state": {
"value": "awaiting_check_in",
"display_value": "Awaiting check-in"
},
"external_id": null,
"external_ical": null,
"active": true,
"state": {
"value": "confirmed",
"display_value": "Confirmed"
},
"sensitivity": {
"value": "normal",
"display_value": "Normal"
},
"reservation_type": {
"value": "space",
"display_value": "Space"
},
"reservation_subtype": {
"value": "single",
"display_value": "Single"
},
"reservation_purpose": {
"value": "meeting",
"display_value": "Meeting"
},
"attendees": null,
"number_of_attendees": 1,
"is_parent": false,
"subject": "Test#52",
"virtual_meeting": null,
"recording_details": [],
"sync_state": {
"value": "not_required",
"display_value": "Synchronization not required"
},
"sub_source": {
"value": "servicenow_workplace_service_delivery",
"display_value": "ServiceNow Workplace Service Delivery"
},
"last_updated_sub_source": {
"value": "servicenow_workplace_service_delivery",
"display_value": "ServiceNow Workplace Service Delivery"
},
"reservable_module": {
"sys_id": "5db44502dbb650106c731dcd13961937",
"name": "Desks",
"title": "Desks",
"inline_title": "desk",
"font_awesome_icon": "fa-desktop",
"reservable_table": "sn_wsd_core_space",
"reservable_filter": "active=true^is_reservable=true^location_type=5f017383eb512010b89bfdfc9c5228c8^building.is_reservable=true^floor.is_reservable=true^EQ",
"short_description": "Reserve a single desks",
"reservable_type": "location",
"require_subject": null,
"require_cancel_notes": false,
"virtual_meeting_provider": {
"sys_id": "e33d9e6853c201103cf7ddeeff7b1205",
"display_value": "Template"
},
"allow_invitees": null,
"display_number_of_attendees": null,
"display_on_behalf_of": "1",
"display_sensitivity": null,
"max_days_in_future": "90",
"allow_whole_day": "1",
"require_whole_day": null,
"selection_type": "unit",
"reservable_container_field": null,
"reservable_quantity_field": null,
"apply_to_shift": null,
"max_occurrences": "90",
"enable_facet_filter": false,
"search_limit": 10000,
"enable_ical_generation": null,
"enable_group_reservations": "1",
"enable_browse_near_a_person": "1",
"enable_browse_by_area": "1",
"display_value": "Desks",
"browse_near_a_person_enabled": true,
"browse_by_area_enabled": true,
"reservable_columns": [
"sys_id",
"external_id",
"email",
"name",
"title",
"description",
"image",
"number",
"site",
"campus",
"building",
"floor",
"area",
"capacity",
"reservable_quantity",
"location_type",
"order",
"requires_check_in",
"is_reservable"
],
"layout_mapping": {
"title": [
"name"
],
"description": [
"description"
],
"subtitle": [
"campus",
"building",
"floor",
"area"
],
"subtitle_asc": [
"area",
"floor",
"building",
"campus"
],
"image": "image",
"body": [
{
"label": "Capacity",
"icon": "fa-users",
"field": "capacity",
"field_to_display": ""
},
{
"label": "Standard services",
"icon": "fa-check",
"field": "standard_services",
"field_to_display": "name"
},
{
"label": "Reservable purposes",
"icon": "fa-tags",
"field": "reservable_purposes",
"field_to_display": "name"
}
]
},
"timeSlots": [
{
"sys_id": "d5331cf2dbb5f01038e42b24ca961906",
"name": "All day",
"short_description": "8am - 6pm",
"slot_start": "08:00",
"slot_end": "18:00"
},
{
"sys_id": "de131cf2dbb5f01038e42b24ca961931",
"name": "Before noon",
"short_description": "8am - 12pm",
"slot_start": "08:00",
"slot_end": "12:00"
},
{
"sys_id": "6e99ab5ddbb930102e8e853e68961929",
"name": "After noon",
"short_description": "1pm - 6pm",
"slot_start": "13:00",
"slot_end": "18:00"
}
],
"buildingSysIds": [
"9e0364cedb3650106c731dcd1396192b"
],
"reservable_views": [
{
"type": "card",
"label": "Card view",
"iconClass": "fa-th-large",
"isDefault": true,
"order": "1"
},
{
"type": "schedule",
"label": "Schedule view",
"iconClass": "fa-calendar-o",
"isDefault": false,
"order": "2"
}
],
"checkin_before_minutes": 30,
"reservation_paths": [
{
"value": "browse_all",
"displayValue": "Browse all"
},
{
"value": "browse_near_a_person",
"displayValue": "Browse near a person"
},
{
"value": "browse_by_area",
"displayValue": "Browse by area"
}
],
"override_approval_policy": "never_required"
},
"notification_recipients": null,
"notification_custom_message": null,
"opened_by": {
"sys_id": "6816f79cc0a8016401c5a33be04be441",
"value": "6816f79cc0a8016401c5a33be04be441",
"displayValue": "System Administrator",
"display_value": "System Administrator",
"name": "System Administrator",
"user_name": "admin",
"table": "sys_user",
"avatar": "c148e1d13741310042106710ce41f149.iix?t=small",
"initials": "SA",
"email": "admin@example.com",
"label": "System Administrator, Finance"
},
"requested_for": {
"sys_id": "a8f98bb0eb32010045e1a5115206fe3a",
"value": "a8f98bb0eb32010045e1a5115206fe3a",
"displayValue": "Abraham Lincoln",
"display_value": "Abraham Lincoln",
"name": "Abraham Lincoln",
"user_name": "abraham.lincoln",
"table": "sys_user",
"avatar": null,
"initials": "AL",
"email": "abraham.lincoln@example.com",
"label": ""
},
"edit_restriction": {
"value": "fully_restricted",
"display_value": "Fully restricted"
},
"source": {
"value": "servicenow",
"display_value": "Workplace Services"
},
"source_reservation_requester": {
"sys_id": "6816f79cc0a8016401c5a33be04be441",
"name": "System Administrator",
"user_name": "admin"
},
"source_icon": {
"classNames": "fa fa-calendar-check-o",
"tooltip": "Reservation is confirmed",
"imgSrc": ""
},
"shift": null,
"reservationAcl": {
"write": {
"record": true,
"fields": {
"subject": true,
"sensitivity": true,
"requested_for": true,
"number_of_attendees": true,
"location": true
},
"allFields": true
},
"read": true
}
}
]
}
}
WSD Group Reservation - PATCH /api/sn_wsd_rsv/group_reservation/cancel/{id}
指定されたグループ予約をキャンセルします。
URL 形式
バージョニングされている URL:/api/sn_wsd_rsv/{api_version}/group_reservation/cancel/{id}
デフォルトの URL:/api/sn_wsd_rsv/group_reservation/cancel/{id}
サポートされている要求パラメーター
| 名前 | 説明 |
|---|---|
| api_version | オプションアクセスするエンドポイントのバージョン。たとえば、v1 や v2。最新以外のエンドポイントバージョンを使用する場合にのみ、この値を指定してください。 データタイプ:文字列 |
| id | 親予約レコードの sys_id。職場予約 [sn_wsd_rsv_reservation] テーブルにあります。 グループ予約が作成されると、1 つのグループ親レコードと 1 つ以上の子予約レコードが作成されます。予約レコードには、予約レコードのタイプを示す reservation_subtype と呼ばれるフィールドが含まれています。グループの親レコードの場合、このフィールドは「グループの親」に設定され、グループの親レコードであることを示します。子レコードの場合、このフィールドは「単一」に設定されます。 子レコード内で、関連する親予約レコードの sys_id は source_reservation フィールドにあります。 データタイプ:文字列 |
| 名前 | 説明 |
|---|---|
| なし |
| 名前 | 説明 |
|---|---|
| cancel_notes | 予約をキャンセルする理由 データタイプ:文字列 デフォルト値:「グループキャンセルでキャンセルされた予約」 |
ヘッダー
次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 サポートされている REST API ヘッダー」を参照してください。
| ヘッダー | 説明 |
|---|---|
| 承認 | 要求本文のデータ形式。サポートされるタイプ:application/json、application/xml、または text/xml。 デフォルト: application/json |
| Content-Type | 要求本文のデータ形式。application/json のみをサポートします。 |
| ヘッダー | 説明 |
|---|---|
| なし |
ステータスコード
この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 REST API HTTP 応答コード」を参照してください。
| ステータスコード | 説明 |
|---|---|
| 200 | 成功。要求が正常に処理されました。 |
| 400 | 要求が正しくありません。無効な要求であるか、親予約 sys_id が指定されていません。 |
| 401 | 権限がありません。ユーザー資格情報が間違っているか、渡されていません。 |
| 404 | アクセスが拒否されました。グループ予約をキャンセルできません。ユーザーには、要求されたグループ予約をキャンセルする十分な権限がありません。 |
| 500 | 内部サーバーエラー。要求の処理中に予期しないエラーが発生しました。応答に、エラーに関する追加情報が含まれます。 |
応答本文のパラメーター
| 名前 | 説明 |
|---|---|
| result | グループ予約のキャンセル要求の結果。 データタイプ:オブジェクト |
| result.allChildrenCanceled | グループ予約に関連付けられたすべての子予約が正常にキャンセルされたかどうかを示すフラグ。 可能な値:
データタイプ:ブーリアン |
| result.cancelledParent | グループ予約の親予約が正常にキャンセルされたかどうかを示すフラグ。 可能な値:
データタイプ:ブーリアン |
| result.canceledReservations | 正常にキャンセルされた子予約の sys_id のリスト。 データタイプ:アレイ |
| result.failedChildMeetings | キャンセルされなかった子予約の sys_id のリスト。 データタイプ:アレイ |
| result.msg | 予約のキャンセルに失敗した場合、このパラメーターには失敗の原因に関するメッセージが含まれます。 データタイプ:文字列 |
| result.parent | キャンセルされた親予約の sys_id。 データタイプ:文字列 |
| result.success | グループ予約が正常にキャンセルされたかどうかを示すフラグ。 可能な値:
データタイプ:ブーリアン |
| result.user_msg | 将来の使用のために予約されています。予約のキャンセルに失敗した場合、このパラメーターには UI に表示できる失敗の原因に関する翻訳されたメッセージが含まれます。 データタイプ:文字列 |
cURL 要求
次のコード例は、グループ予約をキャンセルする方法を示しています。
curl "http://instance.servicenow.com/api/sn_wsd_rsv/group_reservation/cancel/22c1aee353af01103cf7ddeeff7b12d5" \
--request PATCH \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
\"cancel_notes\":\"Need to postpone until next quarter\"
}" \
--user 'username':'password'
返される結果:
{
"result": {
"success": true,
"canceledReservations": [
"6ec1aee353af01103cf7ddeeff7b12d8",
"aac1aee353af01103cf7ddeeff7b12db"
],
"failedChildMeetings": [],
"cancelledParent": true,
"allChildrenCanceled": true,
"msg": "",
"user_msg": "",
"parent": "22c1aee353af01103cf7ddeeff7b12d5"
}
}
WSD Group Reservation - PATCH /api/sn_wsd_rsv/group_reservation/update/{id}
指定されたグループ予約を更新します。
- 件名
- 開始日時
- 終了日時
- 予約に関連付けられたシフト
- 子予約の職場の場所
URL 形式
バージョニングされている URL:/api/sn_wsd_rsv/{api_version}/group_reservation/update/{id}
デフォルトの URL:/api/sn_wsd_rsv/group_reservation/update/{id}
サポートされている要求パラメーター
| 名前 | 説明 |
|---|---|
| api_version | オプションアクセスするエンドポイントのバージョン。たとえば、v1 や v2。最新以外のエンドポイントバージョンを使用する場合にのみ、この値を指定してください。 データタイプ:文字列 |
| id | 親予約レコードの sys_id。職場予約 [sn_wsd_rsv_reservation] テーブルにあります。 グループ予約が作成されると、1 つのグループ親レコードと 1 つ以上の子予約レコードが作成されます。予約レコードには、予約レコードのタイプを示す reservation_subtype と呼ばれるフィールドが含まれています。グループの親レコードの場合、このフィールドは「グループの親」に設定され、グループの親レコードであることを示します。子レコードの場合、このフィールドは「単一」に設定されます。 子レコード内で、関連する親予約レコードの sys_id は source_reservation フィールドにあります。 データタイプ:文字列 |
| 名前 | 説明 |
|---|---|
| なし |
| 名前 | 説明 |
|---|---|
| children | 予約に関連付ける子予約レコードの更新されたリスト。 データタイプ:オブジェクトのアレイ |
| children.is_private | 予約がプライベートかどうかを示すフラグ。プライベートである場合、予約は所有者以外の誰にも表示されません。 これらのプライバシー設定について詳しくは、 場所のプライバシー設定と影響をご覧ください。 有効な値:
データタイプ:ブーリアン デフォルト:システムプロパティでプライバシーに設定される値。 |
| children.location | 予約する場所の更新された sys_id。職場の場所 [sn_wsd_core_workplace_location] テーブルにあります。 データタイプ:文字列 |
| children.requested_for | 予約が要求されているユーザーの更新された sys_id。ユーザー [sys_user] テーブルにあります。 データタイプ:文字列 |
| end | 予約の更新された終了時間。 データタイプ:文字列 形式:UTC または現地時間 (yyyy-mm-dd hh:mm:ss) |
| requested_for | 予約対象のユーザーの sys_id またはメールアドレス。ユーザー [sys_user] テーブルにあります。 データタイプ:文字列 |
| reservable_module | 必須です。予約に関連付ける予約可能モジュールの sys_id。予約可能モジュールは、予約に必要な職場アイテムを定義します。予約可能なモジュール [sn_wsd_rsv_reservable_module] テーブルにあります。 データタイプ:文字列 |
| shift | 予約に関連付けるシフトの更新された sys_id。シフト [sn_wsd_core_shift] テーブルにあります。 シフトベースの予約の詳細については、「 シフトベースの予約を有効にする」を参照してください。 データタイプ:文字列 |
| start | 予約の更新された開始時間。 データタイプ:文字列 形式:UTC または現地時間 (yyyy-mm-dd hh:mm:ss) デフォルト:空 - 開始時間は子予約に指定されている |
| subject | 予約に関連付けられた会議の更新された件名。 データタイプ:文字列 デフォルト:空 |
| workplace_location | グループ予約に関連付ける職場の場所の更新された sys_id。職場の場所 [sn_wsd_core_workplace_location] テーブルにあります。 データタイプ:文字列 デフォルト:空 - 場所は子予約に指定されている |
ヘッダー
次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 サポートされている REST API ヘッダー」を参照してください。
| ヘッダー | 説明 |
|---|---|
| 承認 | 要求本文のデータ形式。サポートされるタイプ:application/json、application/xml、または text/xml。 デフォルト: application/json |
| Content-Type | 要求本文のデータ形式。application/json のみをサポートします。 |
| ヘッダー | 説明 |
|---|---|
| なし |
ステータスコード
この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 REST API HTTP 応答コード」を参照してください。
| ステータスコード | 説明 |
|---|---|
| 200 | 成功。要求が正常に処理されました。 |
| 400 | 要求が正しくありません。不適切な要求タイプまたは誤った要求が検出されました。 |
| 401 | 権限がありません。ユーザー資格情報が間違っているか、渡されていません。 |
| 500 | 内部サーバーエラー。要求の処理中に予期しないエラーが発生しました。応答に、エラーに関する追加情報が含まれます。 |
応答本文のパラメーター
| 名前 | 説明 |
|---|---|
| result | 複数予約の作成または更新の結果を返します。 データタイプ:オブジェクト |
| result.parent | 更新された親予約の sys_id。 データタイプ:文字列 |
| result.success | 予約が正常に作成されたかどうかを示すフラグ。 可能な値:
データタイプ:ブール |
| result.successfulReservations | 正常に更新された予約のリスト。 データタイプ:アレイ |
| result.successfulReservations.msg | 更新に関する内部メッセージ。操作に関する技術情報を提供します。 データタイプ:文字列 |
| result.successfulReservations.operation | 作成や更新など、実行された操作のタイプ。追加された部屋など、新しい可能な予約がグループ予約に追加された場合、この値は create として返されます。それ以外の場合は update に設定されます。 データタイプ:文字列 |
| result.successfulReservations.sys_id | 作成された予約の sys_id。職場予約 [sn_wsd_rsv_reservation] テーブルにあります。 データタイプ:文字列 |
| result.successfulReservations.user_msg | 更新に関するユーザーメッセージ。このメッセージは、ユーザーの言語設定に基づいて翻訳される可能性があり、UI に表示されます。 データタイプ:文字列 |
| result.unSuccessfulReservations | 正常に更新されなかった予約のリスト。 データタイプ:アレイ |
| result.unSuccessfulReservations.msg | 更新エラーに関するメッセージ。 データタイプ:文字列 |
| result.unSuccessfulReservations.operation | 作成や更新など、実行された操作のタイプ。 データタイプ:文字列 |
| result.unSuccessfulReservations.sys_id | 作成された予約の sys_id。職場予約 [sn_wsd_rsv_reservation] テーブルにあります。 データタイプ:文字列 |
| result.unSuccessfulReservations.user_msg | 更新エラーに関するメッセージ。 データタイプ:文字列 |
cURL 要求
次の例は、このエンドポイントを呼び出してグループ予約を更新する方法を示しています。
curl "http://instance.servicenow.com/api/sn_wsd_rsv/group_reservation/update/b84e218a87586550cfaa99b73cbb35ec" \
--request PATCH \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
\"reservable_module\": \"5db44502dbb650106c731dcd13961937\",
\"subject\": \"Test-123\",
\"reservation_purpose\": \"meeting\",
\"timezone\": \"US/Pacific\",
\"children\": [
{
\"location\": \"6a11a94adb7210106c731dcd1396194e\",
\"requested_for\": \"62826bf03710200044e0bfc8bcbe5df1\",
\"is_private\": false
},
{
\"location\": \"9841e94adb7210106c731dcd13961914\",
\"requested_for\": \"6816f79cc0a8016401c5a33be04be441\",
\"is_private\": false
}
],
\"start\": \"2023-02-12T11:30:00Z\",
\"end\": \"2023-02-12T12:30:00Z\"
}" \
返される結果:
{
"result": {
"parent": "b84e218a87586550cfaa99b73cbb35ec",
"success": true,
"successfulReservations": [
{
"operation": "create",
"sys_id": "7b9e658a87586550cfaa99b73cbb357d",
"msg": "",
"user_msg": null,
"location": "6a11a94adb7210106c731dcd1396194e"
},
{
"operation": "create",
"sys_id": "3b9e658a87586550cfaa99b73cbb3580",
"msg": "",
"user_msg": null,
"location": "9841e94adb7210106c731dcd13961914"
}
],
"unSuccessfulReservations": []
}
}
WSD Group Reservation - POST /api/sn_wsd_rsv/group_reservation/add
グループ予約を作成します。
URL 形式
バージョニングされている URL:/api/sn_wsd_rsv/{api_version}/group_reservation/add
デフォルトの URL:/api/sn_wsd_rsv/group_reservation/add
サポートされている要求パラメーター
| 名前 | 説明 |
|---|---|
| api_version | オプションアクセスするエンドポイントのバージョン。たとえば、v1 や v2。最新以外のエンドポイントバージョンを使用する場合にのみ、この値を指定してください。 データタイプ:文字列 |
| 名前 | 説明 |
|---|---|
| なし |
| 名前 | 説明 |
|---|---|
| children | 必須。予約に関連付ける子予約レコードリスト。 データタイプ:オブジェクトのアレイ |
| children.is_private | 予約がプライベートかどうかを示すフラグ。プライベートである場合、予約は所有者以外の誰にも表示されません。 これらのプライバシー設定について詳しくは、 場所のプライバシー設定と影響をご覧ください。 有効な値:
データタイプ:ブーリアン デフォルト:システムプロパティでプライバシーに設定される値。 |
| children.location | 必須です。 予約する場所の sys_id。職場の場所 [sn_wsd_core_workplace_location] テーブルにあります。 データタイプ:文字列 |
| children.requested_for | 必須。予約が要求されているユーザーの sys_id。ユーザー [sys_user] テーブルにあります。 データタイプ:文字列 |
| 終了 | shiftパラメーターが渡されない場合は必須です。予約の要求された終了時間。 データタイプ:文字列 形式:UTC または現地時間 (yyyy-mm-dd hh:mm:ss) |
| requested_for | 予約対象のユーザーの sys_id またはメールアドレス。ユーザー [sys_user] テーブルにあります。 データタイプ:文字列 |
| reservable_module | 必須です。予約に関連付ける予約可能モジュールの sys_id。予約可能モジュールは、予約に必要な職場アイテムを定義します。予約可能なモジュール [sn_wsd_rsv_reservable_module] テーブルにあります。 データタイプ:文字列 |
| shift | 予約に関連付けるシフトの sys_id。シフト [sn_wsd_core_shift] テーブルにあります。このパラメーターが渡される場合、 end パラメーターは必要ありません。 シフトベースの予約の詳細については、「 シフトベースの予約を有効にする」を参照してください。 データタイプ:文字列 |
| start | 必須です。予約の要求された開始時間。 データタイプ:文字列 形式:UTC または現地時間 (yyyy-mm-dd hh:mm:ss) |
| subject | 必須です。 予約に関連付けられた会議の件名。 データタイプ:文字列 |
| workplace_location | グループ予約に関連付ける職場の場所の sys_id。職場の場所 [sn_wsd_core_workplace_location] テーブルにあります。 データタイプ:文字列 デフォルト:空 - 場所は子予約に指定されている |
ヘッダー
次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 サポートされている REST API ヘッダー」を参照してください。
| ヘッダー | 説明 |
|---|---|
| 承認 | 要求本文のデータ形式。サポートされるタイプ:application/json、application/xml、または text/xml。 デフォルト: application/json |
| Content-Type | 要求本文のデータ形式。application/json のみをサポートします。 |
| ヘッダー | 説明 |
|---|---|
| なし |
ステータスコード
この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 REST API HTTP 応答コード」を参照してください。
| ステータスコード | 説明 |
|---|---|
| 200 | 成功。要求が正常に処理されました。 |
| 400 | 要求が正しくありません。不適切な要求タイプまたは誤った要求が検出されました。 |
| 401 | 権限がありません。ユーザー資格情報が間違っているか、渡されていません。 |
| 500 | 内部サーバーエラー。要求の処理中に予期しないエラーが発生しました。応答に、エラーに関する追加情報が含まれます。 |
応答本文のパラメーター
| 名前 | 説明 |
|---|---|
| result | 作成されたグループ予約の詳細。 データタイプ:オブジェクト |
| result.created_children | 作成された子予約の詳細。 データタイプ:オブジェクトのアレイ |
| result.created_children.location | 予約する場所の sys_id。職場の場所 [sn_wsd_core_workplace_location] テーブルにあります。 データタイプ:文字列 |
| result.created_children.requested_for | 作成された子予約のユーザーの sys_id。 データタイプ:文字列 |
| result.created_children.sys_id | 作成された子予約レコードの sys_id。 データタイプ:文字列 |
| result.failed_children | 作成に失敗した子予約の詳細。 データタイプ:オブジェクトのアレイ |
| result.failed_children.location | 失敗した予約に関連付けられた場所レコードの sys_id。 データタイプ:文字列 |
| result.failed_children.requested_for | 要求された子予約のユーザーの sys_id。 データタイプ:文字列 |
| result.failed_children.sys_id | 常に -1。 データタイプ:文字列 |
| result.msg | 要求が失敗した場合にエラーを説明するメッセージ。 データタイプ:文字列 |
| result.parent | 親予約レコードの sys_id。職場予約 [sn_wsd_rsv_reservation] テーブルにあります。 グループ予約が作成されると、1 つのグループ親レコードと 1 つ以上の子予約レコードが作成されます。予約レコードには、予約レコードのタイプを示す reservation_subtype と呼ばれるフィールドが含まれています。グループの親レコードの場合、このフィールドは「グループの親」に設定され、グループの親レコードであることを示します。子レコードの場合、このフィールドは「単一」に設定されます。 子レコード内で、関連する親予約レコードの sys_id は source_reservation フィールドにあります。 データタイプ:文字列 |
| result.success | 予約が正常に作成されたかどうかを示すフラグ。 可能な値:
データタイプ:ブール |
| result.userMsg | 要求が失敗した場合にエラーを説明するメッセージ。 データタイプ:文字列 |
cURL 要求
次のコード例は、このエンドポイントを使用してグループ予約を作成する方法を示しています。
curl "http://instance.servicenow.com/api/sn_wsd_rsv/group_reservation/add" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
\"reservable_module\": \"5db44502dbb650106c731dcd13961937\",
\"subject\": \"Test-123\",
\"reservation_purpose\": \"meeting\",
\"timezone\": \"US/Pacific\",
\"children\": [
{
\"location\": \"6a11a94adb7210106c731dcd1396194e\",
\"requested_for\": \"62826bf03710200044e0bfc8bcbe5df1\",
\"is_private\": false
},
{
\"location\": \"9841e94adb7210106c731dcd13961914\",
\"requested_for\": \"6816f79cc0a8016401c5a33be04be441\",
\"is_private\": false
}
],
\"start\": \"2023-01-12T11:30:00Z\",
\"end\": \"2023-01-12T12:30:00Z\"
}" \
--user 'username':'password'
返される結果:
{
"result": {
"parent": "b84e218a87586550cfaa99b73cbb35ec",
"success": true,
"created_children": [
{
"sys_id": "7c4e218a87586550cfaa99b73cbb35ee",
"location": "6a11a94adb7210106c731dcd1396194e",
"requested_for": "62826bf03710200044e0bfc8bcbe5df1"
},
{
"sys_id": "3c4e218a87586550cfaa99b73cbb35f1",
"location": "9841e94adb7210106c731dcd13961914",
"requested_for": "6816f79cc0a8016401c5a33be04be441"
}
],
"failed_children": [],
"user_msg": "",
"msg": ""
}
}