Available translations

API Response Schema

foundations.png
api-response-schema.png
This node represents the map for the API response. APIs send their data using a JSON object. The children of this node will map this JSON object so that the API Fetcher Bot knows how to extract the data you want.
The API Map assumes the API Server will respond with string formatted in JSON. This means that the response will be a data structure of nestled objects and arrays. Users will need to map the response format into an API Response Schema by adding children to this node and to this node's children. All these descendants are of the same Node Type API Response Field.
Here is an example of an API's response JSON:
 {
    "status": {
        "timestamp": "2018-06-02T22:51:28.209Z",
         "elapsed": 10
    },
    "data": [
        {
        "id": "1e31218a-e44e-4285-820c-8282ee222035",
        "symbol": "BTC",
        "name": "Bitcoin",
        "slug": "bitcoin",
        "profile": {...},
        "metrics": {...}
        }
    ]
}
The main object is the first set of curly brackets { } enclosing everything. As you can see, underneath that there are two object properties named status and data. Status is an object and contains the header information. Data is an array and holds the actual data we are after. As you API Response Field nodes to your API Response Schema node you will be mapping an API response similar to this one.
API Response Schema Configuration
Properties
  • nodePath: the response from the server might include some header type data in addition to the actual data requested. Since the response is a JSON object, then the actual data might be located somewhere within the structure of that object. This property allows you to declare the path to the actual data requested, so as to jump the header-like information.
Why do We Need to Jump the Header?
In many cases it will be necessary to make several queries to the API Server in order to fetch all the data (think of pagination). Each page of data arrives at a certain location within the response data structure. That location is what we considered the Data Root.
If your Endpoint does not support pagination, it is still a good practice to define which part of the JSON object is the Data Root.
Check the API Response Field Reference node for details on how to setup this property.
Initial Values
These are the Initial Values for API Response Schema configuration:
 {
    "nodePath": "apiResponseReceivedObject.data"
}
Examples
This is a list of properties featured by the API Response Schema configuration. Expanding a property shows sample values for the property extracted from the current Workspace.
API Response Schema Menu
The API Response Schema node has the following Node Menu items:
The Configure menu item has the following properties:
  • action: Configure
  • actionFunction: uiObject.configEditor.activate
  • label: Configure
  • iconPathOn: configuration
  • iconPathOff: configuration
The Add API Response Field menu item has the following properties:
  • action: Add UI Object
  • disableIfPropertyIsDefined: true
  • propertyToCheckFor: apiResponseFields
  • label: Add API Response Field
  • actionFunction: payload.executeAction
  • actionProject: Visual-Scripting
  • relatedUiObjectProject: Foundations
The Delete menu item has the following properties:
  • action: Delete UI Object
  • actionProject: Visual-Scripting
  • askConfirmation: true
  • confirmationLabel: Confirm to Delete
  • label: Delete
  • iconPathOn: delete-entity
  • iconPathOff: delete-entity
  • actionFunction: payload.executeAction
API Response Schema Children
The API Response Schema node has the following childrenNodesProperties:
The Api Response Fields node property features the following properties:
  • name: apiResponseFields
  • type: node
  • autoAdd: false
API Response Schema Attaching Rules
The following are the Node Attaching Rules that govern the attachment of API Response Schema with other nodes:
Compatible Types: