Make: send SMS and receive statuses
One scenario sends an SMS with the HTTP app. A second scenario receives signed status webhooks from SendHarbor.
What you need
- A Make account.
- A SendHarbor API key with the right messages:send. A sandbox key is enough for the first test.
- For real SMS, the phone ID of your connected Android phone.
No account or key yet? The quick start creates an account, connects your Android phone and shows ready code for this tool with your key. Quick start on your phone
Scenario 1: send an SMS
-
Add the HTTP module
After your trigger, add HTTP → Make a request. Set Method to POST and URL to the address below.
URL https://sendharbor.app/api/messages -
Add the API key
Set Authentication type to API key and create a keychain. In Key, enter Bearer, a space and your key. Set API key placement to In the header and API key parameter name to Authorization.
Check: the new keychain is selected in Credentials.
-
Write the body
Set Body content type to application/JSON and Body input method to JSON string. Paste the body below and map your fields in place of the sample values.
Body content { "deviceId": "DEVICE_ID", "phone": "+15551234567", "text": "Your order 1042 is ready for pickup.", "idempotencyKey": "order-1042-ready", "externalId": "order-1042-ready" }If the text can contain quotes or line breaks, choose Data structure instead, or build the body with JSON → Create JSON. Make then escapes the values.
Build idempotencyKey from your record ID and the event. Do not use the current time or a random value: a repeated run with the same key returns the same message and sends no second SMS.
Set Parse response to Yes.
-
Run it once
Click Run once with a test record and your own number.
Check: the HTTP module returns status code 202 and a message with an id.
Testing in the sandbox
Use a sandbox key, the sandbox address and the body below. With emitWebhook the sandbox also sends a signed sandbox.message.status event to the webhook from scenario 2.
Set up scenario 2 first. Until the webhook is connected, such a sandbox message waits with the reason sandbox_webhook_unavailable.
{
"deviceId": "sandbox-phone",
"phone": "+15551234567",
"text": "Your order 1042 is ready for pickup.",
"idempotencyKey": "order-1042-ready",
"emitWebhook": true
}
Scenario 2: receive statuses
-
Create a custom webhook
Start a new scenario with Webhooks → Custom webhook and add a webhook. In its advanced settings, set Get request headers and JSON pass-through to Yes. Copy the webhook address.
Check: Make shows the webhook address and waits for data.
-
Connect it in SendHarbor
In the workspace, open API and webhooks. Paste the Make address into Your project webhook URL, tick Enable project connection and click Save settings. Copy the secret: it is shown once.
Click Run once in Make, then Send test event in SendHarbor.
Check: Make receives a bundle with headers and a text value that contains integration.test.
-
Check the signature
Add Tools → Set variable after the webhook. Name the variable signed. Its value is the timestamp header, a dot and the body text, with nothing in between:
Variable value (module 1 is the webhook) {{first(map(1.headers; value; name; x-sms-timestamp))}}.{{1.value}}Then add a filter after Set variable with these three conditions, all of which must be true:
Filter conditions (module 2 is Set variable) 1. sha256={{sha256(2.signed; hex; YOUR_WEBHOOK_SECRET)}} Text operators: Equal to (case sensitive) {{first(map(1.headers; value; name; x-sms-signature))}} 2. {{first(map(1.headers; value; name; x-sms-timestamp))}} Numeric operators: Greater than {{formatDate(addSeconds(now; -300); X)}} 3. {{first(map(1.headers; value; name; x-sms-timestamp))}} Numeric operators: Less than {{formatDate(addSeconds(now; 300); X)}}Use the header names exactly as the bundle shows them. Anyone who can edit the scenario can see the secret in the filter.
Check: the test event passes the filter. Change one character of the secret, send the test again, and the filter must stop it.
-
Read the event
Add JSON → Parse JSON for the body text. A message.status event carries data.messageId, data.externalId and data.status.phase. Process each event id once and ignore a status.sequence lower than the one you saved.
Check: after a sandbox or real send, the scenario receives the phase sent or delivered.
-
Turn the scenario on
Turn on scheduling so the scenario runs as soon as data arrives. Make answers 200 when it accepts a request, so SendHarbor marks the event as delivered. Look for failed runs in the scenario history.
If the signature never matches
- Copy the secret again: it changes when you issue a new one in SendHarbor.
- The variable must hold the body exactly as received. Check that JSON pass-through is on and that nothing is added around the dot.
- If Make changes the body in your account, check the signature on your own server instead, as shown on the integrations page.