Backend method

This approach assumes that you generate an opt-in URL on your server side, and then return it to your user.

Send a single message to specific recipient

POST https://a.loopmessage.com/api/v1/opt-in/generate-url/

You can use a contact ID or a phone number/email address (depending on what the user provided you with when subscribing).

Headers

Name
Type
Description

Authorization*

String

API Key. Required*.

Content-Type*

String

application/json

Request Body

Any fields that you pass in the JSON, will be returned in the webhook when user complete the opt-in process.

Request with custom Body example:

{
  "body": "Hey guy, want to test end-to-end analytics a little? [opt-in-code]",
  "click_id": "asdasads1241412fdsf",
  "utm_campaign": "credit on card online",
  "utm_medium": "google"
}

In case of customize opt-in text, you can use the next method:

body with [opt-in-code] is a mandatory parameter. The server replaces [opt-in-code] with a unique user code, which is required by the system to match opt-in with a specific contact.

Response

The API response contains unique links generated for the provided data. Example response:

These links must be used to subscribe the user to the mailing list.

Copy

Key Points

  1. The backend script is mandatory to avoid CORS restrictions.

  2. The response contains links for user interaction:

    • iMessage: For iOS 13 and above.

    • SMS: For iOS 12 and below.

  3. When using smart links (URLs returned by the server), the user must grant the browser permission to open the iMessage app.

Last updated