{"id":17300079,"url":"https://github.com/thomaspoignant/api-scenario","last_synced_at":"2026-04-04T06:41:00.051Z","repository":{"id":56012512,"uuid":"259373189","full_name":"thomaspoignant/api-scenario","owner":"thomaspoignant","description":"API-scenario is a command-line tool that allows you to execute easily a scenario to test your APIs.","archived":false,"fork":false,"pushed_at":"2021-11-09T10:56:43.000Z","size":11257,"stargazers_count":17,"open_issues_count":6,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-15T08:41:52.293Z","etag":null,"topics":["api-scenario","beginner-friendly","go","golang","integration-test","integration-testing","testing","testing-tools"],"latest_commit_sha":null,"homepage":"https://github.com/thomaspoignant/api-scenario#api-scenario","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomaspoignant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-27T15:29:03.000Z","updated_at":"2024-11-05T11:59:04.000Z","dependencies_parsed_at":"2022-08-15T11:20:50.833Z","dependency_job_id":null,"html_url":"https://github.com/thomaspoignant/api-scenario","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/thomaspoignant/api-scenario","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaspoignant%2Fapi-scenario","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaspoignant%2Fapi-scenario/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaspoignant%2Fapi-scenario/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaspoignant%2Fapi-scenario/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomaspoignant","download_url":"https://codeload.github.com/thomaspoignant/api-scenario/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaspoignant%2Fapi-scenario/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004694,"owners_count":26083750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-scenario","beginner-friendly","go","golang","integration-test","integration-testing","testing","testing-tools"],"created_at":"2024-10-15T11:25:38.267Z","updated_at":"2025-10-10T16:35:09.880Z","avatar_url":"https://github.com/thomaspoignant.png","language":"Go","readme":"# API-scenario\n## Scenario API testing from the command line.\n\n[![Release version](https://img.shields.io/github/v/release/thomaspoignant/api-scenario \"Release version\")](https://github.com/thomaspoignant/api-scenario/releases)\n[![Build Status](https://travis-ci.com/thomaspoignant/api-scenario.svg?token=sVd5BLjwtrGWjxxeoYSx\u0026branch=master)](https://travis-ci.com/thomaspoignant/api-scenario)\n[![Coverage Status](https://coveralls.io/repos/github/thomaspoignant/api-scenario/badge.svg)](https://coveralls.io/github/thomaspoignant/api-scenario)\n[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=thomaspoignant_api-scenario\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=thomaspoignant_api-scenario)\n![Go version](https://img.shields.io/github/go-mod/go-version/thomaspoignant/api-scenario?logo=go%20version \"Go version\")\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fthomaspoignant%2Fapi-scenario.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fthomaspoignant%2Fapi-scenario?ref=badge_shield)\n[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/thomaspoignant/api-scenario?color=blue\u0026logo=docker\u0026sort=semver)](https://hub.docker.com/r/thomaspoignant/api-scenario)\n \nAPI-scenario is a simple command line tool that allow you to execute easily a scenario to test your APIs.  \n\nIt is perfect to make end to end tests, you could use in your CI workflow to validate your deployment or just to test \nlocally your development.\n\n\n![api-scenario demo](api-scenario.gif \"api-scenario demo\")\n---\n\n- [Why this project?](#why-this-project)\n- [Installation](#installation)\n  - [Install using Homebrew (mac and linux)](#install-using-homebrew-mac-and-linux)\n  - [Install using Scoop (windows)](#install-using-scoop-windows)\n  - [Install using .deb file (linux)](#install-using-deb-file-linux)\n  - [Install using .rpm file (linux)](#install-using-rpm-file-linux)\n  - [Use docker image](#use-docker-image)\n- [Command line usage](#command-line-usage)\n  - [Version](#version)\n  - [Execute your scenario](#execute-your-scenario)\n    - [Save result into file](#save-result-into-file)\n- [Creating Your First Test](#creating-your-first-test)\n  - [The basic structure of the file](#the-basic-structure-of-the-file)\n  - [Our first step](#our-first-step)\n- [Steps](#steps)\n  - [Pause](#pause)\n  - [Request](#request)\n    - [Headers](#headers)\n    - [Assertions](#assertions)\n      - [Assertion composition](#assertion-composition)\n      - [Available source type](#available-source-type)\n      - [Available comparison type](#available-comparison-type)\n- [Request Chaining](#request-chaining)\n  - [Using Variables to Pass Data Between Steps](#using-variables-to-pass-data-between-steps)\n  - [Extracting Data from JSON Body Content](#extracting-data-from-json-body-content)\n  - [Global Variables](#global-variables)\n  - [Add / Override headers](#add--override-headers)\n  - [Built-in Variables and Functions](#built-in-variables-and-functions)\n  - [Using Variables in Requests](#using-variables-in-requests)\n\n---\n# Why this project?\nOur goal is to have a simple command line tool that can run scenario to test your apis directly from the command line.\nYou can create a scenario and start using it during development, but also use it in your\n [CI/CD](https://en.wikipedia.org/wiki/CI/CD) to validate your deployment. \n\nYou can use variables in your scenario, so you are sure to run the same test suite on each environment and be sure of \nyour release.\n\n---\n\n# Installation\nAll the binaries are available in the [release](https://github.com/thomaspoignant/api-scenario/releases).\n\n## Install using Homebrew (mac and linux)\nIf you are using Homebrew package manager, you can install api-scenario with Homebrew. \n \n```console\nbrew tap thomaspoignant/homebrew-tap\nbrew install api-scenario\n```\n\n## Install using Scoop (windows)\n\nIf you are on Windows and using scoop package manager, you can install api-scenario with [Scoop](https://scoop.sh/).\n```console\nscoop bucket add org https://github.com/thomaspoignant/scoop.git\nscoop install api-scenario\n```\n\n## Install using .deb file (linux)\nIf you prefer to use directly the `.deb` file to install in your debian like linux distribution.  \n_Don't forget to set the correct version number._\n```console\nwget https://github.com/thomaspoignant/api-scenario/releases/download/vX.X.X/api-scenario_X.X.X_Tux_64-bit.deb \u0026\u0026 dpkg -i api-scenario_*.deb\n```\n\n## Install using .rpm file (linux)\nIf you prefer to use directly the `.rpm` file to install in your centos/fedora like linux distribution.  \n_Don't forget to set the correct version number._\n```console\nwget https://github.com/thomaspoignant/api-scenario/releases/download/vX.X.X/api-scenario_X.X.X_Tux_64-bit.rpm \u0026\u0026 rpm -i api-scenario_*.rpm\n```\n\n## Use docker image\nTo use the last version of our docker image you can pull `thomaspoignant/api-scenario:latest`.\n\n```console\ndocker pull thomaspoignant/api-scenario:latest\n```\n\nYou can also pull all the version directly but also directly a major version.  \nAvailable images are:\n- `docker pull thomaspoignant/api-scenario:latest` _(target the latest version)_\n- `docker pull thomaspoignant/api-scenario:vX` _(target the major version)_\n- `docker pull thomaspoignant/api-scenario:vX.X` _(target the minor version)_\n- `docker pull thomaspoignant/api-scenario:vX.X.X` _(target a specific version)_\n\n[See docker hub page for usage.](https://hub.docker.com/r/thomaspoignant/api-scenario)\n\n---\n# Command line usage\n\n## Version\n```console\napi-scenario version\n# 0.1.0\n```\n\n## Execute your scenario\nTo execute your scenario please use the `run` options and specify your scenario file.\n\n```console\napi-scenario run --scenario=\"./scenario.json\"\n```\n\nThere are several options you can use with this command:\n\n|Option                  |Short version  | Required |Description  |\n|---                     |---            |---       |---\n|`--scenario`            | `-s`          |✓         |Input file for the scenario.\n|`--authorization-token` | `-t`          |          |Authorization token send in the Authorization headers.\n|`--header`              | `-h`          |          |Header you want to override (format should be \"**header_name:value**\").\u003cbr\u003e*You can have multiple values of this options*\n|`--variable`            | `-h`          |          |Value for a variable used in your scenario (format should be \"**variable_name:value**\").\u003cbr\u003e*You can have multiple values of this options*\n|`--verbose`             | `-s`          |          |Run your scenario with debug information.\n|`--quiet`               | `-s`          |          |Run your scenario in quiet mode.\n|`--no-color`            |               |          |Do not display color on the output.\n|`--output-file`         | `-f`          |          |Output file where to save the result _(use `--output-format` to specify if you want `JSON` or `YAML` output)_.\n|`--output-format`       |               |          |Format of the output file, available values are `JSON` and `YAML` _(ignored if `--output-file` is not set, default value is `JSON`)_.\n\n### Save result into file\nTo keep history of your scenario execution you can export the results into a file.\nYou just have to add the option `--output-file=\"\u003cyour file location\u003e\"` and it will save the result into a `JSON` file \n_(If you prefer `YAML` result add `--output-format=YAML`)_.\n\n**Example:**\n```console\napi-scenario run --scenario=\"./scenario.json\" --output-file=\"\u003cyour file location\u003e\" --output-format=YAML\n```\n\n---\n# Creating Your First Test\nCreating a test is simple, you just have to write `json` or `yaml` file to describe you api calls, and describe assertions.\n\n## The basic structure of the file\n\u003cdetails open\u003e\n\u003csummary\u003e\u003cb\u003eYAML\u003c/b\u003e\u003c/summary\u003e\n  \n  ```yaml\n  name: Simple API Test Example\n description: A full description ...\n version: '1.0'\n steps:\n     - ...\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003eJSON\u003c/b\u003e\u003c/summary\u003e\n  \n  ```json\n  {\n   \"name\": \"Simple API Test Example\",\n   \"description\": \"A full description of your test scenario\",\n   \"version\": \"1.0\",\n   \"steps\": [\n     ...\n   ]\n }\n  ```\n\u003c/details\u003e\n\nThis global fields allow to describe your scenario:\n- **name**: The name of your scenario\n- **description**: A complete description of what your scenario is doing\n- **version**: The version of your scenario\n- **steps**: Array of steps, it will describe all the steps of your scenario _(see [steps](#steps) for more details)_.\n\n## Our first step\nFor our first step we will create a basic call who verify that an API answer with http code `200` when calling it.\n\n\u003cdetails open\u003e\n\u003csummary\u003e\u003cb\u003eYAML\u003c/b\u003e\u003c/summary\u003e\n  \n  ```yaml\n  - step_type: request\n    url: {{baseUrl}}/api/users\n    method: GET\n    headers:\n      Content-Type:\n        - application/json\n    assertions:\n      - comparison: equal_number\n        value: '200'\n        source: response_status\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003eJSON\u003c/b\u003e\u003c/summary\u003e\n  \n  ```json\n  {\n    \"step_type\": \"request\",\n    \"url\": \"{{baseUrl}}/api/users\",\n    \"method\": \"GET\",\n    \"headers\": {\n      \"Content-Type\": [\"application/json\"]\n    },\n    \"assertions\": [\n      {\n        \"comparison\": \"equal_number\",\n        \"value\": \"200\",\n        \"source\": \"response_status\"\n      }\n    ]\n  }\n  ```\n\u003c/details\u003e\n\nWe manipulate different concepts here.\n- **step_type**: The type of the step, here we are using request because we want to test a rest \n    API _(see [steps](#steps) to see the list of available step types)_.\n- **url**: The URL of our request, `{{baseUrl}}` will be replaced before the call _([see Using Variables in Requests for details](#using-variables-to-pass-data-between-steps))_\n- **method**: The HTTP verb of our request.\n- **headers**: The list of headers we sent with the request.\n- **assertions**: This is the list of checks we are doing when we have received the response.\n    - **comparison**: The type of check we are doing, here we are testing that number are equals.\n    - **value**: The expected value\n    - **source**: On what part of the response we are looking, here we are checking the response status.\n\n\nNow the first scenario is build, we can run it _(see complete scenario:  [YAML](examples/first-test.yml) / [JSON](examples/first-test.json))_.\n```console\napi-scenario run --scenario=\"examples/first-test.json\" --variable=\"baseUrl:https://reqres.in\"\n```\nWhat we are doing is here is running our scenario file, and we ask to replace every occurrence \nof `{{baseUrl}}` by `https://reqres.in`.\n\n---\n# Steps\nThere are different types of steps who allow performs different types of actions.  \nTo specify the type of a step we are using the property `step_type` is the step object. \n\n_If there is no step_type property we ignore the step._\n\n## Pause\n**`pause`** is simple, it is a step that wait X seconds.  \nThis is useful when you have asynchronous API and allows waiting before calling the next API in the scenario.\n\n|Parameters      |Description  |\n|---            |---\n|**step_type**      | `pause`\n|**duration**       | Number of seconds to wait.\n|**skipped**        | If true the step is skipped and nothing is running.\n\n**Example:** _Wait for 5 seconds_\n\u003cdetails open\u003e\n\u003csummary\u003e\u003cb\u003eYAML\u003c/b\u003e\u003c/summary\u003e\n  \n  ```yaml\n  - step_type: pause\n    duration: 5\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003eJSON\u003c/b\u003e\u003c/summary\u003e\n  \n```json\n{\n  \"step_type\": \"pause\",\n  \"duration\": 5\n}\n```\n\u003c/details\u003e\n\n## Request\n**`request`** is the step who can call a REST Api.  \n\n|Parameters      |Description  |\n|---            |---\n|**step_type**      | `request`\n|**url**            | URL of your endpoint\n|**method**         | HTTP verb of your request _(GET, POST, PUT, DELETE, OPTIONS, PATCH)_\n|**body**           | A string with the body of the request\n|**variables**      | Array of variables to extract from the response _([see Using Variables to Pass Data Between Steps for details](#))_\n|**headers**        | Object who contains all the headers attach to the request _([see how to add headers](#headers))_\n|**assertions**     | Array of assertions, this is the acceptance tests _([see how to create assertion tests](#assertions))_\n|**skipped**        | If true the step is skipped and nothing is running.\n\n### Headers\nHeaders are represented by an object containing all the headers to send.  \nEach header is has the name of the header for key and an array of strings as value.\n\nYou can use variables in the headers, they will be replaced before sending the request _(see [Using Variables to Pass Data Between Steps](#using-variables-to-pass-data-between-steps) or [Global Variables](#global-variables))_.\n\n**Example:**\n\u003cdetails open\u003e\n\u003csummary\u003e\u003cb\u003eYAML\u003c/b\u003e\u003c/summary\u003e\n  \n  ```yaml\nheaders:\n      Accept-Charset:\n        - utf-8\n      Accept: \n        - application/scim+json\n      Authorization:\n        - {{auth}}\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003eJSON\u003c/b\u003e\u003c/summary\u003e\n  \n```json\n{\n  \"headers\": {\n      \"Accept-Charset\": [\n        \"utf-8\"\n      ],\n      \"Accept\": [\n        \"application/scim+json\"\n      ],\n      \"Authorization\": [\n        \"{{auth}}\"\n      ]\n    }\n}\n```\n\u003c/details\u003e\n\n### Assertions\nAssertions are a big part of api-scenario, this is the acceptance tests of your request, it will allow you to simply write test to verify that you endpoint is doing what you want.\n\n#### Assertion composition\n\n|Property        |Description  |\n|---             |---\n|**source**      | The location of the data to extract for comparison.\u003cbr\u003eSee [available source type](#available-source-type) to have authorized values.\n|**comparison**  | The type of operation to perform when comparing the extracted data with the target value.  _([see Available comparison type](#available-comparison-type))_.\n|**property**    | The property of the source data to retrieve.\u003cbr\u003e\u003cul\u003e\u003cli\u003eFor **HTTP headers**, this is the name of the header.\u003c/li\u003e\u003cli\u003eData from a **JSON / XML** response body can be extracted by specifying the path of the data using standard JavaScript notation.\u003c/li\u003e\u003cli\u003eUnused for text content, status code, response time and response size.\u003c/li\u003e\n|**value**       | The expected value used to compare against the actual value. \n\n\n**Example:**\n\u003cdetails open\u003e\n\u003csummary\u003e\u003cb\u003eYAML\u003c/b\u003e\u003c/summary\u003e\n  \n  ```yaml\n - comparison: equals\n    property: schemas\n    value: User\n    source: response_json\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003eJSON\u003c/b\u003e\u003c/summary\u003e\n  \n```json\n{\n  \"comparison\": \"equals\",\n  \"property\": \"schemas\",\n  \"value\": \"User\",\n  \"source\": \"response_json\"\n}\n```\n\u003c/details\u003e\n\n#### Available source type\n\n|Source                           |Config name        |Description  |\n|---                              |---                |---\n|**HTTP code**                    |`response_status`  |HTTP response status codes (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).\n|**Response time**                |`response_time`    |Duration of the request in seconds.\n|**Response Headers**             |`response_header`  |Target headers of the response.\n|**Body response _(JSON)_**       |`response_json`    |Target the response body extract in JSON.\n|**Body response _(plain text)_** |`response_text`    |Target the response body extract in plain text.\n|**Body response _(XML)_**        |`response_xml `    |Target the response body extract in XML.\n\n#### Available comparison type\n\n|Comparison         |Config name                 |Description  |\n|---                |---                         |---\n|**is empty** \t    |`empty`                     |The actual value exists and is an empty string or null.\n|**is not empty** \t|`not_empty`                 |The actual value exists and is a value other than an empty string or null.\n|**equals** \t    |`equal`                     |A string comparison of the actual and expected value. Non-string values are cast to a string before comparing. For comparing non-integer numbers, use equals (number).\n|**does not equal** |`not_equal`                 |A string comparison of the actual and target value.\n|**contains** \t    |`contains`                  |The actual value contains the target value as a substring.\n|**does not contain** \t|`does_not_contain`      |The target value is not found within the actual value.\n|**has key**        |`has_key`                   |Checks for the existence of the expected value within a dictionary's keys. The actual value must point to a dictionary **(JSON only)**.\n|**has value** \t    |`has_value`                 |Checks a list or dictionary for the existence of the expected value in any of the list or dictionary values. The actual value must point to a JSON list or dictionary **(JSON only)**.\n|**is null**        |`is_null`                   |Checks that a value for a given JSON or XML key is null.\n|**is a number**    |`is_a_number`               |Validates the actual value is (or can be cast to) a valid numeric value.\n|**less than** \t    |`is_less_than`              |Validates the actual value is (or can be cast to) a number less than the target value.\n|**less than or equal** |`is_less_than_or_equals`|Validates the actual value is (or can be cast to) a number less than or equal to the target value.\n|**greater than** \t|`is_greater_than`           |Validates the actual value is (or can be cast to) a number greater than the target value.\n|**greater than or equal** \t|`is_greater_than_or_equal`|Validates the actual value is (or can be cast to) a number greater than or equal to the target value.\n|**equals (number)** \t|`equal_number`          |Validates the actual value is (or can be cast to) a number equal to the target value. This setting performs a numeric comparison: for example, \"1.000\" would be considered equal to \"1\".\n\n---\n# Request Chaining\n## Using Variables to Pass Data Between Steps\nRequest steps can define variables that extract data from HTTP responses returned when running the test.\nTo create a variable, add a `variables` block to your step and specify the location of the data you'd like to extract \nfrom the response, and the **name** of this variable.\n\n\u003cdetails open\u003e\n\u003csummary\u003e\u003cb\u003eYAML\u003c/b\u003e\u003c/summary\u003e\n  \n  ```yaml\n    variables:\n      - source: response_json\n        property: point\n        name: active\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n \u003csummary\u003e\u003cb\u003eJSON\u003c/b\u003e\u003c/summary\u003e\n  \n```json\n{\n  \"variables\": [\n    {\n      \"source\": \"response_json\",\n      \"property\": \"point\",\n      \"name\": \"active\"\n    }\n  ]\n}\n```\n\u003c/details\u003e\n\n**A variable is:**\n\n|                   |  |\n|---                |---\n|**Source**         |The location of the data to extract. Data can be extracted from\u003cbr\u003e\u003cul\u003e\u003cli\u003eHTTP header values - `response_header`\u003c/li\u003e\u003cli\u003eResponse bodies - `response_json`\u003c/li\u003e\u003cli\u003eResponse status code - `response_status`\u003c/li\u003e\u003c/ul\u003e\n|**Property**       |The property of the source data to retrieve.\u003cbr\u003eFor HTTP headers this is the name of the header.\u003cbr\u003eFor JSON content, see below.\u003cbr\u003eUnused status code.\n|**Variable Name**  |The name of the variable to assign the extracted value to.\u003cbr\u003eIn subsequent requests you can retrieve the value of the variable by this name.\u003cbr\u003e[See Using Variables in Requests](#using-variables-in-requests).\n\n## Extracting Data from JSON Body Content\nData from a JSON response body can be extracted by specifying the path of the target data using standard JavaScript \nnotation. [View sample JSON](./examples). \n\n## Global Variables\nSome variables could be set up at launch, for that you can add options to the `run` command to pass it.\nCommon values (base URLs, API tokens, etc.) that are shared across requests within a test, or tests within a bucket, \nshould be stored in an Initial Variable.\nOnce defined, the variable is available to all requests within the test.\n\nTo add a variable just use the option `--variable` or `-V` and specify the `key:value` of this variable.\n```console\n./api-scenario run -F your_file.json --variable=\"baseUrl:http://www.google.com/\" -V \"token:token1234\"\n```\n\n__Note that if you create a variable in a step with the same name of a global variable it will override it.__\n\n## Add / Override headers\nOverriding headers works the same as [global variables](#global-variables).  \nYou can add a header for all your requests by using the option `--header` or `-H`, it will add or override the header \nfor all requests.\n\n```console\n./api-scenario run -F your_file.json --header=\"Content-Type:application/json\" -H \"Authorization: Bearer Token123\"\n```\n\n## Built-in Variables and Functions\n|**Variable/Function**       |**Description**       |**Example Output**\n|---\t                 |---\t            |---\t\n|**`{{timestamp}}`**                        |Integer Unix timestamp (seconds elapsed since January 1, 1970 00:00 UTC)       |`1384035195`\n|**`{{utc_datetime}}`**                     |UTC datetime string in ISO 8601 format.                                        |`2013-11-07T19:24:41.418968`\n|**`{{format_timestamp(value, format)}}`**  |Timestamp of the specified value in the specified format.\u003cbr\u003eAny delimiters (e.g. -, /, ., *, etc.) can be used in the format with a combination of any of the following date/time format options. Also accepts variables. E.g. **`{{format_timestamp({{timestamp}}, YYYY-MM-DD)}}`**\u003cbr\u003e\u003cul\u003e\u003cli\u003e**YYYY** - 4 digit year (e.g. 2019)\u003c/li\u003e\u003cli\u003e**YYYY** - 4 digit year (e.g. 2016)\u003c/li\u003e\u003cli\u003e**YY** - 2 digit year (e.g. 16)\u003c/li\u003e\u003cli\u003e**MM** - month\u003c/li\u003e\u003cli\u003e**DD** - day\u003c/li\u003e\u003cli\u003e**HH** - 24 hour (e.g. 13 == 1pm)\u003c/li\u003e\u003cli\u003e**hh** - 12 hour (e.g. 01 == 1pm)\u003c/li\u003e\u003cli\u003e**mm** - minutes\u003c/li\u003e\u003cli\u003e**ss** - seconds\u003c/li\u003e\u003c/ul\u003e|`2019-31-03`\n|**`{{timestamp_offset(value)}}`**          |Integer Unix timestamp offset by the specified value in seconds (going back in time would be a negative offset value). Values should be passed without surrounding quotes.|`1383948795`\n|**`{{random_int}}`**                       |Random integer between 0 and 18446744073709551615                              |`407370955`\n|**`{{random_int(a,b)}}`**                  |Random integer value between a and b, inclusive.                               |`44674407370`\n|**`{{random_string(length)}}`**            |Random alphanumeric string of the specified length (max 1000 characters).      |`ddo1qlQR81`\n|**`{{uuid}}`**                             |Random universally unique identifier (UUID). \t                                |`99386c08-6da7-4833-bb31-e70ce747c921`\n|**`{{encode_base64(value)}}`**             |Encodes value in Base64. Values should be passed without surrounding quotes. Also accepts variables e.g. `{{encode_base64({{username}}:{{password}})}}` |`dTpwDQo`=\n|**`{{md5(value)}}`**                       |Generate an MD5 hash based on value. Values should be passed without surrounding quotes. Also accepts variables e.g. `{{md5({{timestamp}})}}` |`50b7fe4da64720232c25bc7c6d66f6c5`\n|**`{{sha1(value)}}`**                      |Generate an SHA-1 hash based on value. Values should be passed without surrounding quotes. Also accepts variables e.g. `{{sha1({{timestamp}})}}` |`e0bd9304537cd8cb4e69ef5d73771fe218c484f5`\n|**`{{sha256(value)}}`**                    |Generate an SHA-256 hash based on value. Values should be passed without surrounding quotes. Also accepts variables e.g. `{{sha1({{timestamp}})}}` |`e3376ffb4b1e2c04b0fe68b52e8654696814b4883b47a56ff5a7df883725d8c1`\n|**`{{hmac_sha1(value,key)}}`**             |Generate an HMAC using the SHA-1 hashing algorithm based on value and key. Values should be passed without surrounding quotes. Also accepts variables e.g. `{{hmac_sha1({{timestamp}},key)}}` |`163a04cd86a82b948a7e85f0ed3cd3b5929a7d0c`\n|**`{{hmac_sha256(value,key)}}`**           |Generate an HMAC using the SHA-256 hashing algorithm based on value and key. Values should be passed without surrounding quotes. Also accepts variables e.g. `{{hmac_sha1({{timestamp}},key)}}` |`eb0b5c5b2a04ac25ff52c886e115f2e60c0dd8d50bab076dc065e95f5fd37fb9`\n|**`{{url_encode(value)}}`**                |Create a percent-encoded string suitable for URL querystrings. This is not required for URL or form parameters defined in the request editor which are automatically encoded. Only use this if you need to double encode a value in a URL or include a URL encoded string in a header value. \t|`This%20is%20100%25%20URL%20encoded.`\n\n \t\n## Using Variables in Requests\nOnce a variable has been defined, you can use it in any subsequent request.  \nVariables can be used in any request data field including the method, URL, header values, parameter values and request bodies.\n\nTo include the value of a variable in a request, enter the name of the variable surrounded by double braces e.g. **`{{variable_name}}`**.  \nIf a variable is undefined when a request using that variable is executed, we will keep the variable un-replaced.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomaspoignant%2Fapi-scenario","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomaspoignant%2Fapi-scenario","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomaspoignant%2Fapi-scenario/lists"}