Retrieve Config History Via REST API

For cases where users need their previous configuration files, Mona now allows users to retrieve their configuration history.

This can be done by leveraging the /get_config_history REST endpoint.

In order to do so, first of all, users must have an authorization token for their account.
More info on generating a token here.

Once users have their accessToken they can add it to their authorization and send a POST request like so:

curl --location --request POST 'https://api{YOUR-USER-ID}.monalabs.io/get_config_history' \
--header 'Authorization: Bearer {YOUR-ACCESS-TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{}'
import requests
import json

url = "https://api{YOUR-USER-ID}.monalabs.io/get_config_history"

payload = json.dumps({})
headers = {
  'Authorization: Bearer {YOUR-ACCESS-TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Possible args for this request are:

  • number_of_revisions - the number of configs to retrieve, sorted by the date they were uploaded. Default is 10 configs.

Did this page help you?