In this article we'll cover how to generate keys and API key permissions work, and frequently asked questions about how to use the API.
For the latest endpoint details, please find our Swagger documentation here.
- Generating API Keys
- API Key Permissions
- Number of API Keys Per Account
- Frequently Asked Questions
- API Documentation
Generating API Keys
To generate API Keys navigate to Admin > API and select "Generate Key":
API Key Permissions
API Key permissions will mirror the user permission group assigned to the user who generated the key.
Users who only have access to view specific brands in Canix will only see those brands reflected in the inventory endpoints.
Number of API Keys per Account
Each Company account can have 10 active API keys in total.
Frequently Asked Questions
How can I paginate results?
Our API endpoints return up to 2000 objects at a time. To paginate, call the first 2000 (or fewer rows) and then call the next set using an offset. For example:
Call #1: /api/v1/sales_orders
Call #2: /api/v1/sales_orders?offset=2000
How can I filter results?
API results can be filtered using a where clause, for example the following syntax can be used to filter the data on a specific facility_id:
/api/v1/customers?where=facility_id=110
Filtering can be expanded to include additional parameters, for example:
/api/v1/packages?where=status='Available To Sell'&facility_id=110
How can I sort the results?
API results can be sorted by using the order_by query variable set to the object and a property_name of that object, and the direction, either ascending (asc) or descending (desc).
Here is the template for using the order_by query variable in your API requests:order_by={object.property_name}%20[desc|asc]
Working example of using the order_by query variable to GET Harvests (list) with the results sorted ascending by the harvest date property, and limited to twenty (20) rows in the result set:
curl -X 'GET' \
'https://api.canix.com/api/v1/harvests?limit=20&order_by=date%20desc' \
-H 'accept: application/json' \
-H 'X-API-KEY: b94b55a66ad64a1a8870a901989e01411ae4f72d421d4e96803f02fc5929b3e5'Sometimes results are not being fully returned, what should I do?
Use limits to restrict the scope of the call and improve performance, for example:/api/v1/sales_orders?limit=500
API Documentation
You can find Canix's API documentation here:
https://entrc.github.io/entrc-backend/engineering/api/#/