Retrieve Verses Names

Use this REST call to get the names of all configured verses in a specific stanza.

This can be done by leveraging the /get_verses_names 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 with the context_class and stanza_name as args.

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

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

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

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

print(response.text)

The response will be a JSON with all the verse names in the chosen context class

{
    "response_data": [
        "stanza_1__AverageDrift",
        "stanza_1__AverageOutlier",
        "stanza_1__AverageSuddenChange",
        "stanza_1__SegmentSizeDrift"
    ],
    "partial_data": false
}

Did this page help you?