Skip to content

Test in the sandbox

All push tests use made-up data against the sandbox at https://api-sandbox.marsx.media. An event sent there never reaches a dealer. Steps 1 to 6 check your sender. Step 7 is optional: it hands your four endpoints to MarsX for its tests, if you host them.

You make the test key in the sandbox console, not in Concour. A live connection in Concour has no Make a test key, because it holds live keys only.

  1. Get access. MarsX gives your developer access to the sandbox console. If you have no access yet, contact MarsX.

  2. Sign in. Open the sandbox console and enter the email address MarsX gave developer access. The console emails you a code. Enter it. If the code does not arrive, check your Junk and quarantine folders, then contact support.

  3. Make the test key. Open Developers, then API keys, then Make a test key. The Signing secret is shown once, in the dialog Your test key: keep it on your server.

Open the sandbox console

The sandbox console is where test keys are made. It opens the sign-in page. Sign in with the email address MarsX gave developer access: the console emails you a code.

The test key and the live key are separate. The sandbox console shows the connection reference.

  • The sandbox connection reference: conn_ and 16 lower-case base32 characters. The examples use conn_exampleexample22, which is made up.
  • The sandbox signing secret, which starts with whsec_.
  1. Check your signing code offline. Use the test vector on Sign requests. Your code must produce the expected webhook-signature before you send anything.

  2. Send a lead.new. Send the event below. Expect 202 with accepted.

  3. Send the same webhook-id again. Use the same body, envelope timestamp included, and a fresh webhook-timestamp and signature. Expect 202 with duplicate. Nothing new is stored.

  4. Send a bad signature, then an old timestamp. Change one character of the signature. Then sign with a webhook-timestamp more than 300 seconds in the past. Expect 401 each time.

  5. Send a lead.update, then a lead.withdraw. The update needs a higher source_revision. Give the withdraw the next revision, a request_type and a request_reference. Expect 202 each time. Read the note below about the final state.

  6. Cause faults on purpose. Use the x-marsx-sandbox-scenario header, as below. Expect the answers in the table.

  7. Optional: host your four endpoints in your sandbox. Going live does not need them. Then give MarsX the details in Concour and ask it to run its tests. See Test your endpoints.

Every value is made up. Sign it as in Sign requests: the string to sign is the webhook-id, a full stop, the webhook-timestamp, a full stop, then the exact body.

lead.new
{
"type": "lead.new",
"timestamp": "2026-10-01T10:30:00+07:00",
"data": {
"partner_lead_id": "SRC-TEST-0004",
"record_action": "new",
"created_at": "2026-10-01T10:29:30+07:00",
"customer_name": "Contoh Pelanggan Tiga",
"phone": "+6280000000003",
"email": "contoh.pelanggan3@contoh.example",
"source_channel": "website_form",
"contact_consent": "yes",
"consent_time": "2026-10-01T10:29:20+07:00",
"model_interest": "Model A",
"customer_province": "Jawa Barat",
"customer_city": "Kota Bandung",
"preferred_dealer_code": "D0001",
"test_drive_requested": "N",
"enquiry_notes": "Ingin meminta penawaran.",
"campaign": "campaign-test"
}
}

This curl script signs the body and sends it. It needs openssl. --proto '=https' makes curl refuse any URL that is not https, and curl does not follow redirects unless you add -L.

