Retrieve Current Config File Via REST API
Use this REST call to get your current configuration file from your Mona account.
This can be done by leveraging the /configs 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/configs' \
--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/configs"
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)
from mona_sdk.client import Client
api_key = <YOUR-API-KEY>
secret = <YOUR-SECRET>
my_mona_client = Client(api_key, secret)
my_mona_client.get_config()
Updated over 2 years ago