Authentication
How to access API files
Each request must have an authentication bearer token within the request header
we split our API files in 2 categories:
1- Public Pages: any one can explore these pages as it doesn't have any private or sensitive data, such as: about us, terms and conditions, registration and login pages, brands and categories, products list.
2- Private Pages: contains private or sensitive data such as: user profile, user orders, payment history, user address.
Public Pages
To access the public pages, send the API Key as the Authentication Bearer Token within each request as following:
// sample code
$authorization = "Authorization: Bearer ".$api_key;
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization ));
Private Pages
To access the private pages, you have to authinticate the user first by submitting his Username & Password to authorize_private.php, response will contain the User ID and the private access token, which you are going to send after that within each request to the private pages.
// sample code
$authorization = "Authorization: Bearer ".$access_token;
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization ));
Last updated
Was this helpful?