API Key Authentication
To authenticate requests to the Mimbla API, you need to include your API key in the header of each request. The API key is a unique identifier that is used to authenticate your account and authorize access to the API.
To get your API key, follow these steps:
- Log in to your Mimbla account.
- Go to the your business settings.
- Click on the API key tab.
- Click on the "Create new API key" button.
- Copy the API key and store it in a secure location.
Once you have your API key, you can include it in the header of your requests like this:
GET https://www.mimbla.com/api/v1/merchant/balance
Content-Type: application/json
MB-API-KEY: <YOUR API KEY>
Replace YOUR API KEY
with your actual API key.
YOU MUST INCLUDE THE MB-API-KEY HEADER IN EVERY REQUEST TO THE API.
If you don't include the API key in the header, your request will be rejected and you'll receive a 401 Unauthorized
response.
HTTP/1.1 401 Unauthorized
Content-Type: application/json
{
"message": "Invalid API key"
}
Now you can start making requests to the Mimbla API using your API key to authenticate and authorize your account. If you have any questions or need help with anything, please don't hesitate to contact us.
Code examples
Here is an example of how you can make a request to the Mimbla:
- PHP
- Javascript
- Ruby
- Python
- Java
- C#
- C/C++
- cURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://www.mimbla.com/api/v1/merchant/balance',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'MB-API-KEY: <YOUR API KEY>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
const axios = require('axios');
axios.get('https://www.mimbla.com/api/v1/merchant/balance', {
headers: {
'Content-Type': 'application/json',
'MB-API-KEY': '<YOUR API KEY>'
}
}).then(response => {
console.log(response.data);
}).catch(error => {
console.error(error);
});
require 'net/http'
require 'uri'
uri = URI.parse("https://www.mimbla.com/api/v1/merchant/balance")
request = Net::HTTP::Get.new(uri)
request["Content-Type"] = "application/json"
request["MB-API-KEY"] = "<YOUR API KEY>"
req_options = {
use_ssl: uri.scheme == "https",
}
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(request)
end
puts response.body
import requests
url = "https://www.mimbla.com/api/v1/merchant/balance"
headers = {
'Content-Type': 'application/json',
'MB-API-KEY': '<YOUR API KEY>'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
try {
URL url = new URL("https://www.mimbla.com/api/v1/merchant/balance");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("MB-API-KEY", "<YOUR API KEY>");
conn.setDoOutput(true);
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program {
static async Task Main(string[] args) {
using (var client = new HttpClient()) {
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Add("MB-API-KEY", "<YOUR API KEY>");
using (var response = await client.GetAsync("https://www.mimbla.com/api/v1/merchant/balance")) {
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
}
}
#include <stdio.h>
#include <curl/curl.h>
int main(void) {
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://www.mimbla.com/api/v1/merchant/balance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "MB-API-KEY: <YOUR API KEY>");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
res = curl_easy_perform(curl);
if(res != CURLE_OK) {
fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
}
curl_easy_cleanup(curl);
}
return 0;
}
curl -X GET "https://www.mimbla.com/api/v1/merchant/balance" -H "Content-Type: application/json" -H "MB-API-KEY: <YOUR API KEY>"