Periods

Access actions associated with specific periods.

Overview

Periods are used to represent specific timeframes within your team. All dates are in UTC and follow the ISO 8601 format (e.g., 2024-01-01T01:01:00.000Z)

Get Periods

Get all periods, optionally within a specified date range.

GET /periods

Query Parameters

Success Response

A successful response will have an HTTP status of 200.

Response Properties

Example Response

The sample response below shows periods retrieved successfully within a specified date range.

{
    "periods": [
        {
            "id": 1,
            "name": "Example Period",
            "start_date": "2024-07-18T18:30:00.000Z",
            "end_date": "2024-07-18T20:30:00.000Z",
            "created_at": "2024-07-18T19:26:16.624Z",
            "updated_at": "2024-07-26T06:02:03.257Z"
            "markers": {
                  "name": "Example Period Marker",
                  "timestamp":"2024-07-18T18:40:00.000Z"
        }
    ]
}

Get Actions for a Period

Get actions occurring during a period within your team. You can optionally specify form fields to include additional custom data in the action responses. All dates must be in ISO 8601 format (e.g., 2024-08-12T11:58:19.349Z) and are returned in UTC.

GET /periods/{period_id}/actions

Query Parameters

The form_fields parameter allows you to request specific custom fields associated with the actions in the period. These fields should be provided as an array of strings and must be URL-encoded when included in the request. Only the fields specified will be returned in the response. If a requested field is not found for a action, a note will be included in the response under the notes property indicating which fields were missing.

Success Response

HTTP Status Code: 200

Response Properties

Example Response

The sample response below indicates that actions have been retrieved successfully. All dates are in ISO 8601 format and UTC.

{
	"actions": [
		{
			"periodId": 1234,
			"periodName": "24-08",
			"periodActionId": 3,
			"actionId": 91011,
			"classification": "Example Classification",
			"subClassification": "Example Sub-Classification",
			"status": "canceled",
			"createdTime": "2024-08-02T12:23:05.471Z",
			"assignedTime": "2024-08-02T14:00:00.000Z",
			"doingTime": "2024-08-03T09:00:00.000Z",
			"closedTime": "2024-08-04T16:00:00.000Z",
			"createdByUserName": "Example User",
			"periodMarker": "Example Period Marker",
			"assignedUserNames": ["Example User 1", "Example User 2"],
			"channel": "Example Channel",
			"formType": "Example Type",
			"latestChannel": "Latest Routed Channel",
			"aiDispatched": false
		}
	]
}

Error Responses

If there was an issue with the request, you might receive one of the following error responses:

Invalid period_id

HTTP Status Code: 400

{
    "message": "Invalid period_id. It must be a valid integer for your team."
}

Period Not Found

HTTP Status Code: 404

{
    "message": "Period not found"
}

Invalid form_fields

HTTP Status Code: 400

{
    "message": "Invalid form_fields. It must be an array of strings."
}

Last updated

Logo

© Copyright 2024 ALO.ai, Inc. • All Rights Reserved