Terminal window
export MARSX_CONNECTION="conn_exampleexample22" # use your own sandbox reference
export MARSX_SIGNING_SECRET="whsec_..." # use your own sandbox secret
BODY='{
"type": "lead.new",
"timestamp": "2026-10-01T10:30:00+07:00",
"data": {
"partner_lead_id": "SRC-TEST-0004",
"record_action": "new",
"created_at": "2026-10-01T10:29:30+07:00",
"customer_name": "Contoh Pelanggan Tiga",
"phone": "+6280000000003",
"email": "contoh.pelanggan3@contoh.example",
"source_channel": "website_form",
"contact_consent": "yes",
"consent_time": "2026-10-01T10:29:20+07:00",
"model_interest": "Model A",
"customer_province": "Jawa Barat",
"customer_city": "Kota Bandung",
"preferred_dealer_code": "D0001",
"test_drive_requested": "N",
"enquiry_notes": "Ingin meminta penawaran.",
"campaign": "campaign-test"
}
}'
WEBHOOK_ID="msg_test_0004"
TS=$(date +%s)
KEY_HEX=$(printf '%s' "${MARSX_SIGNING_SECRET#whsec_}" | openssl base64 -d -A | od -An -tx1 | tr -d ' \n')
SIG=$(printf '%s.%s.%s' "$WEBHOOK_ID" "$TS" "$BODY" | openssl dgst -sha256 -mac HMAC -macopt "hexkey:$KEY_HEX" -binary | openssl base64 -A)
curl --proto '=https' -sS -i \
"https://api-sandbox.marsx.media/v1/sources/$MARSX_CONNECTION/events" \
-H "Content-Type: application/json" \
-H "webhook-id: $WEBHOOK_ID" \
-H "webhook-timestamp: $TS" \
-H "webhook-signature: v1,$SIG" \
--data-binary "$BODY"

The answer is 202 with this body:

202
{"result":"accepted","webhook_id":"msg_test_0004","request_id":"req_..."}

For step 3, run the script again with no change. The webhook-timestamp and signature are fresh, and the body (envelope timestamp included) and webhook-id are the same, so the answer says duplicate. For Node.js and Python samples of the same request, see the Quick start.

A lead.new or lead.update still queued when a lead.withdraw is stored ends quarantined with the reason privacy_marker_set. This is intended: MarsX restricts a lead the moment it stores a privacy event. So the lead in step 5 may never show applied. To see each outcome, use the status read.

You can also send made-up leads from Concour with no code. Open Developers, then Send a test lead. It works on a test connection only: a live key cannot be used there.

  1. Pick an example. The Example event is New, Update, Withdraw or Delete. Send a new test lead first, because an update, a withdraw and a delete change a lead you sent before.
  2. Try a mistake (optional). Choose None, Dealer code not on the list, Phone number not in a valid format, Source record ID missing, Wrong signature or Timestamp too old. For Withdraw and Delete only Wrong signature and Timestamp too old are offered.
  3. Sign with one of your test keys.
  4. Choose Send test lead. The page shows the request MarsX would receive, with the signature hidden, and then What happened, worded as your request log words it.

The lead goes to the sandbox address. It never reaches a dealer, and it is counted as a test. If the page says you are sending test leads too quickly, wait a minute. A test lead sent from Concour does not tick Signature checked: send a signed event from your own system for that. A request refused for its signature is not written to your request log.

In the sandbox, add x-marsx-sandbox-scenario to one request to make MarsX misbehave on that request. Production ignores the header.

Header value What MarsX does What you do
503 Stores nothing. Answers 503 with Retry-After: 1 Retry with the same webhook-id and body for 202
drop-202 Stores the event. Answers 504 with Retry-After: 1 Retry with the same webhook-id and body. You get 202 with duplicate

No other scenario exists. Any other value gives 202. To see 429, send more than 100 requests in 10 seconds. On every retry, use a fresh webhook-timestamp and a fresh signature, and keep the same body. Responses and retries has the full rules.

Run these tests with invented rows that you agree with MarsX first. MarsX confirms each result by email.

Row you add Result in MarsX status
A valid new row Accepted, then Applied
A new row without a required field Rejected
An update with a higher revision Applied
A row with the same revision and other content Set aside: revision_conflict
A withdraw row, then a new row for the same lead Set aside: privacy_marker_set

The shared sheet page explains the sheet and its statuses.

Skip this step if you do not host the four endpoints. Build the four endpoints in your sandbox, with made-up data only. Enter the base URL, the token URL and one read-only OAuth client in Concour, under Your endpoints on the Developers page, and choose Save and check. Seed the data in Test your endpoints. Then email support@marsx.media the two cursor values and a technical contact. MarsX replies within 1 business day.