Test with Postman
This page is a step-by-step guide with screenshots. Follow the steps in order. Select a picture to open it at full size.
Postman gives you two collections in one public workspace. Part 1, Try our API, sends signed test events to the MarsX sandbox, so you see a real 202 before you write sender code. Part 2, Check your endpoints (optional), calls the four endpoints, if you host them, the way MarsX does, so you can fix problems before MarsX runs its tests.
The workspace is MarsX Lead Intake API. Fork the collections and environments there, or download the files on this page and import them. See Without the Postman website.
Part 1: Try our API
Section titled “Part 1: Try our API”The collection sends nine requests to the sandbox. Its script signs every event, refuses a base_url that is not https, and does not follow redirects. It takes about 10 minutes.
Files: collection and sandbox environment.
Before you start, collect the four values from the sandbox console: connection (the connection reference), signing_secret (the Signing secret), status_client_id (the Status client ID) and status_client_secret (the Status secret). The last three are in the dialog Your test key, shown once when you choose Make a test key.
1. Open the workspace
Section titled “1. Open the workspace”Open the MarsX Lead Intake API workspace in your browser. The sidebar lists two collections, and below them the two environments. Badge 1 is the sandbox collection, used in Part 1. Badge 2 is the endpoint check, used in Part 2.

2. Open the menu of the sandbox collection
Section titled “2. Open the menu of the sandbox collection”Click the three dots (...) next to MarsX Lead Intake API: sandbox. Choose Fork.

If your menu shows Use / Fork instead of Fork, choose Use / Fork. Newer Postman versions use that name.

A Use panel then opens, instead of the form in step 3. Keep Fork selected under Use as. Fill in the panel in the order of the badges:
- Badge 1, Workspace. Choose your own workspace.
- Badge 2, Fork label. Type a name, for example
Sandbox tests. - Badge 3, Environments to fork. Select MarsX sandbox.
- Badge 4. Tick Pull changes from the source collection automatically. This brings in MarsX’s later updates.
- Badge 5. Click Use Collection. Then go to step 4.

3. Complete the Fork form
Section titled “3. Complete the Fork form”If the Fork collection form opens, fill it in the order of the badges:
- Badge 1, Fork label. Type a name, for example
Sandbox tests. - Badge 2, Workspace. Choose your own workspace.
- Badge 3, Environments to fork. Select MarsX sandbox.
- Badge 4. Click Fork Collection.

4. Check that the environment came along
Section titled “4. Check that the environment came along”With the newer Use panel, Postman sometimes does not copy the environment, even when you selected one. In your own workspace, open Environments. If MarsX sandbox is there, go to step 5.
If MarsX sandbox is missing, fork it on its own. Go back to the MarsX workspace. Under Environments in the sidebar, click the three dots next to MarsX sandbox. Choose Fork. In the form that opens, choose your own workspace.

5. Type your four values into the environment
Section titled “5. Type your four values into the environment”Open your forked MarsX sandbox environment. Type the four values from Concour into the Value column, as the badges show. base_url and lead_prefix are already set. Leave them as they are.
A value that you typed shows no cloud icon, so it stays on your computer. Keep it that way. Never press Share on this environment.
- Badge 1.
connection. - Badge 2.
signing_secret. It shows as dots. - Badge 3.
status_client_id. - Badge 4.
status_client_secret. It shows as dots.

6. Select the environment
Section titled “6. Select the environment”Click the environment picker at the top right (badge 1). Choose MarsX sandbox (badge 2). Your fork label may show beside the name.

7. Open the Runner
Section titled “7. Open the Runner”Click the three dots next to your fork of MarsX Lead Intake API: sandbox. Choose Run. The same menu holds Pull changes, which you use to get MarsX’s later updates.

8. Start the run
Section titled “8. Start the run”Keep all nine requests selected, in their order. The Runner shows “9 of 9 selected” (badge 1). Click Start run (badge 2). A run takes about half a minute.

