Checking API connectivity

To check connectivity, and get the latest version of the API, use the /api/v1/Metadata/Version endpoint.

The following code snippets should help get you started on a variety of platforms:

curl <<SANDBOX_URL>>metadata/version
using System.Net.Http.Json;

const string url = "<<SANDBOX_URL>>metadata/version";

var client = new HttpClient();

try
{
    var response = await client.GetAsync(url);
    if (response.IsSuccessStatusCode)
    {
        // returns MoneyMoov api version object
        var apiVersion = await response.Content.ReadFromJsonAsync<ApiVersion>();
        if (apiVersion != null)
        {
            Console.WriteLine(apiVersion);
        }
    }
    else
    {
        // HTTP error codes will return a MoneyMoov API problem object
        Console.WriteLine(await response.Content.ReadFromJsonAsync<ApiProblem>());
    }
}
catch (Exception e)
{
    Console.WriteLine($"Error: {e.Message}");
}

// Type definitions for returned data
record ApiVersion(int majorVersion, int minorVersion, int buildVersion, string releaseName);
record ApiProblem(string type, string title, int status, string detail);
// These packages allow the script to run on node.js, they are not required for browser use.
const fetch = require('cross-fetch');

const options = { method: 'GET', headers: { Accept: 'application/json' } };

fetch('<<SANDBOX_URL>>metadata/version', options)
    .then(response => response.json())
    // JSON object with API version details should appear in console
    .then(responseJson => console.log(responseJson))
    .catch(err => console.error(err));
# The 'requests' library for Python can be used to make calls to the MoneyMoov API in
# popular python frameworks such as Django and Flask.

import requests

baseUrl = "<<SANDBOX_URL>>metadata/version"

headers = {
    "Accept": "application/json"
}

response = requests.request("GET", baseUrl, headers=headers)

# The response json contains the API Version details
print(response.json())