Skip to main content

Quickstart

Welcome to MARCO docs! This guide provides step-by-step instructions on creating your first distributed app and obtaining tokens to interact with our APIs.

Prerequisites

Before diving in, ensure you have a MARCO account:

  • If your organization is already on MARCO, you can get an invitation through Send invitations.

  • If your organization is not on MARCO, you can request a demo account through our Contact page. Our team will contact you to discuss your needs and initiate the account creation process.

Once you receive the invitation, follow the registration link provided in the email from MARCO to complete the registration process.

1. Create an application

The first step involves registering your first distributed application within the MARCO platform, commonly referred to as Marpp.

To create a Marpp, follow these steps:

  1. On MARCO Console, go to Applications > Marpps > Create application:

    Marpp registration

  2. Set a name for the application. For example, My first Marpp.

  3. Click Register Application.

  4. Copy and save the Application ID and Application Token:

    Marpp registration

You will use the application ID and token to reference your application in API requests.

2. Create a service account

Next, you need to register a service account, which authenticates your computer as an authorized user for API requests.

To create a service account, follow these steps:

  1. On MARCO Console, go to IAM > Service accounts > Create account:

    Service account registration

  2. Set a name for the account.

  3. Click Register Service Account.

    danger

    It's crucial to keep service account credentials secret. Sharing these credentials can compromise the account and associated resources. If you suspect a service account has been compromised, you can deactivate it from the Service accounts section of the MARCO Console.

  4. Copy and save the service account Email:

    Service account email

  5. Open the Service Account API Keys tab.

  6. Click Generate API Key.

  7. Copy and save the service account API Token:

    Service account token

3. Grant permissions to the service account

To let the service account act on behalf of the application, follow these steps:

  1. On MARCO Console, go to IAM > Service accounts > List accounts:

  2. Select your service account.

  3. Go to the Service Account Marpp Access Control tab.

    Marpp permissions

  4. In the Select Marpp field, choose your target Marpp.

  5. Assign a role for the Marpp, such as FULL_ACCESS or a more restrictive option. For more information, see Privileges.

4. Create an access token

Finally, you will generate an access token by combining your service account API key and application ID. This access token is required for most API calls and follows the bearer token authentication scheme.

To get an access token, follow these steps:

  1. On a terminal window, run the following curl command:

    curl -X POST "https://api-marco.finboot.com/v1/auth/token" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -d "client_id=<APPLICATION_ID>" \
    -d "client_secret=<API_TOKEN>" \
    -d "grant_type=client_credentials" \
    -d "service_account=<SERVICE_ACCOUNT_EMAIL>"

    Replace APPLICATION_ID, API_TOKEN, and SERVICE_ACCOUNT_EMAIL with the values you retrieved from previous steps.

    1. Copy and save the access_token value from the response:
    {
    "access_token": "eyJra...w4lqw",
    "token_type": "Bearer",
    "expires_in": 299
    }
    caution

    The access token has a lifespan of 300 seconds (5 minutes) To maintain uninterrupted use of the API, generate a new access token each time the current one expires.

Next steps

Great work! You now have an application, a service account, and an access token, ready to interact with the MARCO API. For more information on using the access token to authenticate API calls, see HTTP Requests.

To continue learning about MARCO, explore the following documentation:

  • Concepts: Gain a deeper understanding of MARCO's architecture and main features.
  • Guides: Learn how to use the MARCO Platform to build ledger agnostic applications.
  • API Reference: Discover the REST APIs to integrate MARCO into your own applications and services.