## Endpoint: `/api/ocs/` **Method**: GET **Description**: Fetch all on-call schedules. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |None|-|-|No parameters required|-| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer <token>| ### Example Response { "results": [ { "id": <id>, "customer": <Customer_id>, "name": "<oncall_name>", "customer_name": "<Customer_name" } ], } --- ## Endpoint: `/api/ocs/` **Method**: POST **Description**: Post a new on-call schedule. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |None|-|-|No parameters required|-| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer <token>| ### Request Body { "customer": {Customer_Name}, "name": "{Oncall_name}", "default_email": "{Email}", "default_phone": {Phone} } ### Example Response `The details inserted (payload).` --- ## Endpoint: `/api/ocs-on-demand/?tier_id={tier_id}` **Method**: GET **Description**: Retrieve all on-demand on-call schedules. ### Parameters | Parameter | Type | Required | Description | Example Value | | --------- | ------ | -------- | ----------------------------------------------- | ------------- | | tier_id | string | Yes | Unique identifier for the on-call schedule tier | 12345 | ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer <token>| Copy code { "results": [ ... OCS-ON DEMAND DETAILS ... ], "next_page": null } --- ## Endpoint: `/api/ocs-on-demand/` **Method**: POST **Description**: Post a new on-demand on-call schedule. ### Parameters | Parameter | Type | Required | Description | Example Value | | --------- | -------- | -------- | ----------------------------------------------------------- | -------------------- | | start | datetime | Yes | Date and time of the start of the shift (ISO format) | 2024-12-30T08:00:00Z | | end | datetime | Yes | Date and time of the end of the shift (ISO format) | 2024-12-30T16:00:00Z | | contact | integer | Yes | Contact ID for the shift (from Get Active Users & Contacts) | 12345 | | tier | integer | Yes | Tier ID (from Get OCS Groups) | 678 | | sure | string | No | Additional optional parameter (details not provided) | - | **Sure** parameter: - If true – will save scheduler and run over existing shifts and split them if needed - If false – will not save if there is scheduler set already for the same times ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer <token>| ### Request Body { "start": "START_TIME", "end": "END_TIME", "contact": CONTACTS_IDS "tier": TIER_ID, "sure": true } ### Example Response The payload plus the id of the ocs-on-demand --- ## Endpoint: `/api/ocs-on-demand/{id}/` **Method**: GET **Description**: Retrieve details of a specific on-demand schedule by ID. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |id|string|Yes|Unique identifier for the on-demand schedule|12345| ### Example Request ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer <token>| ### Example Response { "id": OCS-ON-DEMAND_ID, "tier": TIER_ID, "start": "START_TIME", "end": "END_TIME", "contact": CONTACTS_IDS } --- ## Endpoint: `/api/ocs-on-demand/{id}/` **Method**: PUT **Description**: Update a specific on-demand schedule by ID. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |id|string|Yes|Unique identifier for the on-demand schedule|12345| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer <token>| ### Request Payload { "start": "START_TIME", "end": "END_TIME", "contact": CONTACTS_IDS "tier": TIER_ID, "sure": true } ### Example Response The payload plus the id of the ocs-on-demand --- ## Endpoint: `/api/ocs-on-demand/{id}/` **Method**: DELETE **Description**: Delete a specific on-demand schedule by ID. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |id|string|Yes|Unique identifier for the on-demand schedule|12345| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer <token>| ### Example Response `1` This response means that the request has succeeded --- ## Endpoint: `/api/ocs-on-demand/count/` **Method**: GET **Description**: Retrieve the count of all on-demand schedules. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |None|-|-|No parameters required|-| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer| ### Example Response { "count": <Count_Number> } --- ## Endpoint: `/api/ocs-tier/` **Method**: GET **Description**: Retrieve available tiers for updating on-call schedules. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |None|-|-|No parameters required|-| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer| ### Example Response { "results": [ { "id": ocs_tier_id, "number": 1, "ocs": ocs_num } ], "next_page": null } --- ## Endpoint: `/api/ocs-tier/{ocs_id}/` **Method**: GET **Description**: Retrieve details of a specific on-call schedule tier by ID. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |id|string|Yes|Unique identifier for the on-call schedule tier|12345| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer| ### Example Response { "id": ocs_id, "ocs_name": "<OCS_Name>", "contacts": [ { "id": <Contact_id>, ... CONTACTS INFO... } ], ... INFO SUCH AS: ACTIVE,CREATION DATE, SCHEDULE, NEXT CONATCT, etc ... } --- ## Endpoint: `/api/ocs-tier/{ocs_tier_id}/` **Method**: PUT **Description**: Update details of a specific on-call schedule tier by ID. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |id|string|Yes|Unique identifier for the on-call schedule tier|12345| ### Headers | Header | Type | Required | Description | Example Value | | ------------- | ------ | -------- | ------------------------------- | ------------- | | Authorization | string | Yes | Bearer token for authentication | Bearer | ### Request Body { "number": {number}, "ocs": {ocs_number}, "layers": [] } ### Example Response `The details inserted (payload).` --- ## Endpoint: `/api/ocs-tier/{TIER_ID}/` **Method**: PATCH **Description**: Change a specific on-call schedule tier by ID. ### Parameters | Parameter | Type | Required | Description | Example Value | | --------- | ------ | -------- | ----------------------------------------------- | ------------- | | TIER_ID | string | Yes | Unique identifier for the on-call schedule tier | 12345 | ###### Note: There are two options for the TIER_ID representation: 1. {OCS_ID} _ {TIER_NUM} 2. Getting TIER_ID directly from this [[#Endpoint `/api/ocs-tier/{ocs_id}/`]] ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer| ### Example Payload { "on_demand": [], "layers": [ { "start": "STARTDATE", "rotation": "{\"type\":\"daily\"}", "restrictions": "null", "contacts": [ ...CONTACT_ID_... ], "index": 0, "tz": "TIMEZONE" } ], "dirty": true } ### Example Response { "id": {TIER_ID}, "number": {TIER_NUM}, "ocs": {OCS_ID} } --- ## Endpoint: `/api/ocs-tier/{id}/compute_tier/` **Method**: POST **Description**: Activate the on-call schedule update window for a specific tier, triggered when clicking on another tier or "summary view." ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |id|string|Yes|Unique identifier for the on-call schedule tier|12345| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer| ### Request Body { "on_demand": [], "layers": [ { "start": "STARTDATE", "rotation": "{\"type\":\"daily\"}", "restrictions": "null", "contacts": [ ...CONTACT_ID_... ], "index": 0, "tz": "TIMEZONE" } ], "dirty": true } ### Example Response [ [ { "s": "2025-01-11T16:37:23Z", "e": "2025-03-12T16:37:23Z", "c": ...CONTACT_ID_..., "i": 0 } ], [ [ { "c": ...CONTACT_ID_..., "s": "2024-11-05T13:00:00Z", "e": "2025-03-12T16:37:23Z", "o": null } ] ], [] ] **Letters meaning:** s - start time , e - end time , c - contacts , o - override , i - id --- ## Endpoint: `/api/ocs-tier/count/` **Method**: GET **Description**: Retrieve the total count of on-call schedule tiers. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |None|-|-|No parameters required|-| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer| ### Example Response { "count": <Count_Number> } --- ## Endpoint: `/api/ocs/{id}/` **Method**: GET **Description**: Triggered during a click on any on-call schedule from the list. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |id|string|Yes|Unique identifier for the on-call schedule|12345| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer| ### Example Response { "id": 328, "user": { "username": "Monica", ... USER DETAILS ... }, "updated_by": { "username": "Monica", ... USER DETAILS ... }, "schedules": [ [ [ { ... USER DETAILS ... } ], ], ], "contacts": [ ... CONTACTS DETAILS ... ], ... MORE DETAILS ABOUT THE OCS ... } --- ## Endpoint: `/api/ocs/{id}/` **Method**: PUT **Description**: Update details of a specific on-call schedule by ID. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |id|string|Yes|Unique identifier for the on-call schedule|12345| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer| ### Request Body { "customer": {customer_id}, "name": "{name}", "default_email": "{email_address}", "default_phone": null } ### Example Response `The details inserted (payload). --- ## Endpoint: `/api/ocs/{id}/` **Method**: DELETE **Description**: Delete a specific on-call schedule by ID. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |id|string|Yes|Unique identifier for the on-call schedule|12345| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer| ### Example Response `1` `This response means that the request has succeeded` --- ### Endpoint: /api/ocs/{id}/stats/ **Method**: GET **Description**: Retrieve statistics for a specific on-call schedule by ID. #### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |id|integer|Yes|Unique identifier for the on-call schedule|328| |format|string|No|Specifies the response format|json| |limit|integer|No|Number of results to return per page|5| |ordering|string|No|Specifies the sorting order|-shifts| |page|integer|No|The page number for pagination|1| |timeframe|integer|No|The timeframe in days for the data|7| #### Headers | | | | | | |---|---|---|---|---| |Header|Type|Required|Description|Example Value| |Authorization|string|Yes|Bearer token for authentication|Bearer| Example Response { ...ON-CALLS DETAILS... } --- ## Endpoint: `/api/ocs/count/` **Method**: GET **Description**: Triggered when creating a new schedule to retrieve the total count. ### Parameters |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |None|-|-|No parameters required|-| ### Headers |Header|Type|Required|Description|Example Value| |---|---|---|---|---| |Authorization|string|Yes|Bearer token for authentication|Bearer| ### Example Response { "count": <Count_Number> } ---