Global Script variable APIs

Use these APIs to configure global variables.

Creating a global variable

API version 1.0.0

API URI components

Command output format application/json

The sample curl command resembles the following code:

curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' -H 'Content-Type: application/json' -i 'https://<synthetic_route_address>/synthetic/1.0/global_variables' --data '{"name":"user","type":"text","value":"leo"}'

The response resembles the following code:

HTTP/1.1 201 Created
location: https://<synthetic_route_address>/synthetic/1.0/global_variables/9sKBpFO_QqOaMnsgc5M4kg

Updating a global variable

API version 1.0.0

API URI components

Command output format application/json

The sample curl command resembles the following code:

curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H 'Content-Type: application/json' -i 'https://<synthetic_route_address>/synthetic/1.0/global_variables/QwsIv8vQRyOAQlHXBLjWCw' --data '{"type":"text","value":"john"}'

The response resembles the following code:

HTTP/1.1 204 No Content

Getting information for a global variable

API version 1.0.0

API URI components

Command output format application/json

The sample curl command resembles the following code:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' -H 'Content-Type: application/json' -i 'https://<synthetic_route_address>/synthetic/1.0/global_variables/9sKBpFO_QqOaMnsgc5M4kg'

The response resembles the following code:

HTTP/1.1 200 OK

{
    "name":"user1",
    "_id":"9sKBpFO_QqOaMnsgc5M4kg",
    "type":"text",
    "value":"leo"
}

Listing all of the global variables

API version 1.0.0

API URI components

Command output format application/json

The sample curl command resembles the following code:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' -H 'Content-Type: application/json' -i 'https://<synthetic_route_address>/synthetic/1.0/global_variables'

The response resembles the following code:

HTTP/1.1 200 OK

{
  "items": [
    {
      "name": "username",
      "_id": "QwsIv8vQRyOAQlHXBLjWCw",
      "type": "text",
      "value": "leo"
    },
    {
      "name": "password",
      "_id": "ociGE848RIijbX9LKVU7hQ",
      "type": "hidden",
      "value": "mypass"
    }
  ]
}

Deleting a global variable

API version 1.0.0

API URI components

Command output format application/json

The sample curl command resembles the following code:

curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' -H 'Content-Type: application/json' -i 'https://<synthetic_route_address>/synthetic/1.0/global_variables/9sKBpFO_QqOaMnsgc5M4kg'

The response resembles the following code:

HTTP/1.1 204 No Content