Just a Few Steps

Postman is a powerful tool for interacting with certain APIs that is used by many developers, so we want to make it easy for you to use, too.

Follow these steps to start making test requests to the Platform API in our integrations environment — just make sure you’ve signed up for our API first.

  1. Install Postman.
  2. Import MX’s OpenAPI spec.
  3. Add authorization, header, and variable information.
  4. Make your first request.

1. Install Postman

You can download Postman here.


2. Import the Spec

  1. Copy this link to the spec.

  2. Open up Postman and click the Import button on the top left. Select the Link option, paste in the link, and click Continue.

    Import Button
    Paste link

  3. Make sure that the Generate collections from imported APIs option is checked.

    Config 1

  4. Click the Show advanced settings dropdown.

    Config 2

    • Set Request parameter generation to Example.
    • Set Response parameter generation to Example.
    • Set Folder organization to Tags.
  5. Click Import.


3. Add Values for Auth, Headers, and Variables

  1. Get your client_id and api_key from the MX Client Dashboard. You’ll need these to authenticate requests to the Platform API.

  2. Back in your Postman workspace, make sure you are looking at your collections, not your APIs. Then click the three dots next to the MX Platform API and select Edit from the dropdown.

    Authorization

  3. On the Authorization tab, set the Type to Basic, then add your client_id as the username and your api_key as the password.

    Authorization 2

  4. On the Pre-request Script tab, copy and paste the following (these bits of code will ensure that you’re using the correct headers on all your requests from Postman):

    pm.request.headers.upsert({key: 'Accept', value: 'application/vnd.mx.api.v1+json' });

    pm.request.headers.upsert({key: 'ContentType', value: 'application/json' });


    Scripts

  5. On the Variables tab, set the baseURL variable to our integration environment, https://int-api.mx.com, for both the initial value and the current value.

    Variables

    • If any other variables appear here, uncheck them.
  6. Click Save.


4. Make Your First Request

You can see all available requests in our comprehensive API reference. For now, we’re going to make a request to create a user on the MX Platform.

  1. Within the MX Platform API collection in Postman, go to the User folder and click on the Create user request. It will have a a yellow “POST” next to it.

    Send 1

    • You’ll see some details pop up, including an example JSON-formatted request body with fake information in it.
    • You can use the example data provided, or you could enter in whatever data you like in the email, id, or metadata fields, as long as they’re formatted correctly. Leave the is_disabled field set to false.
  2. Click the Send button.

    Send 2

    • You should see a JSON-formatted response appear below the example data, and you should see a status of 200 OK in the response area.

Next Steps

Aggregating data

Now that you’ve created a user and a member, you can start using the powerful features of the API, including aggregation, verification, custom categories, tags, and more.

In the next guide, we’ll take a look at aggregation.