Skip to main content

Set up our Postman collection

This guide will help you create a workspace for experimenting with MARCO APIs using Postman.

Prerequisites

To complete this guide, you will need to have created API Tokens to authenticate your calls. If you don't have them, see Get your API tokens.

1. Fork the MARCO Core API collection

We recommend Postman to make requests to our API from a graphical user interface.

If you have a Postman account, you can fork MARCO Core API by clicking the button below:

Run in Postman

Alternatively, you can interact with MARCO Core API using one of our SDKs.

2. Set up your environment

Once you have forked the API, configure Postman to authenticate the requests:

  1. On Postman, open the Environment tab and choose MARCO Environment.

    Postman environment tab

  2. Complete the following variables with the values you have obtained in Get your API tokens:

    Postman environment values

  3. Save your changes with Ctrl + S.

  4. Set MARCO Environment as the default environment.

    Postman default environment

  5. Select the MARCO APIs collection, and make sure the Authorization Type is set to Bearer and Token to {{accessToken}}.

    Postman authentication

3. Make your first API call

To test your setup, follow these steps to create your first request using an endpoint from the collection:

  1. On Postman, open the endpoint MARCO APIs > MARCO Core > ledgernodes > ledgers > Get a list of all the active ledgers.

  2. On the Params tab, configure the parameters as shown in the image below:

    Postman params

  3. Most endpoints require passing an application token as a header parameter. Before making an API call, set ApplicationToken to {{applicationToken}} on the Headers tab.

    Postman headers

  4. Click the Send button to send the request. You will see the response under the Body tab.

    Postman Environment

tip

In case of any errors, see the API Reference for troubleshooting tips.

4. Generate code snippets

Postman also lets you generate code snippets for your preferred programming language. To do so, click on the code icon in the right panel:

Postman code

Next steps

You are all set! Now that you have your API keys and collection set up, let's make some API calls to learn how to retrieve data from an Ethereum-based ledger.