Start a conversation

Update an Occasion

Added in 23.10.

You can update your occasion data such as subject, start time, end time, location, and body in any occasion board by using the Update GraphQL query.

Permissions

You must have either one of the below permissions set to Grant by the Administrator based on your preference.

  • Edit own events - To update their own occasions (events)
  • Edit all events - To update all the occasions (events) in any occasion board.

Basic Steps

  1. Open an occasion board where you want to update an occasion.
  2. Identify the occasion ID from the occasion board from the URL of the occasion.
  3. Ensure that you have the necessary permission to update an occasion granted by the Administrator based on your preference.
  4. Create a POST request to update an occasion.

Example

We are going to update the occasion data such as the end time, location, and featured guests using the updateOccasion mutation GraphQL query.

mutation updateOccasion {
  updateOccasion(
    id: "message:3523"
    updateInput: {
      occasionData: {
        endTime: "2023-07-20T11:00:00Z"
        location: "nbas6217ewqyiudsakhjxmnbzydwigh"
        featuredGuests: { items: [{ id: "user:8" }, { id: "user:10" }] }
      }
    }
  ) {
    errors {
      __typename
      ... on OccasionValidationError {
        message
        key
        fields
      }
    }
    result {
      id
      subject
      body
      occasionData {
        startTime
        endTime
        liveStreamUrl
        location
        featuredGuests {
          id
          login
        }
      }
    }
  }
}

Here is the response for the update mutation GraphQL query.

{
  "data": {
    "updateOccasion": {
      "errors": null,
      "result": {
        "id": "message:3523",
        "occasionData": {
          "startTime": "2023-07-15T04:00:00.000+05:30",
          "endTime": "2023-07-20T04:00:00.000+05:30",
          "liveStreamUrl": "https://www.youtube.com/watch?v=jfKfPfyJRdk",
          "location": "nbas6217ewqyiudsakhjxmnbzydwigh",
          "featuredGuests": [
            {
              "id": "user:8",
              "login": "Urn"
            },
            {
              "id": "user:10",
              "login": "Mpensates"
            }
          ]
        }
      }
    }
  }
}
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. ATLAS

  2. Posted
  3. Updated

Comments