Event Creation through the API

This is the process for creating and scheduling an event through the Astra Schedule API using the Postman Collection.

Prerequisites

Using the Postman Collection

  1. Update the following variable values in the environment.

     

    url
    Your site URL, without the trailing slash, i.e. https://www.aaiscloud.com/YourSiteHere
    username
    i.e. apiuser
    password
    InstitutionId
    GUID of the institution you’ll be creating events for - this can be requested by submitting a support ticket
    EventDate
    Event date in YYYY-MM-DD format
    EventName
    StartMinute
    Start minute of event, where the value is the minute of the day, i.e. 12:00PM = 60 * 12 = 720
    EndMinute
    End minute of event, where the value is the minute of the day, i.e. 12:30PM = 60 * 12.5 = 750
    Duration
    Duration of the event, in minutes
  2. Send the Logon call. It should return true.
  3. Send the Get UserId call. This should update the environment with the GUID assigned to the logged in user account.
  4. Send the Get Rooms call in Informational calls. It should return a JSON formatted body with the rooms configured in the Schedule instance. Update the environment variables with the information for the desired room.
    {
              "totalRecords": 189,
              "data": [
                  [
                      "11ed30c4-dd69-4053-abfc-e5d3acb5efec",
                      "Adams Hall 101", <--- RoomName
                      "11ed30c4-dd69-4053-abfc-e5d3acb5efec", <--- RoomId
                      1,
                      1
                  ],
          ...
          }
    RoomId
    technically this should be the EffectiveParentId, the third value returned from the get rooms call
    RoomName
    i.e. 'Adams Hall 101'
  5. Send the Get Room Config call in Informational calls. This will automatically load the RoomConfigurationId GUID into the Postman environment variables.
  6. Send the Get Event Type call in Informational calls, and update the environment variables with the information for the desired event type.
    {
            "totalRecords": 45,
            "data": [
                [
                    "4c7bc919-329a-4298-a502-c886a2bb2785", <-- EventType
                    "Administrative", <-- EventTypeName
                ],
                [
                    "80dd0bd0-bf6c-4bd8-a58a-7bc6c1b4341c",
                    "Adult/Professional Ed"
                ],
        ...
        }
    EventType
    EventTypeName
    i.e. 'Advising'
  7. Send the Get Customer Contacts call in Informational calls, and update the environment variables with the information for the desired event contact.
    {
              "pos": 0,
              "start": 0,
              "totalRecords": 2242,
              "data": [
                  [
                      "5cbccd60-b892-11e4-a947-17c0833f6baf", <--CustomerContactId
                      "Aasness, Albert", <--CustomerContactName
                      "b0661fc2-a8ad-11e4-8aab-277e3893bef1", <--CustomerId
                      "Chi Omega (Chi O)" <--CustomerName
                  ],
          ...
          }
    
    CustomerContactId
    CustomerContactName
    CustomerId
    CustomerName
  8. Send the adhocroomevent call. This will “reserve” a space in the database for the new event, and pull the room ID into the Postman environment variables. A pre-request script also generates 3 new GUIDs, one for the Event, one for the EventMeeting, and one for the EventMeetingResource. These GUIDs will automatically be added to the Environment and are necessary for the Update Event Entity call, which is step 10.

    The format of the mtgInstances param should be:

    [{
          "Id":"{{NewEventGUID}}",
          "MeetingId":"{{NewEventGUID}}",
          "Name":"{{EventName}}",
          "MeetingDate":"{{EventDate}}T00:00:00",
          "DayMask":0,
          "StartMinute":{{StartMinute}},
          "Duration":{{Duration}},
          "IsException":false,
          "IsCancellation":false,
          "Displayed":false
          }]
    
  9. Send the getReservationNumber call. This will automatically update the environment variable ReservationNumber in the environment.

    The event number is in YYYYMMDD-##### format. For example, 20191119-00001 is the first requested event on 11/19/2019.

  10. Send the Update Event Entity post call. This call needs to be a JSON body, non-”beautified”. Extra spaces can cause issues with the call being mis-identified as malicious by the application.
  11. The event will not be scheduled. This may be preferred if you would still like event approvers to manually approve events submitted through the API. If you would like the event to be scheduled, send the Event Workflow call.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.