### Authenticate with API Key Source: https://api-docs.pureservice.com/ Example of making a GET request using an API key for authentication. ```http GET /api/status HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json X-Authorization-Key: YOUR_TOKEN ``` -------------------------------- ### Paging Entities Source: https://api-docs.pureservice.com/ Implements pagination for entity retrieval using `start` and `limit` query parameters. ```APIDOC ## Paging Entities ### Description Use `start` and `limit` query parameters for paging. ### Query Parameters - **start** (integer) - Optional - The starting index for the page. - **limit** (integer) - Optional - The number of items to return per page. ### Request Example ```http GET /api/status/?start=0&limit=10 HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` ``` -------------------------------- ### Fetch Single Entity by ID Source: https://api-docs.pureservice.com/ Example of fetching a single entity by its ID using a Bearer token for authentication. ```http GET /api/status/1 HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` -------------------------------- ### Get All Entities by Type Source: https://api-docs.pureservice.com/ Retrieves a list of entities of a specific type. Note: Maximum 500 items per request. Use paging for more. ```http GET /api/status/ HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` -------------------------------- ### Paging Results Source: https://api-docs.pureservice.com/ Retrieves a paginated list of entities by specifying the start index and limit. ```http GET /api/status/?start=0&limit=10 HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` -------------------------------- ### Get All Entities by Type Source: https://api-docs.pureservice.com/ Retrieves a list of entities of a specific type. Supports paging and includes notes on request limits. ```APIDOC ## GET /api/status/ ### Description Retrieves a list of entities of a specific type. Maximum 500 items per request. Use paging for more. ### Method GET ### Endpoint /api/status/ ### Query Parameters - **start** (integer) - Optional - The starting index for pagination. - **limit** (integer) - Optional - The maximum number of items to return per page. - **include** (string) - Optional - Comma-separated list of related entities to include in the response (e.g., `requesttype,createdBy`). ### Request Example ```http GET /api/status/ HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` ### Response #### Success Response (200) - **data** (array) - Array of entity objects. - **links** (object) - Pagination links. #### Response Example ```json { "data": [ { "id": "1", "type": "status", "attributes": { "name": "Open" } } ], "links": { "self": "/api/status/?start=0&limit=10", "next": "/api/status/?start=10&limit=10" } } ``` ``` -------------------------------- ### Handle Rate Limit Exceeded Source: https://api-docs.pureservice.com/ Response example when the rate limit is exceeded, indicating a '429 Too Many Requests' status. ```http HTTP/1.1 429 Too Many Requests Content-Type: application/json Retry-After: 15 ``` -------------------------------- ### Get Multiple Entities by IDs Source: https://api-docs.pureservice.com/ Retrieves multiple entities by specifying their IDs in the request. ```http GET /api/status/?ids=1,5 HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` -------------------------------- ### Rate Limit Exceeded Source: https://api-docs.pureservice.com/ Example response when the API rate limit is exceeded. Includes status code and potential retry information. ```APIDOC ## Rate Limit Exceeded ### Description This response is returned when the client exceeds the allowed number of requests per minute. ### Response Example ```http HTTP/1.1 429 Too Many Requests Content-Type: application/json Retry-After: 15 ``` ``` -------------------------------- ### Validation Error Response Source: https://api-docs.pureservice.com/ Example of a validation error response, returned as an array of error objects. ```http HTTP/1.1 400 Bad Request Content-Type: application/json { "errors": [{ "message": "SomeFieldOne : SomeFieldOne is required." }] } ``` -------------------------------- ### Get Multiple Entities by IDs Source: https://api-docs.pureservice.com/ Retrieves multiple entities by specifying their IDs in the query parameter. ```APIDOC ## GET /api/status/?ids=... ### Description Retrieves multiple entities by specifying their IDs in the query parameter. ### Method GET ### Endpoint /api/status/ ### Query Parameters - **ids** (string) - Required - Comma-separated list of entity IDs (e.g., `1,5`). ### Request Example ```http GET /api/status/?ids=1,5 HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` ### Response #### Success Response (200) - **data** (array) - Array of entity objects matching the provided IDs. #### Response Example ```json { "data": [ { "id": "1", "type": "status", "attributes": { "name": "Open" } }, { "id": "5", "type": "status", "attributes": { "name": "Closed" } } ] } ``` ``` -------------------------------- ### Get a Single Entity by ID Source: https://api-docs.pureservice.com/ Retrieves a specific entity using its unique identifier. Supports fetching via path parameter or query parameter. ```APIDOC ## Get a Single Entity by ID ### Description Fetches a single entity by its ID. You can use either a path parameter or a query parameter for the ID. ### Method GET ### Endpoint /api/status/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the entity. #### Query Parameters - **id** (integer) - Required - The unique identifier of the entity. ### Request Example (Path Parameter) ```http GET /api/status/1 HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` ### Request Example (Query Parameter) ```http GET /api/status?id=1 HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` ``` -------------------------------- ### API Key Authentication Source: https://api-docs.pureservice.com/ Demonstrates how to authenticate API requests using an API key. This method is recommended for third-party integrations. ```APIDOC ## API Key Authentication ### Description API keys allow integration with third-party services and are managed via the Pureservice web interface. Keep keys confidential and rotate regularly. ### Method GET ### Endpoint /api/status ### Request Example ```http GET /api/status HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json X-Authorization-Key: YOUR_TOKEN ``` ``` -------------------------------- ### Set Content Negotiation Headers Source: https://api-docs.pureservice.com/ Use these headers to ensure JSON:API-compliant communication with the API. ```http Accept: application/vnd.api+json Content-Type: application/vnd.api+json ``` -------------------------------- ### Create a Ticket Source: https://api-docs.pureservice.com/ Creates a new ticket by sending a POST request with the ticket payload. ```http POST /api/ticket HTTP/1.1 Host: customer.pureservice.com Content-Type: application/vnd.api+json Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN { ...payload... } ``` -------------------------------- ### Create Entity Source: https://api-docs.pureservice.com/ Creates a new entity. Requires a payload containing the entity's data. ```APIDOC ## POST /api/ticket ### Description Creates a new entity, such as a ticket. Requires a payload containing the entity's data. ### Method POST ### Endpoint /api/ticket ### Request Body - **payload** (object) - Required - The data for the new entity. ### Request Example ```http POST /api/ticket HTTP/1.1 Host: customer.pureservice.com Content-Type: application/vnd.api+json Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN { ...payload... } ``` ### Response #### Success Response (201) - **data** (object) - The newly created entity object. #### Response Example ```json { "data": { "id": "123", "type": "ticket", "attributes": { "subject": "New ticket created", "status": "Open" } } } ``` ``` -------------------------------- ### Content Negotiation Headers Source: https://api-docs.pureservice.com/ Specifies the required headers for JSON:API-compliant communication. ```APIDOC ## Content Negotiation ### Description To ensure JSON:API-compliant communication, set the following headers for your requests. ### Headers - **Accept:** `application/vnd.api+json` - **Content-Type:** `application/vnd.api+json` (for requests with a payload) ### Request Example ```http Accept: application/vnd.api+json Content-Type: application/vnd.api+json ``` ``` -------------------------------- ### Fetch Single Entity by Query Parameter Source: https://api-docs.pureservice.com/ Alternative method to fetch a single entity by ID using a query parameter, authenticated with a Bearer token. ```http GET /api/status?id=1 HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` -------------------------------- ### Full Update (PUT) a Ticket Source: https://api-docs.pureservice.com/ Performs a full update on a ticket. Missing properties will be reset to their default values. ```http PUT /api/ticket/10 HTTP/1.1 Host: customer.pureservice.com Content-Type: application/vnd.api+json Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN { "tickets": [ { "subject": "Updated summary", ... } ] } ``` -------------------------------- ### Static Values Source: https://api-docs.pureservice.com/ Lists static enumerated values used across the Pureservice API for roles, visibility, phone types, and announcement types. ```APIDOC # Static Values ## UserRole | Name | Value | |---|---| | None | `0` | | PendingActivate | `1` | | LocationPendingActivate | `2` | | Enduser | `10` | | Agent | `20` | | ZoneAdmin | `25` | | Administrator | `30` | | System | `50` | ## Visibility | Name | Value | |---|---| | Visible | `0` | | VisibleSilent | `1` | | NotVisible | `2` | ## PhonenumberType | Name | Value | |---|---| | Home | `0` | | Cellphone | `1` | ## AnnouncementType | Name | Value | |---|---| | Information | `0` | | Warning | `1` | | Critical | `2` | ``` -------------------------------- ### Update Entity (PUT/PATCH) Source: https://api-docs.pureservice.com/ Updates an existing entity. PUT performs a full update, while PATCH performs a partial update. ```APIDOC ## PUT /api/ticket/{id} ## PATCH /api/ticket/{id} ### Description Updates an existing entity. `PUT` performs a full update (missing properties are reset to default), while `PATCH` performs a partial update (only specified properties are updated). `PATCH` is recommended. ### Method PUT or PATCH ### Endpoint /api/ticket/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the entity to update. ### Request Body - **field** (type) - Required/Optional - Description of the field to update. ### Request Example (PATCH) ```http PATCH /api/ticket/10 HTTP/1.1 Host: customer.pureservice.com Content-Type: application/json Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN { "subject": "Updated subject" } ``` ### Request Example (PUT) ```http PUT /api/ticket/10 HTTP/1.1 Host: customer.pureservice.com Content-Type: application/vnd.api+json Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN { "tickets": [ { "subject": "Updated summary", "status": "Closed" } ] } ``` ### Response #### Success Response (200) - **data** (object) - The updated entity object. #### Response Example ```json { "data": { "id": "10", "type": "ticket", "attributes": { "subject": "Updated subject", "status": "Open" } } } ``` ``` -------------------------------- ### Zone Security Source: https://api-docs.pureservice.com/ Details on zone security features, including requirements for `department` and `assignedDepartment` properties. ```APIDOC # Zone Security (If Applicable) ### Description If your Pureservice instance uses **zone-security features**, note the following: - Entities with a `department` or `assignedDepartment` property must have a non-null value. - Entities restricted by a zone must be explicitly assigned to a zone. - The property is called `department` in the API for backward compatibility, but is displayed as `zone` in the UI. - Missing or invalid zone fields result in a `400 Bad Request`. ### Error Handling - **400 Bad Request**: Missing or invalid zone fields. ``` -------------------------------- ### Sorting Entities Source: https://api-docs.pureservice.com/ Sorts entities based on specified fields in ascending or descending order. ```APIDOC ## Sorting Entities ### Description Use the `sort` query parameter to sort results. ### Query Parameters - **sort** (string) - Optional - The sorting criteria. Examples: - `fieldName asc` (for ascending order) - `field1 asc,field2 desc` (for multiple fields) - Default direction is ascending. ### Request Example ```http GET /api/status/?sort=name%20asc,createdAt%20desc HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` ``` -------------------------------- ### Include Related Entities Source: https://api-docs.pureservice.com/ Retrieves entities and includes specified related entities in the response. ```http GET /api/status/?include=requesttype,createdBy HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` -------------------------------- ### Partial Update (PATCH) a Ticket Source: https://api-docs.pureservice.com/ Partially updates an existing ticket by specifying only the properties to be changed. ```http PATCH /api/ticket/10 HTTP/1.1 Host: customer.pureservice.com Content-Type: application/json Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN { "subject": "..." } ``` -------------------------------- ### Filtering Entities Source: https://api-docs.pureservice.com/ Filters entities using the `filter` query parameter with various operators and logical combinations. ```APIDOC ## Filtering Entities ### Description Use the `filter` query parameter to filter entities. Supports logical operators (`AND`, `OR`) and standard operators. ### Query Parameters - **filter** (string) - Optional - The filter expression. Examples: - `name == "Closed"` - `default == true AND name == "Open"` - `name == "Closed" OR (default == true AND name == "Open")` ### Supported Operators | Operator Type | Syntax | Example | |---|---|---| | 🟰 Equals | `==` | `status == "Closed"` | | 🔼 Less than | `>` | `index > 1` | | 🔽 Greater than | `<` | `index < 5` | | 🔎 Contains | `[Property].Contains([Value])` | `name.Contains("Open")` | | ✔️ Boolean | `[Property] == true/false` | `default == true` | | ➕ AND | `AND / &&` | `name == "Open" AND default == true` | | ➖ OR | `OR / ||` | `name == "Closed" OR default == true` | ### Request Example ```http GET /api/status/?filter=name%20%3D%3D%20%22Open%22%20AND%20default%20%3D%3D%20true HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` ``` -------------------------------- ### Including Related Entities Source: https://api-docs.pureservice.com/ Includes related entities in the API response using the `include` query parameter. ```APIDOC ## Including Related Entities ### Description Use the `include` parameter to include related entities in the response. ### Query Parameters - **include** (string) - Optional - Comma-separated list of related entities to include (e.g., `requesttype,createdBy`). ### Request Example ```http GET /api/status/?include=requesttype,createdBy HTTP/1.1 Host: customer.pureservice.com Accept: application/vnd.api+json Authorization: Bearer YOUR_TOKEN ``` ``` -------------------------------- ### Validation Errors Source: https://api-docs.pureservice.com/ Describes the format of validation error responses from the API. ```APIDOC # Validation Errors ### Description Validation errors are returned as an array of error objects under the `errors` property. ### Response Example (400 Bad Request) ```http HTTP/1.1 400 Bad Request Content-Type: application/json { "errors": [ { "message": "SomeFieldOne : SomeFieldOne is required." } ] } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.