Public
Documentation Settings

Channex API v.1.0

Documentation for Channex HTTP JSON-based API version 1.0

If you have any comments, suggestions or recomendations, please let us know via andrew@channex.io

API Reference

The Channex.io API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application. JSON is returned by all API responses, including errors.

API support GET, POST, PUT and DELETE queries.

Each response is valid JSON object and MUST contain at least one key: error, meta or data.

If response has success status, it MUST contain data or meta key at response object.

data object CAN be an Object or Array of Objects.

Each data object contain type and attributes keys with response object defenition.

Plain Text
{
    "meta": {
        "message": "Human readability message"
    },
    "data": {
        "type": "session",
        "attributes": {
            "token": "Bearer Access Token",
            "email": "test@test.com"
        }
    }
}

Each POST or PUT query MUST conatin a valid JSON Object and use type of passed object as key for data.

Plain Text
{
    "user": {
        "email": "test@test.com"
    }
}

Where user is type of passed entity.

Authentication

Channex.io api-key authentication method.

Provide your API Key at request Headers under user-api-key key.

How to get API Key, please read here: https://docs.channex.io/api-v.1-documentation/api-key-access#setup-an-api-key.

Errors

Channex.io uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Channex.io servers.

Each error response MUST include errors Object with error details.

Plain Text
{
    "errors": {
        "details": {
            "is_active": [
                "can't be blank"
            ]
        },
        "code": "validation_error",
        "title": "Validation Error"
    }
}

Status Codes

200 OK Success Response

400 Bad Request The request was unacceptable, often due to missing a required parameter.

401 Unauthorized No valid Bearer token provided.

403 Forbidden Access forbidden.

404 Not Found The requested resource doesn't exist.

422 Unprocessable Entity Validation Error.

Filtering data arguments

API support filtering queries.

Basic query:

Plain Text
/api/COLLECTION_NAME/?filter[property_id]=PROPERTY_ID

Multiple values:

Plain Text
/api/COLLECTION_NAME/?filter[proeprty_id]=PROPERTY_ID1,PROPERTY_ID2

Multiple fields:

Plain Text
/api/COLLECTION_NAME/?filter[property_id]=PROPERTY_ID&filter[room_type_id]=ROOM_TYPE_ID

Comparison operations:

Plain Text
/api/COLLECTION_NAME/?filter[property_id]=PROPERTY_ID&filter[date][gte]=DATE_FROM&filter[date][lte]=DATE_TO

Supported coparison operators:

  • gt (greater than)
  • gte (greater than or equal)
  • lt (less than)
  • lte (less than or equal)
  • eq (equal to) default operation if you pass value after = symbol
  • not (not equal to)
AUTHORIZATIONAPI Key
Key

user-api-key

Value

YOUR_API_KEY_HERE

Loading