System Variables

APImetrics provides a range of pre-defined variables to automate certain aspects of API making calls.

Key Concepts

APImetrics provides a number of pre-defined system variables that can be used in an API call.

📘

Syntax

Variables can be injected into a call by surrounding the variable name by either percentages (e.g. %%NAME%%) or double underscores (e.g. __NAME__). For use in a URI, we recommend double underscore.

System Variables

Variable Name (%%VAR_NAME%% or VAR_NAME)

Description

DATETIME

A date string in ISO format, e.g.: 2019-07-09T19:29:43.492000

DATE

Returns the date only, e.g.: 2019-05-04

TIME

Returns the time string only, e.g.: 14:34:45

TEST_ID

An ID number identifying the current test (remains constant for each test), e.g.: 5872285445521408

TEST_RUN_ID

An ID number identifying the current workflow (remains constant throughout lifetime of workflow).

RESULT_ID

A unique ID number identifying the specific call (changes for each call made).

TEST_RUN_RESULT_ID

A unique ID number identifying the specific workflow run (remains the same for all the calls in that workflow, but is different each time that workflow is triggered).

CLIENT_ID

The client id from your selected developer key set in Authentication settings

CLIENT_SECRET

The client secret from your selected developer key set in Authentication settings

UNIXTIME

The current time in UNIX time (i.e the number of seconds since 1970 January 1) - e.g. 335632800

CREDITCARD

Generates a random 16 digit number that passes the Luhn Checksum

VISACARD
VISACARD
MASTERCARD
RANDCARD

Generates a random number with the correct initial digits such as it appears the relevant card-type. RANDCARD is randomly picked number from of the other three

RANDOM

A random integer between 1 and 10000

RANDLAT
RANDLNG

A random latitude (a 6-decimal point precision number between -90.0 an 90.0) and a random longitude (a 6-decimal point precision number between -180.0 an 180.0)

GUID

A RFC 4122 compliant version 4 UUID (e.g. 2dbf15b4-fa53-45c7-8e37-ea8965396b42)

📘

Need more advanced date or time manipulation?

If you require more complex date or time formatting or manipulation, create a Workflow and use our momentjs-based REST API.

Defined Variables

Users can define variables as Global Variables or as workflow variables where variables are set from returned JSON or XML.