9. Read the results
Section titled “9. Read the results”When the run ends, read the totals. The target is All tests 26, Passed 26, Failed 0. Click a request to see MarsX’s answer on the right. The picture shows a 202 with "result": "accepted".

Each run uses new lead ids, so you can run it again. Compare each request with this table:
| Request | Expected |
|---|---|
1. lead.new |
202, accepted |
2. Same webhook-id again |
202, duplicate |
3. lead.update, revision 2 |
202, accepted |
4. lead.withdraw |
202, accepted. Request 3 may read quarantined |
5. lead.delete, second lead |
202, accepted |
6. Scenario 503 |
503, Retry-After: 1 |
7. Scenario drop-202 |
504, Retry-After: 1 |
| 8. Status token | 200, Bearer token |
| 9. Status read of request 1 | 200 with a processing_state: queued at first, then applied |
Every test should pass. Request 3 may read quarantined because the withdrawal in request 4 restricts the lead. This is intended. See Revisions and privacy events.
The collection does not replace sandbox steps 1 and 4. Check your signing code offline against the test vector, and send a bad signature and an old timestamp yourself. See Test in the sandbox.
Part 2: Check your endpoints (optional)
Section titled “Part 2: Check your endpoints (optional)”This part is optional. Do it only if you host the four endpoints. Going live does not need them. Do this once your four endpoints run in your sandbox: the OAuth token URL, GET /v1/changes, GET /v1/privacy-events and GET /v1/leads/{partner_lead_id}. The second collection calls them the way MarsX does and shows where they differ from the contract. This collection only calls your sandbox, never a MarsX host.
MarsX still runs its own tests afterwards (Test your endpoints). Run this check before you ask for them.
Files: collection and environment. In the workspace they are MarsX Lead Intake API: check your endpoints and MarsX endpoint check.
1. Fork the endpoint check
Section titled “1. Fork the endpoint check”Fork the collection MarsX Lead Intake API: check your endpoints. It is badge 2 in Part 1, step 1. Use the same menu and form as in Part 1, steps 2 and 3. In the form, select the environment MarsX endpoint check. If the environment does not come along, fork it on its own, as in Part 1, step 4.
2. Fill in the environment
Section titled “2. Fill in the environment”Open your MarsX endpoint check environment. Use your sandbox and invented data. Fill in the four groups, as the badges show:
- Badge 1.
partner_base_urlandpartner_token_url: the addresses of your sandbox. - Badge 2.
marsx_client_idandmarsx_client_secret: the read-only OAuth client you will give MarsX.scopeis your read scope,leads:readunless you named another. - Badge 3.
test_lead_idis a live lead.withdrawn_lead_idis a lead you hold that withdrew consent or asked for restriction.erased_lead_idis a lead you erased and no longer hold. - Badge 4.
expired_changes_cursorandexpired_privacy_cursor: the two cursors that always answer410, one per feed. You give MarsX the same two for test R4.

