Our API gateway uses Basic Authentication to ensure secure access to the Communication and Payments APIs. Authentication requires using the consumer key and consumer secret as encoded credentials. To begin, you can register or generate new API credentials via your developer account.
Basic Authentication is a simple, built-in HTTP authentication scheme. The client sends requests containing an Authorization header with the word Basic, followed by a space and a base64-encoded string of your consumerKey:consumerSecret. Here’s an example of what the Authorization header looks like:
Authorization: Basic dG9wc2VjcmV0OjEyMzQ=
admin
and your consumerSecret is admin
, the resulting string would be admin:admin
.Authorization: Basic YWRtaW46YWRtaW4=
.To generate base64-encoded Authorization headers in various programming languages, refer to this GitHub Gist.
<?php // Credentials from your developer account $consumerKey = "568473daf6614cb196caeb5f8805985f"; $consumerSecret = "5a07f41de16e40e4b08b4001142a5a10"; $auth = base64_encode($consumerKey . ":" . $consumerSecret); // Pass the standard request headers. curl_setopt($curl, CURLOPT_HTTPHEADER, array("Authorization: Basic $auth", "Accept: application/json", "Content-Type: application/json"));
Security Note: Since base64 encoding can be easily decoded, it’s highly recommended that you use Basic Authentication together with secure communication protocols such as HTTPS/SSL to ensure data protection.
When new API credentials are generated, your old credentials will no longer be valid. Make sure to securely store the new credentials as they will not be shown again on the dashboard for security reasons. In case you lose them, you’ll need to generate new credentials.
Important: Treat your API credentials like passwords. If you suspect that your credentials may have been compromised, generate new API credentials immediately.