{"__v":2,"_id":"55fc9b813c21291900e7e10b","category":{"__v":1,"_id":"55fc9b7a3c21291900e7e0da","pages":["55fc9b813c21291900e7e109","55fc9b813c21291900e7e10a","55fc9b813c21291900e7e10b","55fc9b813c21291900e7e10c","55fc9b813c21291900e7e10d","55fc9b813c21291900e7e10e","55fc9b813c21291900e7e10f"],"project":"5553d36165e8260d0024419a","version":"55fc9b793c21291900e7e0d7","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-13T22:52:06.479Z","from_sync":false,"order":2,"slug":"creating-api-calls","title":"Creating API Calls"},"parentDoc":null,"project":"5553d36165e8260d0024419a","user":"5553d33065e8260d00244199","version":{"__v":12,"_id":"55fc9b793c21291900e7e0d7","project":"5553d36165e8260d0024419a","createdAt":"2015-09-18T23:17:13.545Z","releaseDate":"2015-09-18T23:17:13.545Z","categories":["55fc9b7a3c21291900e7e0d8","55fc9b7a3c21291900e7e0d9","55fc9b7a3c21291900e7e0da","55fc9b7a3c21291900e7e0db","55fc9b7a3c21291900e7e0dc","55fc9b7a3c21291900e7e0dd","55fc9b7a3c21291900e7e0de","55fc9b7a3c21291900e7e0df","55fc9b7a3c21291900e7e0e0","55fc9b7a3c21291900e7e0e1","55fc9b7a3c21291900e7e0e2","55fc9b7a3c21291900e7e0e3","55fc9bad4c80910d00b9bece","56394a0c3539050d00082122","56394a2f68b11f0d0048c9ff","56394a462fc5520d001a4db3","56394a4c2fc5520d001a4db4","56394a5b049e420d00476b5c","56394a6a2fc5520d001a4db5","56394f791593e4190073a44b","567b3adfb56bac0d0019d8d9","569d590e5a2b060d008741eb","569ea93dffccd10d00a05c7f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-14T20:16:41.527Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Using Variables\"\n}\n[/block]\nAPImetrics provides a number of system variables that can be added to API calls for automation of features.  These include data and time handling and also custom variables that can be defined in the 'Conditions' tab of an API call or workflow.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Variable Name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"%%DATETIME%%\",\n    \"0-1\": \"a date string in ISO format, e.g.: 2014-07-09T19:29:43.492000\",\n    \"3-0\": \"%%TEST_ID%%\",\n    \"3-1\": \"an ID number identifying the current test (remains constant for each test), e.g.: 5872285445521408\",\n    \"5-0\": \"%%RESULT_ID%%\",\n    \"5-1\": \"an unique ID number identifying the specific call (changes for each call made).\",\n    \"6-0\": \"%%TEST_RUN_RESULT_ID%%\",\n    \"6-1\": \"an 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).\",\n    \"1-0\": \"%%DATE%%\",\n    \"1-1\": \"returns the date only, e.g.: 2015-05-04\",\n    \"2-0\": \"%%TIME%%\",\n    \"2-1\": \"returns the time string only, e.g.: 14:34:45\",\n    \"4-0\": \"%%TEST_RUN_ID%%\",\n    \"4-1\": \"an ID number identifying the current workflow (remains constant throughout lifetime of workflow).\",\n    \"8-0\": \"%%CLIENT_SECRET%%\",\n    \"7-0\": \"%%CLIENT_ID%%\",\n    \"8-1\": \"the client secret from your selected developer key - set in Authentication settings\",\n    \"7-1\": \"the client id from your selected developer key - set in Authentication settings\",\n    \"9-0\": \"%%UNIXTIME%%\",\n    \"9-1\": \"the current time in UNIX time (i.e the number of seconds since Jan 1st 1970) - e.g. 335632800\",\n    \"10-0\": \"%%CREDITCARD%%\",\n    \"10-1\": \"generates a random 16 digit number that passes the Luhn Checksum.\",\n    \"11-0\": \"%%VISACARD%% \\n%%VISACARD%% \\n%%MASTERCARD%% \\n%%RANDCARD%%\",\n    \"11-1\": \"generates a random number which the correct initial digits such as it appears the relevant card-type. RANDCARD is randomly picked number from of the other three.\",\n    \"12-0\": \"%%RANDOM%%\",\n    \"12-1\": \"A random integer between 1 and 10000\",\n    \"13-0\": \"%%RANDLAT%%\\n%%RANDLNG%%\",\n    \"13-1\": \"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)\"\n  },\n  \"cols\": 2,\n  \"rows\": 14\n}\n[/block]\nVariables are added to a parameter or URI using either a double underscore either side of the variable name, or double % marks.\n\nUnderscores are recommended for URLs.\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET http://api.exapmple.com/endpoint/q=__VARIABLENAME__\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nAlternatively, in the API Call Edit view, you can add directly using the same format:\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f156780-System_Variables.png\",\n        \"System_Variables.png\",\n        1538,\n        668,\n        \"#2e358f\"\n      ],\n      \"caption\": \"System variables used in a POST Example.\"\n    }\n  ]\n}\n[/block]","excerpt":"Automated variables for API Calls","slug":"apimetrics-system-variables-for-api-calls","type":"basic","title":"APImetrics System Variables"}

APImetrics System Variables

Automated variables for API Calls

[block:api-header] { "type": "basic", "title": "Using Variables" } [/block] APImetrics provides a number of system variables that can be added to API calls for automation of features. These include data and time handling and also custom variables that can be defined in the 'Conditions' tab of an API call or workflow. [block:parameters] { "data": { "h-0": "Variable Name", "h-1": "Description", "0-0": "%%DATETIME%%", "0-1": "a date string in ISO format, e.g.: 2014-07-09T19:29:43.492000", "3-0": "%%TEST_ID%%", "3-1": "an ID number identifying the current test (remains constant for each test), e.g.: 5872285445521408", "5-0": "%%RESULT_ID%%", "5-1": "an unique ID number identifying the specific call (changes for each call made).", "6-0": "%%TEST_RUN_RESULT_ID%%", "6-1": "an 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).", "1-0": "%%DATE%%", "1-1": "returns the date only, e.g.: 2015-05-04", "2-0": "%%TIME%%", "2-1": "returns the time string only, e.g.: 14:34:45", "4-0": "%%TEST_RUN_ID%%", "4-1": "an ID number identifying the current workflow (remains constant throughout lifetime of workflow).", "8-0": "%%CLIENT_SECRET%%", "7-0": "%%CLIENT_ID%%", "8-1": "the client secret from your selected developer key - set in Authentication settings", "7-1": "the client id from your selected developer key - set in Authentication settings", "9-0": "%%UNIXTIME%%", "9-1": "the current time in UNIX time (i.e the number of seconds since Jan 1st 1970) - e.g. 335632800", "10-0": "%%CREDITCARD%%", "10-1": "generates a random 16 digit number that passes the Luhn Checksum.", "11-0": "%%VISACARD%% \n%%VISACARD%% \n%%MASTERCARD%% \n%%RANDCARD%%", "11-1": "generates a random number which the correct initial digits such as it appears the relevant card-type. RANDCARD is randomly picked number from of the other three.", "12-0": "%%RANDOM%%", "12-1": "A random integer between 1 and 10000", "13-0": "%%RANDLAT%%\n%%RANDLNG%%", "13-1": "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)" }, "cols": 2, "rows": 14 } [/block] Variables are added to a parameter or URI using either a double underscore either side of the variable name, or double % marks. Underscores are recommended for URLs. [block:code] { "codes": [ { "code": "GET http://api.exapmple.com/endpoint/q=__VARIABLENAME__", "language": "curl" } ] } [/block] Alternatively, in the API Call Edit view, you can add directly using the same format: [block:image] { "images": [ { "image": [ "https://files.readme.io/f156780-System_Variables.png", "System_Variables.png", 1538, 668, "#2e358f" ], "caption": "System variables used in a POST Example." } ] } [/block]