Introduction
Welcome to the Cannareviews API! This documentation will help you get started with setting up access and making your first requests.
Request API Access
Before using the API, you must request access and obtain an API_TOKEN.
Contact your administrator to enable API access for your account and provide the required credentials.
Authentication
The Cannareviews API uses Bearer Token authentication. You must include this token in the
Authorization header of every API request.
Example request
--header 'accept: application/json' \
--header 'Authorization: Bearer {API_TOKEN}'
- Keep your API token confidential. Do not share or expose it publicly.
- Avoid using tokens in client-side JavaScript or frontend frameworks.
- If compromised, request the token to be revoked and regenerated.
Token Expiry: Your token may expire based on server settings. If your request returns a
401 Unauthorized error, verify the token’s validity and request a new one if needed.
If your API request is rejected due to insufficient permissions, you may receive the following response:
This 403 Forbidden error means your token is valid, but your user account is not authorized to
perform the action or access the resource.
How to resolve:
- Ensure your
Authorizationheader includes a valid Bearer token. - Contact the administrator to confirm your API access is fully enabled.
- Specify the endpoints or actions you need access to so appropriate permissions can be granted.
- Retry your request after your access has been updated.
Quick Start Example
--header 'accept: application/json' \
--header 'Authorization: Bearer {API_TOKEN}
Authenticating requests
To authenticate requests, include an Authorization header with the value
"Bearer {API_TOKEN}".
All authenticated endpoints are marked with a requires authentication badge in the documentation
below.
The Cannareviews API uses Bearer Token authentication. You must include this token in the Authorization header of every API request.
Endpoints
GET api/v2/products
requires authentication
Example request:
curl --request GET \
--get "https://cannareviews.health/api/v2/products" \
--header "Authorization: Bearer {API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"$client = new \GuzzleHttp\Client();
$url = 'https://cannareviews.health/api/v2/products';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://cannareviews.health/api/v2/products"
);
const headers = {
"Authorization": "Bearer {API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());import requests
import json
url = 'https://cannareviews.health/api/v2/products'
headers = {
'Authorization': 'Bearer {API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"products": {
"current_page": integer,
"data": [
{
"id": integer,
"slug": string,
"brand": string,
"name": string,
"description": string,
"cultivar": string,
"total_cannabinoids": string,
"size": string,
"price_per_mg": string,
"RRP": string,
"lowest_price": string,
"concession_price": string|null,
"THC_content": string,
"CBD_content": string,
"THC_CBD_ratio": string,
"type": string,
"country": string,
"tga_category": string,
"schedule": string,
"gmp": string,
"extraction_method": string|null,
"sku_details": string|null,
"image": string,
"extra_img": string,
"other_tags": string|null,
"strength": string|null,
"carrier_oil": string|null,
"price_per_g": string|null,
"price_per_oz": string,
"attachment1": string|null,
"attachment2": string|null,
"attachment3": string|null,
"attachment4": string|null,
"attachment1_enabled": string,
"attachment2_enabled": string,
"attachment3_enabled": string,
"attachment4_enabled": string,
"category": string|null,
"status": boolean,
"review_content": string|null,
"review_rate": number,
"spectrum": string,
"dosing": string|null,
"is_verified": boolean|null,
"verified_notes": string|null,
"in_stock": string,
"stock_eta": string,
"stock_extra_info": string|null,
"stock_qty": integer|null,
"stock_details": string|null,
"is_top": integer,
"document_certificate_extra_for_users": integer,
"coa_document_enable": integer,
"terpenes_document_enable": integer,
"created_at": string (date-time),
"updated_at": string (date-time),
"carrier_oil_id": integer|null
}
],
"first_page_url": string,
"from": integer,
"last_page": integer,
"last_page_url": string,
"links": [
{
"url": string|null,
"label": string,
"active": boolean
}
],
"next_page_url": string|null,
"path": string,
"per_page": integer,
"prev_page_url": string|null,
"to": integer,
"total": integer
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.