### Install Python Client using setup.py Source: https://portal.envizage.me/quick-start/python-example Instructions to install the generated Python client by running the setup.py script. This method is used when the client files are copied locally into your project. ```python python setup.py install --user ``` -------------------------------- ### Install Python Client from Git Repository Source: https://portal.envizage.me/quick-start/python-example Alternative method to install the Python client directly from a Git repository using pip. This is useful when the package is hosted remotely. ```python pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git ``` -------------------------------- ### Install Axios HTTP Client for Node.js Source: https://portal.envizage.me/quick-start/backend-example Commands to install the Axios library, a popular promise-based HTTP client, which is essential for making API requests from the Node.js backend application. ```npm npm install axios ``` ```Yarn yarn add axios ``` -------------------------------- ### Install DotEnv Package for Node.js Source: https://portal.envizage.me/quick-start/backend-example Commands to install the DotEnv package, which allows loading environment variables from a .env file into the Node.js application's process.env object, facilitating secure management of credentials and configurations. ```npm npm install dotenv ``` ```Yarn yarn add dotenv ``` -------------------------------- ### Install Envizage SDK Dependencies Source: https://portal.envizage.me/quick-start/typescript-example This snippet provides commands to install the necessary Envizage services and model packages using npm and Yarn. These packages are required to interact with Envizage's GuestService, HttpClient, and ScenarioService, enabling actions like guest login and scenario creation. ```npm npm install @envizage/servises @envizage/model ``` ```Yarn yarn add @envizage/servises @envizage/model ``` -------------------------------- ### Example API Request with Pagination using cURL Source: https://portal.envizage.me/api-reference-introduction Demonstrates how to make a GET request to the Envizage.me API with pagination parameters (`page`, `size`, `sort`) using cURL. This example fetches the first 10 scenarios, sorted by key in ascending order. ```shell curl -X GET 'https://api.envizage.me/scenarios/?page=0&size=10&sort=key,asc' \ -H 'Authorization: Bearer {YOUR_ACCESS_TOKEN}' ``` -------------------------------- ### Envizage Authentication API (OpenID Connect) Source: https://portal.envizage.me/quick-start/backend-example API endpoints for user authentication and management, including obtaining client credentials tokens, creating new users, and getting user-specific access tokens via password grant. These endpoints typically interact with an OpenID Connect provider like Keycloak. ```APIDOC POST /realms/{realmId}/protocol/openid-connect/token (Client Credentials Grant) - Description: Obtains an access token using client credentials. - Headers: - Content-Type: application/x-www-form-urlencoded - Accept: application/json - Body Parameters (x-www-form-urlencoded): - grant_type: string (Required) - Must be 'client_credentials' - client_secret: string (Required) - The client secret. - client_id: string (Required) - The client ID. - Returns: JSON object containing 'access_token', 'expires_in', 'token_type', etc. POST /admin/realms/{realmId}/users - Description: Creates a new user in the specified realm. - Headers: - Authorization: Bearer {token} (Required) - An access token with administrative privileges. - Body Parameters (JSON): - username: string (Required) - The desired username. - email: string (Optional) - User's email address. - firstName: string (Optional) - User's first name. - lastName: string (Optional) - User's last name. - enabled: boolean (Optional) - Whether the user is enabled (default: true). - emailVerified: boolean (Optional) - Whether the user's email is verified (default: true). - credentials: array (Required) - List of user credentials. - type: string (Required) - Credential type, e.g., 'password'. - value: string (Required) - The credential value, e.g., the password. - Returns: HTTP 201 Created on success, or error details on failure. POST /realms/{realmId}/protocol/openid-connect/token (Password Grant) - Description: Obtains an access token for a specific user using their username and password. - Headers: - Content-Type: application/x-www-form-urlencoded - Accept: application/json - Body Parameters (x-www-form-urlencoded): - username: string (Required) - The user's username. - password: string (Required) - The user's password. - client_secret: string (Required) - The client secret. - client_id: string (Required) - The client ID. - grant_type: string (Required) - Must be 'password'. - Returns: JSON object containing 'access_token', 'expires_in', 'token_type', etc. ``` -------------------------------- ### Configure Envizage API Environment Variables Source: https://portal.envizage.me/quick-start/backend-example Example content for a .env file, used to store sensitive credentials and API URLs required for authenticating with the Envizage API and accessing its services. These variables include client ID, client secret, realm ID, user credentials, and API endpoints. ```env REALM_ID="" CLIENT_SECRET="" CLIENT_ID="" USERNAME="" PASSWORD="" PROVIDER_URL="https://id.production.envizage.me" API_URL="https://api.envizage.me" ``` -------------------------------- ### Example Response for Get Parents API Source: https://portal.envizage.me/quick-start/typescript-example Provides an example of the array-based JSON response when fetching parents. This indicates that the API can return multiple parent objects, each with detailed demographic and status information. ```JSON [ { description: undefined, educationLevel: 'NO_EDUCATION', expectedRetirementAge: 0, gender: 'FEMALE', healthStatus: 'CRITICALLY_ILL', id: '647f2b69d194370ba9d6b7d6', jobType: 'UNEMPLOYED', lastName: undefined, maritalStatus: 'UNSPECIFIED', name: undefined, primary: false, properties: {}, yearOfBirth: 1965 } ] ``` -------------------------------- ### Node.js Example: Programmatically Create New User (user.js) Source: https://portal.envizage.me/quick-start/backend-example This script demonstrates how to programmatically create a new user using the `getToken` and `createUser` methods imported from the `auth.js` module. It first obtains an access token using client credentials and then uses that token to register a new user with a specified username and password. ```JavaScript require('dotenv').config(); const { getToken, createUser } = require('./auth'); const clientSecret = process.env.CLIENT_SECRET; const clientId = process.env.CLIENT_ID; async function createNewUser() { try { const getTokenResponse = await getToken(clientSecret, clientId); const token = getTokenResponse?.data?.access_token; createUser('username', 'password', token) } catch (error) { console.log(error) } } createNewUser(); ``` -------------------------------- ### API Client Initialization and Configuration Source: https://portal.envizage.me/quick-start/python-example This section details the `ApiClient` class constructor and how to initialize an API client instance. It covers setting up the configuration object with the host URL and providing authentication headers. ```APIDOC class ApiClient: __init__( self, configuration: typing.Optional[Configuration] = None, header_name: typing.Optional[str] = None, header_value: typing.Optional[str] = None, cookie: typing.Optional[str] = None, pool_threads: int = 1 ): - configuration: (Required) An instance of `Configuration` to set API client options like the host URL. - header_name: (Required) The name of the HTTP header for authentication (e.g., 'Authorization'). - header_value: (Required) The value for the specified header (e.g., 'Bearer '). - cookie: Optional cookie string. - pool_threads: Number of threads for the connection pool (default: 1). Usage Example: configuration = openapi_client.Configuration( host = "https://api.envizage.me" ) auth_token = "Bearer " + "" openapi_client.ApiClient(configuration, header_name="Authorization", header_value=auth_token) ``` -------------------------------- ### Example Resource/Goal Object JSON Payload Source: https://portal.envizage.me/goals/create-goal-22 An example JSON payload demonstrating the structure and typical values for a resource or goal object. This can be used as a template for creating or updating a resource via the API. ```JSON { "currency": "GBP", "description": "My resource's description", "desiredAmount": 10000, "enabled": true, "endDate": "2026-01-01T00:00:00.000Z", "endsOn": "USER_DEFINED", "frequency": "ONE_OFF", "fundingSources": [ { "class": "LiquidAssetsFundingSource", "description": "Liquid assets funding source", "name": "Liquid assets", "wrappers": [ "GENERAL_INVESTMENT_ACCOUNT", "TAX_ADVANTAGED", "PENSION" ] } ], "growthRate": "CALCULATED", "id": "1", "maximumAbsoluteSpreadAllowed": 0, "minimumAmount": 10000, "name": "My resource", "priority": 1, "properties": { "property_1": "Value of property 1", "property_2": "Value of property 2" }, "spreadOverGrowthRate": 0, "startDate": "2025-01-01T00:00:00.000Z", "startsOn": "USER_DEFINED" } ``` -------------------------------- ### Envizage Scenarios API Source: https://portal.envizage.me/quick-start/backend-example API endpoints for managing scenarios within the Envizage platform, including retrieving a list of existing scenarios and creating new ones. All calls require an access token for authorization. ```APIDOC GET /scenarios/?page={page}&size={size} - Description: Retrieves a paginated list of scenarios. - Headers: - Authorization: Bearer {access_token} (Required) - User's access token. - Content-Type: application/x-www-form-urlencoded - Accept: application/json - Query Parameters: - page: integer (Optional) - The page number (default: 0). - size: integer (Optional) - The number of items per page (default: 2000). - Returns: JSON array of scenario objects. POST /scenarios - Description: Creates a new scenario. - Headers: - Authorization: Bearer {access_token} (Required) - User's access token. - Body Parameters (JSON): - scenario: object (Required) - The scenario object to create, with properties like 'name', 'description', etc. - Returns: The created scenario object on success. ``` -------------------------------- ### Example JSON Payload for Resource Source: https://portal.envizage.me/goals/update-goal-11 An example JSON object demonstrating the structure and typical values for a resource, including its core properties, funding sources, and custom properties. This payload can be used for API requests or as a representation of a retrieved resource. ```JSON { "currency": "GBP", "description": "My resource's description", "desiredAmount": 10000, "enabled": true, "endDate": "2026-01-01T00:00:00.000Z", "endsOn": "USER_DEFINED", "frequency": "ONE_OFF", "fundingSources": [ { "class": "LiquidAssetsFundingSource", "description": "Liquid assets funding source", "name": "Liquid assets", "wrappers": [ "GENERAL_INVESTMENT_ACCOUNT", "TAX_ADVANTAGED", "PENSION" ] } ], "growthRate": "CALCULATED", "id": "1", "maximumAbsoluteSpreadAllowed": 0, "minimumAmount": 10000, "name": "My resource", "priority": 1, "properties": { "property_1": "Value of property 1", "property_2": "Value of property 2" }, "spreadOverGrowthRate": 0, "startDate": "2025-01-01T00:00:00.000Z", "startsOn": "USER_DEFINED" } ``` -------------------------------- ### Example JSON Payload for Resource Creation/Update Source: https://portal.envizage.me/goals-personal/update-goal-11 Illustrates a sample JSON structure for defining or updating a resource, including various fields like currency, amounts, dates, and funding sources. This example demonstrates the expected format for API requests. ```json { "currency": "GBP", "description": "My resource's description", "desiredAmount": 10000, "enabled": true, "endDate": "2026-01-01T00:00:00.000Z", "endsOn": "USER_DEFINED", "frequency": "ONE_OFF", "fundingSources": [ { "class": "LiquidAssetsFundingSource", "description": "Liquid assets funding source", "name": "Liquid assets", "wrappers": [ "GENERAL_INVESTMENT_ACCOUNT", "TAX_ADVANTAGED", "PENSION" ] } ], "growthRate": "CALCULATED", "id": "1", "maximumAbsoluteSpreadAllowed": 0, "minimumAmount": 10000, "name": "My resource", "priority": 1, "properties": { "property_1": "Value of property 1", "property_2": "Value of property 2" }, "spreadOverGrowthRate": 0, "startDate": "2025-01-01T00:00:00.000Z", "startsOn": "USER_DEFINED" } ``` -------------------------------- ### Node.js: Get Access Token and Create Envizage Scenario Source: https://portal.envizage.me/quick-start/backend-example This JavaScript code snippet demonstrates how to acquire an access token using a local authentication module (`auth.js`) and subsequently use that token to interact with the Envizage API, specifically to create a new scenario via a local services module (`services.js`). It relies on environment variables for sensitive credentials and includes basic error handling. ```javascript require('dotenv').config(); const { getAccessToken } = require('./auth'); const { createScenario } = require('./services'); const clientSecret = process.env.CLIENT_SECRET; const clientId = process.env.CLIENT_ID; const username = process.env.USERNAME; const password = process.env.PASSWORD; async function useEnvizageApi() { try { const getTokenResponse = await getAccessToken(clientSecret, clientId, username, password); const accessToken = getTokenResponse?.data?.access_token; const createScenarioResponse = await createScenario(accessToken, {name: 'Me Today'}); } catch (error) { console.log(error) } } useEnvizageApi(); ``` -------------------------------- ### Example JSON Payload for Resource Allocation Source: https://portal.envizage.me/assets/create-portfolio-allocation-1 An example JSON object demonstrating the structure and typical values for a resource allocation response. This payload includes custom allocation percentages, a description, specific start and end dates, and defined `endsOn` and `startsOn` conditions. ```JSON { "allocation": [ 0.12, 0.05, 0.12, 0.15, 0.45, 0.11, 0, 0, 0 ], "description": "My resource's description", "endDate": "2023-07-26T12:27:29.363Z", "endsOn": "ON_RETIREMENT", "id": "1", "name": "My resource", "profile": "medium", "startDate": "2023-07-26T12:27:29.363Z", "startsOn": "USER_DEFINED" } ``` -------------------------------- ### Node.js Envizage Services Module (services.js) Source: https://portal.envizage.me/quick-start/backend-example This module (`services.js`) contains functions for interacting with the Envizage API, specifically for retrieving and creating scenarios. It uses `axios` for making authenticated API calls, requiring an `access_token` for authorization and configuring the API URL from environment variables. ```JavaScript require('dotenv').config(); const axios = require('axios'); const apiUrl = process.env.API_URL; const getScenarios = (access_token) => { return axios({ method:'get', url: `${apiUrl}/scenarios/?page=0&size=2000`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json', 'Authorization': `Bearer ${access_token}` } }) } const createScenario = (access_token, scenario) => { return axios({ method:'post', url: `${apiUrl}/scenarios`, headers: { 'Authorization': `Bearer ${access_token}` }, data: scenario }) } module.exports = { getScenarios, createScenario }; ``` -------------------------------- ### Example JSON Payload for Goal Resource Source: https://portal.envizage.me/goals/get-goals-5 A comprehensive JSON example demonstrating the structure and typical values for a Goal resource, including nested objects like funding sources and pagination metadata. This payload could represent a response from a GET request or a body for a POST/PUT request. ```json { "content": [ { "currency": "GBP", "description": "My resource's description", "desiredAmount": 10000, "enabled": true, "endDate": "2026-01-01T00:00:00.000Z", "endsOn": "USER_DEFINED", "frequency": "ONE_OFF", "fundingSources": [ { "class": "LiquidAssetsFundingSource", "description": "Liquid assets funding source", "name": "Liquid assets", "wrappers": [ "GENERAL_INVESTMENT_ACCOUNT", "TAX_ADVANTAGED", "PENSION" ] } ], "growthRate": "CALCULATED", "id": "1", "maximumAbsoluteSpreadAllowed": 0, "minimumAmount": 10000, "name": "My resource", "percentageOfExpenditure": 0.6, "percentageOfIncome": 0, "priority": 1, "properties": { "property_1": "Value of property 1", "property_2": "Value of property 2" }, "spreadOverGrowthRate": 0, "startDate": "2025-01-01T00:00:00.000Z", "startsOn": "USER_DEFINED" } ], "empty": true, "first": true, "last": true, "number": 0, "numberOfElements": 0, "pageable": { "offset": 0, "pageNumber": 0, "pageSize": 0, "paged": true, "sort": { "empty": true, "sorted": true, "unsorted": true }, "unpaged": true }, "size": 0, "sort": { "empty": true, "sorted": true, "unsorted": true }, "totalElements": 0, "totalPages": 0 } ``` -------------------------------- ### Execute Node.js Application Source: https://portal.envizage.me/quick-start/backend-example This command is used to execute the `app.js` Node.js script from the terminal. Running this command will initiate the process defined within `app.js`, which includes obtaining an access token and making an API call to create a scenario. ```shell node app.js ``` -------------------------------- ### Node.js Envizage Authentication Module (auth.js) Source: https://portal.envizage.me/quick-start/backend-example This module (`auth.js`) provides functions for interacting with an OpenID Connect provider (likely Keycloak) to obtain access tokens, create new users, and get user-specific access tokens. It utilizes `axios` for HTTP requests and `qs` for URL-encoded data, configuring environment variables for realm ID and provider URL. ```JavaScript require('dotenv').config(); const axios = require('axios'); const qs = require('qs'); const realmId = process.env.REALM_ID; const url = process.env.PROVIDER_URL; const getToken =(clientSecret, clientId)=>{ return axios({ method: 'post', url: `${url}/realms/${realmId}/protocol/openid-connect/token`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' }, data: qs.stringify({ 'grant_type': 'client_credentials', 'client_secret': clientSecret, 'client_id': clientId }) }) }; const createUser = (username, password, token) => { return axios({ method: 'post', maxBodyLength: Infinity, url: `${url}/admin/realms/${realmId}/users`, headers: { 'Authorization': `Bearer ${token}` }, data: { "username": username, "email": "", "firstName": "", "lastName": "", "enabled": true, "emailVerified": true, "credentials": [ { "type": "password", "value": password } ] } }) } const getAccessToken = (clientSecret, clientId, username, password) => { return axios({ method:'post', maxBodyLength: Infinity, url: `${url}/realms/${realmId}/protocol/openid-connect/token`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json' }, data: { 'username': username, 'password': password, 'client_secret': clientSecret, 'client_id': clientId, 'grant_type': 'password' } }) } module.exports = { getToken, createUser, getAccessToken } ``` -------------------------------- ### Retrieve All Unsecured Debts API Source: https://portal.envizage.me/liabilities/get-liabilities Documents the GET API endpoint to list all unsecured debts for a given scenario, including request parameters, response schema, and an example. ```APIDOC GET /scenarios/:scenarioId/liabilities/unsecured-debts Description: List all Unsecured Debts in a given household. Request: Path Parameters: scenarioId: Type: string Required: true Description: The scenario's id Query Parameters: page: Type: integer Description: Zero-based page index (0..N) size: Type: integer Default: 20 Description: The size of the page to be returned sort: Type: string[] Description: Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. Responses: 200 OK: Content-Type: application/json Schema: type: object properties: content: type: array items: type: object properties: amount: type: number required: true description: The amount of the liability. annualAverageInterestRate: type: number required: true description: The annual average interest rate of the liability. currency: type: string required: true description: The currency on which we hold that liability. Valid currency code ISO-4217 from the list of supported currencies. description: type: string description: Description of the resource. endDate: type: date-time required: true description: The end date of the liability. id: type: string description: The id of the resource. name: type: string description: The name of the resource. properties: type: object description: Properties of the resource. additionalProperties: type: object description: Properties of the resource. repaymentType: type: string required: true enum: [PRINCIPAL_AMORTIZATION, INTEREST_ONLY_WITH_BALLOON_PAYMENT] description: The liability repayment type. source: type: string description: Read-only field containing the source of the data. startDate: type: date-time required: true description: The starting date of the liability. empty: type: boolean first: type: boolean last: type: boolean number: type: integer format: int32 numberOfElements: type: integer format: int32 pageable: type: object properties: offset: type: integer format: int64 pageNumber: type: integer format: int32 pageSize: type: integer format: int32 paged: type: boolean sort: type: object properties: empty: type: boolean sorted: type: boolean unsorted: type: boolean unpaged: type: boolean size: type: integer format: int32 sort: type: object properties: empty: type: boolean sorted: type: boolean unsorted: type: boolean totalElements: type: integer format: int64 totalPages: type: integer format: int32 Example: { "content": [ { "amount": 70000, "annualAverageInterestRate": 0.02, "currency": "GBP", "description": "My resource's description", "endDate": "2036-01-01T00:00:00.000Z", "id": "1", "name": "My resource", "properties": { "property_1": "Value of property 1", "property_2": "Value of property 2" }, "repaymentType": "PRINCIPAL_AMORTIZATION", "source": "Source of the resource", "startDate": "2023-01-01T00:00:00.000Z" } ], "empty": true, "first": true, "last": true, "number": 0, "numberOfElements": 0, "pageable": { "offset": 0, "pageNumber": 0, "pageSize": 0, "paged": true, "sort": { "empty": true, "sorted": true, "unsorted": true }, "unpaged": true }, "size": 0, "sort": { "empty": true, "sorted": true, "unsorted": true }, "totalElements": 0, "totalPages": 0 } 404 Not Found: Description: Not Found 500 Internal Server Error: Description: Internal Server Error ``` -------------------------------- ### Install Envizage Services SDK Package Source: https://portal.envizage.me/quick-start/envizage-sdk This snippet demonstrates how to install the main `@envizage/services` NPM package, which contains the Envizage SDK. This package provides the core Javascript methods for interacting with the Envizage API. ```npm npm install ---save @envizage/services ``` ```yarn yarn add @envizage/services ``` -------------------------------- ### Example JSON Payload for Resource/Goal Object Source: https://portal.envizage.me/goals-personal/create-goal-22 Illustrates a sample JSON structure for creating or updating a resource or goal object, including various properties and their values. ```JSON { "currency": "GBP", "description": "My resource's description", "desiredAmount": 10000, "enabled": true, "endDate": "2026-01-01T00:00:00.000Z", "endsOn": "USER_DEFINED", "frequency": "ONE_OFF", "fundingSources": [ { "class": "LiquidAssetsFundingSource", "description": "Liquid assets funding source", "name": "Liquid assets", "wrappers": [ "GENERAL_INVESTMENT_ACCOUNT", "TAX_ADVANTAGED", "PENSION" ] } ], "growthRate": "CALCULATED", "id": "1", "maximumAbsoluteSpreadAllowed": 0, "minimumAmount": 10000, "name": "My resource", "priority": 1, "properties": { "property_1": "Value of property 1", "property_2": "Value of property 2" }, "spreadOverGrowthRate": 0, "startDate": "2025-01-01T00:00:00.000Z", "startsOn": "USER_DEFINED" } ``` -------------------------------- ### Example JSON Response for Paginated Goals Source: https://portal.envizage.me/goals-personal/get-goals-22 Illustrates a sample JSON response for a paginated list of goal resources, showing the detailed structure of a single goal object within the 'content' array and the associated pagination metadata. ```JSON { "content": [ { "currency": "GBP", "description": "My resource's description", "desiredAmount": 10000, "enabled": true, "endDate": "2026-01-01T00:00:00.000Z", "endsOn": "USER_DEFINED", "frequency": "ONE_OFF", "fundingSources": [ { "class": "LiquidAssetsFundingSource", "description": "Liquid assets funding source", "name": "Liquid assets", "wrappers": [ "GENERAL_INVESTMENT_ACCOUNT", "TAX_ADVANTAGED", "PENSION" ] } ], "growthRate": "CALCULATED", "id": "1", "maximumAbsoluteSpreadAllowed": 0, "minimumAmount": 10000, "name": "My resource", "priority": 1, "properties": { "property_1": "Value of property 1", "property_2": "Value of property 2" }, "spreadOverGrowthRate": 0, "startDate": "2025-01-01T00:00:00.000Z", "startsOn": "USER_DEFINED" } ], "empty": true, "first": true, "last": true, "number": 0, "numberOfElements": 0, "pageable": { "offset": 0, "pageNumber": 0, "pageSize": 0, "paged": true, "sort": { "empty": true, "sorted": true, "unsorted": true }, "unpaged": true }, "size": 0, "sort": { "empty": true, "sorted": true, "unsorted": true }, "totalElements": 0, "totalPages": 0 } ``` -------------------------------- ### Retrieve Simulation Query Data Results API Source: https://portal.envizage.me/quick-start/simulation-results This API documentation describes the GET endpoint for retrieving the results of a scenario simulation execution. It includes the endpoint path and example requests using curl, raw HTTP/1.1, and httpie. ```APIDOC GET /results/{scenarioId}/query/results Description: This call retrieves the scenario simulation execution results. Parameters: scenarioId: The unique identifier for the simulation scenario. Example Requests: curl: curl 'https://api.envizage.me/results/1/query/results' -i -X GET \ -H 'Authorization: Bearer {YOUR_ACCESS_TOKEN}' HTTP/1.1: GET /results/1/query/results HTTP/1.1 Authorization: Bearer {YOUR_ACCESS_TOKEN} Host: api.envizage.me httpie: http GET 'https://api.envizage.me/results/1/query/results' \ 'Authorization: Bearer {YOUR_ACCESS_TOKEN}' ``` -------------------------------- ### Example Goal Resource JSON Object with Pagination Source: https://portal.envizage.me/goals/get-goals-26 A comprehensive JSON example demonstrating the structure of a 'Goal' resource, including all its defined properties and an example of the pagination metadata that would accompany a list of such resources. ```JSON { "content": [ { "annualNetRentalYieldPercentage": 0.025, "currency": "GBP", "description": "My resource's description", "desiredAmount": 10000, "enabled": true, "endDate": "2026-01-01T00:00:00.000Z", "endsOn": "USER_DEFINED", "frequency": "ONE_OFF", "fundingSources": [ { "class": "LiquidAssetsFundingSource", "description": "Liquid assets funding source", "name": "Liquid assets", "wrappers": [ "GENERAL_INVESTMENT_ACCOUNT", "TAX_ADVANTAGED", "PENSION" ] } ], "growthRate": "CALCULATED", "id": "1", "maximumAbsoluteSpreadAllowed": 0, "minimumAmount": 10000, "name": "My resource", "priority": 1, "properties": { "property_1": "Value of property 1", "property_2": "Value of property 2" }, "spreadOverGrowthRate": 0, "startDate": "2025-01-01T00:00:00.000Z", "startsOn": "USER_DEFINED", "toSurvivorPercentage": 0.8 } ], "empty": true, "first": true, "last": true, "number": 0, "numberOfElements": 0, "pageable": { "offset": 0, "pageNumber": 0, "pageSize": 0, "paged": true, "sort": { "empty": true, "sorted": true, "unsorted": true }, "unpaged": true }, "size": 0, "sort": { "empty": true, "sorted": true, "unsorted": true }, "totalElements": 0, "totalPages": 0 } ``` -------------------------------- ### Manage Envizage.me API Client Context in Python Source: https://portal.envizage.me/quick-start/python-example This snippet demonstrates how to create and manage an instance of the `openapi_client.ApiClient` within a `with` statement. This pattern ensures proper resource management and automatically handles the `Authorization` header using the provided authentication token for all subsequent API calls within the context. ```python def main(): with openapi_client.ApiClient(configuration, header_name="Authorization", header_value=auth_token) as api_client: if __name__ == main(): main() ``` -------------------------------- ### Example Paged Goal Resource API Response Source: https://portal.envizage.me/goals/get-goals-22 A sample JSON object demonstrating the structure of a paged API response containing a list of Goal resources. It includes detailed fields for a single goal and pagination metadata. ```JSON { "content": [ { "currency": "GBP", "description": "My resource's description", "desiredAmount": 10000, "enabled": true, "endDate": "2026-01-01T00:00:00.000Z", "endsOn": "USER_DEFINED", "frequency": "ONE_OFF", "fundingSources": [ { "class": "LiquidAssetsFundingSource", "description": "Liquid assets funding source", "name": "Liquid assets", "wrappers": [ "GENERAL_INVESTMENT_ACCOUNT", "TAX_ADVANTAGED", "PENSION" ] } ], "growthRate": "CALCULATED", "id": "1", "maximumAbsoluteSpreadAllowed": 0, "minimumAmount": 10000, "name": "My resource", "priority": 1, "properties": { "property_1": "Value of property 1", "property_2": "Value of property 2" }, "spreadOverGrowthRate": 0, "startDate": "2025-01-01T00:00:00.000Z", "startsOn": "USER_DEFINED" } ], "empty": true, "first": true, "last": true, "number": 0, "numberOfElements": 0, "pageable": { "offset": 0, "pageNumber": 0, "pageSize": 0, "paged": true, "sort": { "empty": true, "sorted": true, "unsorted": true }, "unpaged": true }, "size": 0, "sort": { "empty": true, "sorted": true, "unsorted": true }, "totalElements": 0, "totalPages": 0 } ```