Authentication
This page describes authenticating your subscription in order to use the API
The My Buggy My Car API uses Basic authentication and utilises your Subscription ID as a username equivalent and API Key as a password equivalent. The client should send an HTTP request with the Authorization
header that contains the word Basic followed by a space and a base64-encoded string subscription_id:api_key. For example, to authorise as demo : p@55w0rd
the client would send
Authorization: Basic ZGVtbzpwQDU1d29yZA==
If you're not familiar with generating a base64-encoded string, we can recommend the use of website https://www.base64encode.org.
The My Buggy My Car API requires the Authorization
header is sent with all API requests to the server or a 403 error will be returned.
You must replace ZGVtbzpwQDU1d29yZA==
with your personal Base64 encoded Subscription ID and API Key.
To authorise, you're welcome to use this sample code:
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.mybuggymycar.com/API_ENDPOINT_HERE');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Basic YOUR_BASE64_KEY'
));
Make sure to replace
API_ENDPOINT_HERE
with the appropriate query andYOUR_BASE64_KEY
with your API key.
Last updated