Available translations

API Path Parameter

foundations.png
api-path-parameter.png
A path parameter defines the unique path to your endpoint. For a full description of how to identify a path parameter see the API Path Parameters page.
A path parameter can be a fixed string of text defined at an API Path Parameter node, or it can be dynamically replaced by the API Fetcher Bot for a value generated at runtime.
API Path Parameter Configuration
Properties
  • codeName: This property holds the value used to help build the request URL.
  • isString: Define if the path parameter is a string or not.
  • isOptional: Define if this path parameter is optional or not.
  • description: Define a basic description of what this path parameter accomplishes.
  • replaceBy: [Optional] This property allows you to instruct the API Fetcher Bot to set a value to this parameter replacing the current default and using contextual information available only at runtime.
Here is an example of an API Path Parameter config:
 {
    "codeName": "currentBaseAsset",
    "isString": true,
    "isOptional": false,
    "description": "Get statistics for the current base asset",
    "replaceBy": "@BaseAssetNameLowercase"
}
Foundations->Concept->replaceBy Config Property->How To Use It
replaceBy Config Property Usage
This property is optional, meaning that the Bot will use the default value when it is not present. The default value for both API Query Parameter and API Path Parameter is the codeName config property. An example of how this would look in a config is as follows:
 {
    "codeName": "currentBaseAsset",
    "isString": false,
    "isOptional": false,
    "description": "",
    "replaceBy": "@BaseAsset"
}
The following list lays out all the possible values you can use within the replaceBy property.
For Base Asset
  • @BaseAsset: This will force the Bot to use the current Base Asset.
 parameterValue = TS.projects.foundations.globals.taskConstants.TASK_NODE
.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName
  • @BaseAssetNameUppercase: This will force the Bot to use the current name of the Base Asset beginning with an uppercase letter.
 rawValue = TS.projects.foundations.globals.taskConstants.TASK_NODE
.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.name
parameterValue = rawValue.toUpperCase()
  • @BaseAssetNameLowercase: This will force the Bot to use the name of the current Base Asset beginning with a lowercase letter.
 rawValue = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode
.parentNode.parentNode.referenceParent.baseAsset.referenceParent.name
parameterValue = rawValue.toLowerCase()
For Quoted Asset
  • @QuotedAsset: This will force the Bot to use the current Quoted Asset.
 parameterValue = TS.projects.foundations.globals.taskConstants.TASK_NODE
.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName
  • @QuotedAssetNameUppercase: This will force the Bot to use the name of the current Base Asset beginning with an uppercase letter.
 rawValue = TS.projects.foundations.globals.taskConstants.TASK_NODE
.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.name
parameterValue = rawValue.toUpperCase()
  • @QuotedAssetNameLowercase: This will force the Bot to use the name of the current Base Asset beginning with a lowercase letter.
 rawValue = TS.projects.foundations.globals.taskConstants.TASK_NODE
.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.name
parameterValue = rawValue.toLowerCase()
For Exchange
  • @Exchange: This will force the Bot to use the current Exchange.
 parameterValue = TS.projects.foundations.globals.taskConstants.TASK_NODE 
.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.codeName
  • @ExchangeNameUppercase: This will force the Bot to use the name of the current Exchange beginning with an uppercase letter.
 rawValue = TS.projects.foundations.globals.taskConstants.TASK_NODE
.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name
parameterValue = rawValue.toUpperCase()
  • @ExchangeNameLowercase: This will force the Bot to use the name of the current Exchange beginning with a lowercase letter.
 rawValue = TS.projects.foundations.globals.taskConstants.TASK_NODE
.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name
parameterValue = rawValue.toLowerCase()
For Timestamp
  • @BeginCurrentMinute: This will instruct the Bot to use a timestamp at the beginning of the current minute.
 parameterValue = 
Math.trunc((new Date()).valueOf() / 
SA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS) * 
SA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS
  • @EndCurrentMinute: This will instruct the Bot to use a timestamp at the ending of the current minute.
 parameterValue = Math.trunc((new Date()).valueOf() / 
SA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS) * 
SA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS + 
SA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS - 1
Initial Values
These are the Initial Values for API Path Parameter configuration:
 {
    "codeName": "",
    "isString": false,
    "isOptional": false,
    "description": ""
}
Examples
This is a list of properties featured by the API Path Parameter configuration. Expanding a property shows sample values for the property extracted from the current Workspace.
API Path Parameter Menu
The API Path Parameter 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 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 Path Parameter Attaching Rules
The following are the Node Attaching Rules that govern the attachment of API Path Parameter with other nodes:
Compatible Types: