AppMage

Calendar

This endpoint group provides methods for managing calendar events, including fetching, creating, updating, and deleting them. It also includes a system-level endpoint for updating event statuses.

Endpoints

POST /api/rpc (Method: CalendarRpc.getEvents)

  • Description: Fetches calendar events for a given context and date range.

  • Request Body:

    {
      "method": "CalendarRpc.getEvents",
      "params": {
        "contextId": "string",
        "start": "2023-10-27T10:00:00.000Z",
        "end": "2023-10-27T11:00:00.000Z"
      }
    }
  • Parameters:

    Name Type Required Description
    contextId String Yes The ID of the context this event belongs to (e.g., studentId, projectId).
    start String Yes The start date and time of the range, in ISO 8601 format with offset.
    end String Yes The end date and time of the range, in ISO 8601 format with offset.
  • Response:

    {
      "success": true,
      "data": [
        {
          "_id": "653b6e8e8e8e8e8e8e8e8e8e",
          "contextId": "student123",
          "title": "Meeting with Advisor",
          "description": "Discuss project progress.",
          "start": "2023-10-27T10:00:00.000Z",
          "end": "2023-10-27T11:00:00.000Z",
          "allDay": false,
          "status": "scheduled",
          "reminders": [],
          "eventType": "meeting",
          "relatedEntityId": null,
          "extendedProps": {},
          "createdAt": "2023-10-27T09:00:00.000Z",
          "updatedAt": "2023-10-27T09:00:00.000Z"
        }
      ]
    }
  • Example (cURL):

    curl -X POST https://api.example.com/api/rpc \
      -H "Content-Type: application/json" \
      -H "X-API-Key: YOUR_API_KEY" \
      -d '{
        "method": "CalendarRpc.getEvents",
        "params": {
          "contextId": "student123",
          "start": "2023-10-27T10:00:00.000Z",
          "end": "2023-10-27T11:00:00.000Z"
        }
      }'

POST /api/rpc (Method: CalendarRpc.create)

  • Description: Creates a new calendar event.

  • Request Body:

    {
      "method": "CalendarRpc.create",
      "params": {
        "contextId": "string",
        "title": "string",
        "description": "string",
        "start": "2023-10-27T10:00:00.000Z",
        "end": "2023-10-27T11:00:00.000Z",
        "allDay": false,
        "status": "scheduled",
        "reminders": [
          {
            "unit": "minutes",
            "value": 15
          }
        ],
        "eventType": "string",
        "relatedEntityId": "string",
        "extendedProps": {}
      }
    }
  • Parameters:

    Name Type Required Description
    contextId String Yes The context this event belongs to (e.g., studentId, projectId).
    title String Yes Event title.
    description String No Event description.
    start String Yes The start date and time of the event, in ISO 8601 format.
    end String Yes The end date and time of the event, in ISO 8601 format.
    allDay Boolean No Whether the event is an all-day event. Defaults to false.
    status Enum No The current status of the event. Can be scheduled, in-progress, completed, missed, or cancelled. Defaults to scheduled.
    reminders Array<Object> No Array of reminders to be sent before the event. Each object has unit (minutes, hours, days) and value (number).
    eventType String No Category of the event for filtering/coloring (e.g., 'class', 'assessment', 'personal').
    relatedEntityId String No Link to another entity, like a courseId or assessmentScheduleId.
    extendedProps Object No Additional properties for the event.
  • Response:

    {
      "success": true,
      "data": {
        "_id": "653b6e8e8e8e8e8e8e8e8e8e",
        "contextId": "student123",
        "title": "New Event",
        "description": null,
        "start": "2023-10-27T10:00:00.000Z",
        "end": "2023-10-27T11:00:00.000Z",
        "allDay": false,
        "status": "scheduled",
        "reminders": [],
        "eventType": null,
        "relatedEntityId": null,
        "extendedProps": {},
        "createdAt": "2023-10-27T09:00:00.000Z",
        "updatedAt": "2023-10-27T09:00:00.000Z"
      }
    }
  • Example (cURL):

    curl -X POST https://api.example.com/api/rpc \
      -H "Content-Type: application/json" \
      -H "X-API-Key: YOUR_API_KEY" \
      -d '{
        "method": "CalendarRpc.create",
        "params": {
          "contextId": "student123",
          "title": "New Event",
          "start": "2023-10-27T10:00:00.000Z",
          "end": "2023-10-27T11:00:00.000Z"
        }
      }'

POST /api/rpc (Method: CalendarRpc.update)

  • Description: Updates an existing calendar event.

  • Request Body:

    {
      "method": "CalendarRpc.update",
      "params": {
        "_id": "string",
        "title": "string",
        "description": "string",
        "start": "2023-10-27T10:00:00.000Z"
      }
    }
  • Parameters:

    Name Type Required Description
    _id String Yes MongoDB ObjectId of the event to update.
    contextId String No The context this event belongs to (e.g., studentId, projectId).
    title String No Event title.
    description String No Event description.
    start String No The start date and time of the event, in ISO 8601 format.
    end String No The end date and time of the event, in ISO 8601 format.
    allDay Boolean No Whether the event is an all-day event.
    status Enum No The current status of the event. Can be scheduled, in-progress, completed, missed, or cancelled.
    reminders Array<Object> No Array of reminders to be sent before the event. Each object has unit (minutes, hours, days) and value (number).
    eventType String No Category of the event for filtering/coloring (e.g., 'class', 'assessment', 'personal').
    relatedEntityId String No Link to another entity, like a courseId or assessmentScheduleId.
    extendedProps Object No Additional properties for the event.
  • Response:

    {
      "success": true,
      "data": {
        "_id": "653b6e8e8e8e8e8e8e8e8e8e",
        "contextId": "student123",
        "title": "Updated Event Title",
        "description": null,
        "start": "2023-10-27T10:00:00.000Z",
        "end": "2023-10-27T11:00:00.000Z",
        "allDay": false,
        "status": "scheduled",
        "reminders": [],
        "eventType": null,
        "relatedEntityId": null,
        "extendedProps": {},
        "createdAt": "2023-10-27T09:00:00.000Z",
        "updatedAt": "2023-10-27T09:30:00.000Z"
      }
    }
  • Example (cURL):

    curl -X POST https://api.example.com/api/rpc \
      -H "Content-Type: application/json" \
      -H "X-API-Key: YOUR_API_KEY" \
      -d '{
        "method": "CalendarRpc.update",
        "params": {
          "_id": "653b6e8e8e8e8e8e8e8e8e8e",
          "title": "Updated Event Title"
        }
      }'

POST /api/rpc (Method: CalendarRpc.delete)

  • Description: Deletes a calendar event.

  • Request Body:

    {
      "method": "CalendarRpc.delete",
      "params": {
        "_id": "string"
      }
    }
  • Parameters:

    Name Type Required Description
    _id String Yes MongoDB ObjectId of the event to delete.
  • Response:

    {
      "success": true,
      "data": {
        "success": true
      }
    }
  • Example (cURL):

    curl -X POST https://api.example.com/api/rpc \
      -H "Content-Type: application/json" \
      -H "X-API-Key: YOUR_API_KEY" \
      -d '{
        "method": "CalendarRpc.delete",
        "params": {
          "_id": "653b6e8e8e8e8e8e8e8e8e8e"
        }
      }'