# Get Started with the Swagger

Set up API Key first

Before you get started with the API Swagger you have to create your Authentication Token or API Key first in NMKR Studio. Depending on the network you are going to use, you need to [**create an API Key**](https://docs.nmkr.io/nmkr-studio/account/api-keys) **in either the** [**testnet account**](https://studio.preprod.nmkr.io/login/)**, or the** [**mainnet account**](https://studio.nmkr.io/login/)**.**

### Global Page Authentication

The first action before you can try it out, is to add your API key in the global page authorisation panel. If you do not do this, you will ALWAYS receive a 401 Error when using Swagger UI.

To do this, navigate to the top right of the page and select the 'Authorize' Button. You will then be greeted by a pop up, where you should copy and paste your [API Key](https://docs.nmkr.io/nmkr-studio/account/api-keys#manage-your-api-keys) mentioned previously.

<figure><img src="https://content.gitbook.com/content/bv1NlCoA0UqqILhTF1t0/blobs/SeKPxPLzBFxDgFoGTeQs/Screenshot%202022-12-02%20at%2001.06.35.png" alt=""><figcaption></figcaption></figure>

### Example Workflow - Try it out!

#### 1) Select the Endpoint

Click on the Endpoint to expand more details and to test the Endpoint

<figure><img src="https://content.gitbook.com/content/bv1NlCoA0UqqILhTF1t0/blobs/hV6L3GadToYZ3OTye2rj/Screenshot%202022-12-02%20at%2001.09.55.png" alt=""><figcaption></figcaption></figure>

#### 2) Activate the panel

Click "Try it out" to activate the panel.

<figure><img src="https://content.gitbook.com/content/bv1NlCoA0UqqILhTF1t0/blobs/ECGHwlsJurPDY5C9k9A1/Screenshot%202022-12-02%20at%2001.11.52.png" alt=""><figcaption></figcaption></figure>

#### 3) Add the requested details

If the Authorization is requested, please make sure that it is the same as you specified as [global authentication](https://docs.nmkr.io/nmkr-studio-api/api-swagger/get-started-with-the-swagger#global-page-authentication) and then click on "Execute".

<figure><img src="https://content.gitbook.com/content/bv1NlCoA0UqqILhTF1t0/blobs/dJz2ILll28Ny2PCpOnui/Screenshot%202022-12-02%20at%2001.15.02.png" alt=""><figcaption></figcaption></figure>

#### 4) Responses

The NMKR Studio API will respond a) with the Curl and b) with the Request URL

<figure><img src="https://content.gitbook.com/content/bv1NlCoA0UqqILhTF1t0/blobs/pF2uhUhyIS9We2UvBfN8/Screenshot%202022-12-02%20at%2001.17.59.png" alt=""><figcaption></figcaption></figure>

And it will also respond with some Codes. Please read the [Swagger Responses and Error Codes](https://docs.nmkr.io/nmkr-studio-api/api-swagger/swagger-responses-and-error-codes) to understand what they mean. \
\
The following is a response that says that the call is \
A) invalid; Reason: "Wallet address already exists".

<figure><img src="https://content.gitbook.com/content/bv1NlCoA0UqqILhTF1t0/blobs/yUomkW0mIzZLTkPfIGNJ/Screenshot%202022-12-02%20at%2001.21.41.png" alt=""><figcaption></figcaption></figure>

B) valid and executed.

<figure><img src="https://content.gitbook.com/content/bv1NlCoA0UqqILhTF1t0/blobs/BAtthAlYr3ZvMLEKvMcb/Screenshot%202022-12-02%20at%2001.23.51.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Please keep in mind that if you upload the metadata in a payload, the metadata must be escaped. \
[Online JSON Escape /Unescape Tool](https://www.freeformatter.com/json-escape.html#before-output)<https://www.freeformatter.com/json-escape.html#before-output>
{% endhint %}
