Note: Replace CLIENT_ID and CLIENT_SECRET with a valid data when making requests.
/tokenTo begin using the Money-Go API, you need to obtain an access token. Think of this token as a digital key that unlocks the API’s features. Follow these simple steps:
Provide Your Credentials:
You must supply your unique CLIENT_ID and CLIENT_SECRET (similar to a username and password). If you don’t have these credentials, please contact our support service at https://money-go.com/en/contacts. Send these credentials in a POST request to the /token endpoint.
Receive Your Access Token:
If your credentials are correct, the server will return an access_token. This token is your digital key that allows you to access the API.
Use the Access Token in Your Requests: For every subsequent API request, include the access token in your request headers. For example, set your header as follows:
Authorization: Bearer ACCESS_TOKEN
Replace ACCESS_TOKEN with the token you received.
POSThttps://api.money-go.com/tokenContent-Type: application/json
Note: Replace CLIENT_ID and CLIENT_SECRET with a valid data when making requests.
The following JSON body must be sent with the POST request to the /token endpoint:
{ "grant_type": "client_credentials", "client_id": "CLIENT_ID", "client_secret": "CLIENT_SECRET", "scope": "api"}| Field | Type | Description |
|---|---|---|
| grant_type | string | The OAuth grant type. This must be set to "client_credentials". |
| client_id | string | Your unique client identifier provided by the API. |
| client_secret | string | Your unique client secret provided by the API. |
| scope | string | The scope of the access request (e.g., "api"). |
curl -X POST "https://api.money-go.com/token" \-H "Content-Type: application/json" \-d '{ "grant_type": "client_credentials", "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET", "scope": "api"}'<?php
$url = "https://api.money-go.com/token";$data = [ "grant_type" => "client_credentials", "client_id" => "YOUR_CLIENT_ID", "client_secret" => "YOUR_CLIENT_SECRET", "scope" => "api"];
$options = [ 'http' => [ 'header' => "Content-Type: application/json", 'method' => 'POST', 'content' => json_encode($data), ],];
$context = stream_context_create($options);$result = file_get_contents($url, false, $context);
if ($result === FALSE) { die('Error occurred while fetching token');}$response = json_decode($result, true);print_r($response);// TypeScript example using the fetch API to obtain an access token.
import fetch from 'node-fetch';
async function getAccessToken(): Promise<void> {const url = "https://api.money-go.com/token";const requestBody = { grant_type: "client_credentials", client_id: "YOUR_CLIENT_ID", client_secret: "YOUR_CLIENT_SECRET", scope: "api"};
try { const response = await fetch(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(requestBody) });
if (!response.ok) { throw new Error(`HTTP error! Status: ${response.status}`); }
const data = await response.json(); console.log("Access Token:", data.access_token);} catch (error) { console.error("Error fetching access token:", error);}}
getAccessToken();A successful response (HTTP 200) will return a JSON object with the following structure:
{ "token_type": "Bearer", "expires_in": 2592000, "access_token": ""}The token endpoint returns a JSON object with the following properties:
| Field | Type | Description |
|---|---|---|
| token_type | string | Indicates the type of token provided. Typically, this value is “Bearer”. |
| expires_in | number | Specifies the lifetime of the access token in seconds. For example, 2592000 seconds equals 30 days. |
| access_token | string | The actual token that must be included in the Authorization header for all subsequent API requests. |