Type the client secret as in Part 1, step 5, and never press Share. The two addresses must start with https://. Only http://localhost and http://127.0.0.1 are allowed over plain http, for local testing. For any other address, the collection sends nothing. It never follows a redirect, and a 3xx answer fails a test.
3. Select the environment and run
Section titled “3. Select the environment and run”Select MarsX endpoint check at the top right, as in Part 1, step 6. Open the Runner and start the run, as in Part 1, steps 7 and 8. Keep all requests selected, in order.
Request 1 fetches the token that the other requests use. Request 4 pages through the whole changes feed, so one single send reads one page only.
| Request | What it checks | MarsX test |
|---|---|---|
| 1. Token: valid client | 200 with access_token, token_type Bearer and expires_in between 300 and 86400 |
All |
| 2. Token: wrong secret | 401 with invalid_client |
All |
3. changes: first page |
200, the ChangesPage shape, a non-empty next_cursor, a default page size of at least 100 |
R1 |
4. changes: page through the whole feed |
limit=500 until has_more is false: oldest first, no repeated partner_lead_id and source_revision pair, next_cursor on the last page |
R2 |
5. changes: limit above the maximum |
400 for limit=999999 |
R2 |
6. changes: expired cursor |
410 with the problem type urn:marsx:problem:cursor-expired |
R4 |
7. privacy-events: first page |
200, the PrivacyEventsPage shape, no contact or profile data in any item |
R1, R3 |
8. privacy-events: expired cursor |
410 with urn:marsx:problem:cursor-expired |
R4 |
9. leads: a live lead |
200, the LeadData shape, source_revision and updated_at present |
R1, R2 |
10. leads: a withdrawn lead |
200 with the withdrawal form and no contact data |
R1 |
11. leads: an erased lead |
404 as application/problem+json |
R3 |
| 12. No token | 401 and no feed data |
All |
| 13. Bad token | 401 |
All |
4. Read the results
Section titled “4. Read the results”When the run ends, read the totals. The target is Passed 90, Failed 0.

If a test fails, select the Failed filter. Each failure names the request and gives the status expected and the status received. In the picture below, requests 6 and 8 got 400 where 410 was expected. Request 11, an erased lead, got 200 where 404 was expected.

Compare each failed request with the pages that describe the endpoint: Token URL, Changes and privacy events and Lead lookup. Fix the difference. Then run the collection again.
The collection cannot check test R5 (the privacy list after an expired privacy-events cursor), or a valid token without the scope getting 403. It cannot check your request limits either. Nor can it check whether 1,001 or more changes with one updated_at survive a restart between pages. MarsX checks those.
5. Hand over to MarsX
Section titled “5. Hand over to MarsX”When every request passes, give MarsX your base URL, token URL and read-only client in Concour, under Your endpoints (the secret is saved and never shown again). Seed the data for tests R1 to R5. See Test your endpoints.
Without the Postman website
Section titled “Without the Postman website”To skip forking, import the files. In Postman, choose Import and select the collection and its environment. Then follow the steps from Part 1, step 5. Insomnia and Bruno import Postman collections too, but their script support differs, so check them against the test vector on Sign requests.
Run it from the command line
Section titled “Run it from the command line”The command lines run the same files. Newman is the command-line runner for Postman collections. Download both files into one folder, then run:
npx newman run marsx-lead-intake.postman_collection.json -e marsx-sandbox.postman_environment.jsonThe downloaded environment has empty secrets. Supply them with --env-var, and read them from your shell so they stay out of files:
npx newman run marsx-lead-intake.postman_collection.json \ -e marsx-sandbox.postman_environment.json \ --env-var "connection=$MARSX_CONNECTION" \ --env-var "signing_secret=$MARSX_SIGNING_SECRET" \ --env-var "status_client_id=$MARSX_STATUS_CLIENT_ID" \ --env-var "status_client_secret=$MARSX_STATUS_CLIENT_SECRET"The Postman CLI runs the same files from disk. Add --no-report-events, so that it uploads no report:
postman collection run marsx-lead-intake.postman_collection.json \ -e marsx-sandbox.postman_environment.json --no-report-eventsGet MarsX’s updates later
Section titled “Get MarsX’s updates later”If MarsX changes a collection, click the three dots next to your fork. Choose Pull changes. The menu is the one in Part 1, step 7.
Troubleshooting
Section titled “Troubleshooting”- The menu says Use / Fork, not Fork. Choose Use / Fork. Part 1, step 2 shows the panel.
- The environment is missing after forking. Fork it on its own. Part 1, step 4 shows how.
- A request is red. Open it and read the line that starts with FAIL. It gives the status expected and the status received.
- The collection says
base_url must start with https://. It refuses to send anything. Setbase_urltohttps://api-sandbox.marsx.media. In Part 2, the same rule applies topartner_base_urlandpartner_token_url.

