Base URL

This page provides a comprehensive guide on how to use the base URL for making API requests, including examples for both GET and POST requests with JSON data.

Base URL

All API requests for the B-MO service must be made using the following base URL:

https://svc.test.bestcash.me/external

This base URL is used to access all the available resources within the B-MO API. When constructing your API requests, append the specific endpoint path to this base URL.

Input Data

  • URL Parameters: Input data can be transmitted as URL parameters.
  • JSON Body: Alternatively, input data can be sent as a JSON object in the body of the request.

Output Data

The output data from the API will always be in JSON format, making it easy to parse and handle in your application.

Example Request

Here’s an example of how to make a GET request using the base URL and sending input data as URL parameters:

import axios from 'axios';

const apiKey = 'your-api-key';
const apiSecret = 'your-api-secret';

axios.get('https://svc.test.bestcash.me/external/v1/resource', {
  headers: {
    'X-Auth-ApiKey': apiKey,
    'X-Auth-ApiSecret': apiSecret
  },
  params: {
    // params here
  }
})
.then(response => {
  console.log('Output Data:', response.data);
})
.catch(error => {
  console.error('An error occurred:', error.message);
});

Example POST Request

Here’s an example of how to make a POST request using the base URL and sending input data as a JSON object in the body:


import axios from 'axios';

const apiKey = 'your-api-key';
const apiSecret = 'your-api-secret';

const requestData = {
  // data here
};

axios.post('https://svc.test.bestcash.me/external/v1/resource', requestData, {
  headers: {
    'X-Auth-ApiKey': apiKey,
    'X-Auth-ApiSecret': apiSecret,
    'Content-Type': 'application/json'
  }
})
.then(response => {
  console.log('Output Data:', response.data);
})
.catch(error => {
  console.error('An error occurred:', error.message);
});

Summary

  1. Base URL: All requests should use https://svc.test.bestcash.me/external.

  2. Input Data: Can be sent via URL parameters or as a JSON object in the request body.

  3. Output Data: The API returns data in JSON format, ensuring consistency and ease of integration.