This section explains how it is possible to consume data generated in a Pyplan app from outside of Pyplan.
To create an API endpoint, it’s necessary to create a node whose result is a Python function that can optionally receive parameters. For example, the code of the node could be the following:
Then, right-click on the created node and choose the “Get API Endpoint” option:
The following window will be displayed:
The “Share instance” option allows multiple calls to the API endpoint to be served from the same instance without the need to create a new one for each call. Conversely, by disabling this option, each call will create a new instance in Pyplan to serve it.
Continuing with the example, the URL will be our API endpoint that we can call from outside of Pyplan.
Example performed on the Postman platform:
In the “API endpoints” section, it is possible to edit and delete the created API endpoints of the current application.
To edit an API endpoint, you need to select the link to be edited and then click on the “Edit” button:
The following window will be displayed:
Options:
To confirm the changes, you must click on the “Confirm” button. To not apply the changes, click on “Cancel”
To delete an API endpoint, you must click on the following icon:
To create, edit, or delete API keys, you need to access them through the “Show API keys” button:
To create a new API key, click on the “Create API key”:
The following window will be displayed:
Options:
To confirm the changes, click on the “Confirm” button. To discard the creation, click on “Cancel”
To edit an API key, select the API key to be edited, and then click on the “Edit API key” button:
A window will be displayed with the same options as when creating a new API key.
To delete an API key, click on the following icon:
To assign an API key to an API endpoint, edit the API endpoint and select the desired API key: