Skip to main content
Skip table of contents

Add Points/Offers for Subscribing to SMS

In this article, you will learn how to automate giving points or offers for subscribing to your text marketing. You will use Spendgo’s Add Rewards API combined with Infobip Moments and Flows.

Things to Know

  • To add points or offers via Infobip, we require you to enable the Spendgo API and Infobip Flows in your account with your Customer Success Manager.


Create an Infobip Flow with Add Points or Offers

The following steps include sample urls and code snippets. These are not functioning requests, please replace any placeholders with your specific environment and campaign goals.

  1. In you Infobip portal, navigate to Moments / Communications.

  2. Click Create Flow button

  3. Choose + Start from Scratch.

  4. Choose Trigger as the way your audience will enter your flow.

  5. Choose the Change in People Profile trigger.

  6. Define your conditions for the entry point trigger:

    1. Enter in Profile Attribute 1 exactly as text_optin | is | OptedIn.

  7. Click Close at the bottom of the Change in people profile panel.

  8. Click the right arrow to add an element.

  9. Select the Call API element.

  10. Enter in the Request URL input your url provided by Spendgo.
    The URL will be formatted like (your exact URL is provided by Spendgo and must be kept secure and not be shared).
    https://webservice.<env_name>.com/v2/loyalty/accounts/rewards?auth=<API_auth_key>

    This image is only a sample of the Request URL, it does not work.

  11. Enable escaping of URL parameters (by default this is checked).

  12. Choose the Method as Post.

  13. Choose the Body / Data Format as JSON.

  14. Enter the JSON code in the input field…

    1. To add points, copy paste the following code:

      1. Replace the 50 value in the below sample, "balance_quantity" : 50 with the point value you want to add to member’s accounts for entering the Flow.

        CODE
        {
            "event_type": "add",
            "customers": [
                {
                    "phone": "+{msisdn}",
                    "category": "Campaign",
                    "source": "Infobp Flow",
                    "details": "Infobip flow",
                    "balance_quantity": 50
                }
            ]
        }
    2. To add an offer, copy paste the following code:

      1. First, locate your Campaign Id in the Campaigns / Manage section of the Spendgo Dashboard.

      2. Second, replace the 16774 value in the below sample, "campaign_id" : "16774" with the Campaign Id of the offer you are adding to your member’s accounts.

        CODE
        {
            "event_type": "add",
            "customers": [
                {
                    "phone": "+{msisdn}",
                    "reason": "one-time",
                    "category": "Campaign",
                    "source": "Infobp Flow",
                    "details": "Infobip Flow",
                    "rewards": [
                        {
                            "campaign_id": "16774",
                            "type": "Offer",
                            "quantity": 1
                        }
                    ]
                }
            ]
        }
  15. In the JSON code, highlight {msisdn} and click {} in the right corner to personalize with placeholders. Please note, the “+” prefix is required, do not remove.

  16. Search msisdn and select the attribute.

  17. The {msisdn} will change from a regular to bold font style. Click Close.

  18. OPTIONAL STEP Send an SMS notifying your memebr of their added points. If you don’t want to send a message, skip ahead to step #20.

    1. Click the right arrow of the Call API element to add another element.

    2. Select the Send SMS element.

    3. Select your From number you will be sending the message from.

    4. Enter your message Content.

    5. Click Close at the bottom of the SMS panel.

  19. Name your Flow at the bottom of the flow builder screen.

  20. Click Flow Settings at bottom right of screen.

  21. In the Frequency section, make the Flow reenter disabled so members can only enter the flow once and earn the offer once.

  22. Within Flow Settings, click on Scheduling.

  23. (Optional) Check the option to Run this Flow indefinitely.
    If you do not set your flow to run indefinitely, you can also set a start or date time. If no schedule is set, it will default end 90 days after its been launched.

  24. Click the Validate button.

  25. Click the Launch Now button.


View Performance

Once launched, when you click to view your Flow, you will not be able to edit its configuration without creating a new version. It will look like the following with the percetages of People who have interacted with the different elements of the Flow.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.