All integrations

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

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

  1. 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
  2. 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.

  3. 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.

  4. 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.

POST /api/sandbox/messages
{
  "deviceId": "sandbox-phone",
  "phone": "+15551234567",
  "text": "Your order 1042 is ready for pickup.",
  "idempotencyKey": "order-1042-ready",
  "emitWebhook": true
}

Scenario 2: receive statuses

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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

Sources