Save Selected Appointment

Endpoint

POST
undefined/msapi/sales/unifiedscheduling/unified-appointments/v1/appointments

After the user selects an appointment from the list of appointments returned from the /appointments/carts/{shoppingCartId} GET request, the selected appointment is saved to the database through this POST call. The selected field is of type real-time, preferred or asap and has an id similar to availableTimeSlot's id. For <b> real time appointment, the id is a combination of workorder id, the date and time period of the appointment, like "W3074670354-2023-03-16-9-11" </b>. For a <b> preferred appointment it would be a combination of weekday and the time period, like "Monday-8AM-12PM"</b>. In preferred appointments, there is one possibility of type "asap" and id "asap" which can also be selected by the user.

arrowRequest

Header Parameters

    Body Parameters

    Responses

    Successfully persisted selected appointment.

    arrowBody

    application/json

    REQUEST

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    curl --request POST \
         --url https://example.com/msapi/sales/unifiedscheduling/unified-appointments/v1/appointments \
         --header 'accept: application/json;charset=utf-8' \
         --header 'content-type: application/json;charset=utf-8' \
         --header 'idpctx-uuid: 29639ff2-04cf-2594-de33-8b67ad65ce3b' \
         --data '
    {
      "installationDayContact": {
        "givenName": "Jon",
        "familyName": "test45",
        "contactMedium": [
          {
            "mediumType": "telephone",
            "characteristic": {
              "contactType": "home",
              "phoneNumber": "3243432442"
            },
            "preferred": true
          },
          {
            "mediumType": "telephone",
            "characteristic": {
              "contactType": "home",
              "phoneNumber": "3243432442"
            }
          }
        ]
      },
      "selected": {
        "id": "Monday-2PM-4PM",
        "@type": "preferred",
        "note": [
          {
            "text": "test note"
          }
        ],
        "relatedEntity": [
          {
            "@referredType": "ProductOrder",
            "id": "62bc97b5-7119-a407-9f33-b78c929a8aa9",
            "role": "cart"
          }
        ]
      }
    }
    '

    RESPONSE

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    {
      "selected": {
        "@type": "realTime",
        "contactMedium": [
          {
            "characteristic": {
              "contactType": "home",
              "phoneNumber": "2142051234",
              "verified": true
            },
            "mediumType": "telephone",
            "preferred": true
          }
        ],
        "externalId": "S4074000036",
        "id": "b2248c1d-dd03-4e31-af70-121321c80085",
        "note": [
          {
            "text": ""
          }
        ],
        "relatedParty": [
          {
            "id": "00000VM6KF",
            "name": "test#d",
            "role": "installationDayContact"
          }
        ],
        "validFor": {
          "endDateTime": "2024-03-28T15:00:00.000Z",
          "startDateTime": "2024-03-28T13:00:00.000Z"
        }
      }
    }