# Postman Reference Collection

For your convenience we also provide the API specification as a Postman collection, to interact quickly and easily with the API.

You can download the collection here

{% file src="<https://1471712295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5veV04lYlkS769Dcp%2Fuploads%2Fgit-blob-5c6c90122c35c1f4e6eb5d57b4112cbf1cc35e90%2Fexh-postman-collections.zip?alt=media>" %}

## How to use the Postman Collection

<figure><img src="https://1471712295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5veV04lYlkS769Dcp%2Fuploads%2Fgit-blob-8812f1cd5835ede2764a9babe7e8ed1ca778d332%2FXnapper-2022-11-03-23.09.46.png?alt=media" alt=""><figcaption><p>Import collections in Postman</p></figcaption></figure>

### Step 1: Import the collection in Postman

1. Open Postman and click on the "Import" button
2. Select the `exh-postman-collections.json` from your filesystem
3. Confirm the import by clicking the orange "Import" button
4. The Extra Horizon postman collection is now available

### Step 2: Create a Postman environment that stores your credentials

The Extra Horizon API offers oAuth1 and oAuth2 authenthication mechanisms. The Postman collection contains some logic to facilicate using the endpoints.

Create a new Postman environment that contains the following variables:

<table><thead><tr><th width="238"></th><th>Value</th></tr></thead><tbody><tr><td><code>baseUrl</code></td><td><code>https://api.dev.exh-sandbox.extrahorizon.io</code></td></tr><tr><td><code>consumerKey</code></td><td>27a4353c3a950a494a6fd58a6g3c0cff4affc953</td></tr><tr><td><code>consumerSecret</code></td><td>7470a5bc2d42346988c5418420ac27cfe6ae5e8b</td></tr><tr><td><code>email</code></td><td><code>john.doe@extrahorizon.com</code></td></tr><tr><td><code>password</code></td><td><code>SomeVeryDifficultP@ss</code></td></tr></tbody></table>

**Don't forget to save the environment!**

<figure><img src="https://1471712295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5veV04lYlkS769Dcp%2Fuploads%2Fgit-blob-b854a37a3abe0369a08aedecd7ef468847bfeb79%2Fimage.png?alt=media" alt=""><figcaption><p>Environment view in Postman</p></figcaption></figure>

After creating the environment, make sure it is selected in the top-right dropdown before continuing.

{% hint style="info" %}
To learn more how to manage different environments, take a look at the [Postman Documentation on Environments](https://learning.postman.com/docs/sending-requests/managing-environments/).
{% endhint %}

### Step 3: Execute the authentication call

Open and execute the `Create OAuth1 token` HTTP Request. If all environment variables are set correctly, this call will return successfully a `token` and `tokenSecret` that you should use in subsequent requests.

<figure><img src="https://1471712295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mi5veV04lYlkS769Dcp%2Fuploads%2Fgit-blob-b995990ce005115450f6037b85164b01696443d7%2FXnapper-2022-11-03-23.35.29.png?alt=media" alt=""><figcaption></figcaption></figure>

The `token` and `tokenSecret` variables are automatically stored in the environment. Other requests reference to these variables.
