Crafting Metadata
With metadata, you can add additional parameters that an endpoint doesn't accept naturally on Terraswitch's API. Crafting metadata will depend on your language's handling of JSON and the intelligence behind how you process the properties.
The only way to add metadata is to add an array of objects called 'metadata' with its JSON structure of objects to an endpoint that accepts metadata
Structure of metadata objects
Metadata is an array of objects with a JSON structure. This structure can be constructive ( i.e. following Terraswitch's object structure) or dynamic. Dynamic structures mean you pass in your own defined objects; this should be an array of key/value pair objects. Constructive structure means you follow Terraswitch's defined structure.
Sample Dynamic Structure
Constructive Structure
Constructive structures allow you to define "custom fields" that will be displayed on your Terraswitch dashboard and as well help you build flexible systems with additional information.
displayName
string
Specify the name you want to be displayed. E.g. "Order ID"
variableName
string
Specify the variable name. E.g. "orderId"
value
string
Specify the value of the variable. E.g. "1234567XDT"
Sample Constructive Structure
Last updated