Skip to main content

API Usage

ChannelApe provides a wide range of APIs that allow for platform extension and integration with other systems and platforms.

Available APIs

REST API V1

Our initial API which is being deprecated by our REST API V2 and GraphQL API. There are a few endpoints that only exist on the V1 REST API awaiting migration to the new API. You can find the API Reference here.

REST API V2 and GraphQL API

Our latest APIs which are accessible via REST or GraphQL. We are actively working on adding support for all endpoints within REST API V1. You can find the API reference for the REST API V2 here. and the API reference for the GraphQL API here.

Authentication

Authorization Headers

Authorization - A valid JWT associated with your username or api account.

apikey - A valid api key. This header should be present on every request.

The API works through a mixture of JWT and Key auth.

If no Authorization header is included, the API will assume that you are making a request with an anonymous user.

If an Authorization header is included, the API will "switch" to the role of the user or api account making the request.

  • ANON_KEY - The public API key shared by all users. Required by all API calls.
  • YOUR_KEY - The JSON Web Token (JWT) associated with your username or api account. Required to call any APIs specific to a business.

Example request:

curl 'https://api.channelape.io/rest/v1/webhook_actions' \
-H "apikey: ANON_KEY" \
-H "Authorization: Bearer YOUR_KEY"

Creating an API Account

You can create an API account to access your businesses resources across ChannelApe API's. To do this, you need be the owner of the business. Run the following command:

curl 'https://api.channelape.io/rest/v1/rpc/create_api_account' \
-d '{ "business_id": "c8c6bcfa-f544-4680-bbf3-7d93aee95efa", "name": "My API Account" }' \
-H "apikey: ANON_KEY" \
-H "Content-Type: application/vnd.pgrst.object+json" \
-H "Authorization: Bearer YOUR_KEY"

This will create your API account private key. Note, that this is only shown once, so ensure you save it. Once you have your API secret you can 'login' with your API account. This essentially generates a short-lived (4 hour) JWT that can be used like any other JWT in the system.

Example login request:

curl -X POST 'https://api.channelape.io/rest/v1/rpc/login_api_account' \
-d '{ "account_id": "value", "secret": "value" }' \
-H "Content-Type: application/json" \
-H "apikey: ANON_KEY" \

JSON Web Tokens (JWTs)

JWTs expire after a certain amount of time and need to be refreshed before they expire. If you need require long term API Access and are unable to refresh your JWT regularly please email support@channelape.com.

Rate Limiting

API users are restricted to a rate limit. ChannelApe businesses have a default limit of 5 requests per second across all of the API Accounts of a business. When a request is rate limited, a 429 level status code will be returned. If you need an increased rate limit, please email support@channelape.com.