Add Points/Offer for Texting a Keyword
In this article, you will learn how to automate giving points or offers for texting in a Keyword. You will use Spendgo’s Add Rewards API combined with Infobip Moments and Flows.
Campaign Examples
Text CUPCAKE to get a Free Cupcake
Promote new menu items for a limited time.
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.
Members who first join by texting a keyword – as in, texting the keyword to your number is their first interaction with your program – are also added to the Spendgo system as a Starter member. The member does not have to double opt-in to become a Starter member.
You do not have to wait until the member has double opted-in to SMS to add points or offers to their account. However, if you want to target members who are also subscribed to SMS with the points of offer, include the optional step #10 in your flow set up.
When adding an offer, first create a Date & Time offer campaign that is targeted to an audience with zero members. This offer will only be issued via the Spendgo Add Rewards API when triggered within the Flow.
Create a Text Keyword to Add Points/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.
In your Infobip portal, navigate to Moments / Communications.
Click Create Flow button
Choose + Start from Scratch.
Choose Trigger as the way your audience will enter your flow.
Choose the Inbound Message trigger.
Open the SMS card to define conditions.
Select your number as the To Recipient.
Define the Condition 1 to be Message body | Matches text | and then enter the exact inbound Keyword to add points when received and click Close.
Click the → right arrow to add an element.
OPTIONAL STEP To target text subscribers with the points/offer.
Select the Segment Audience.
Click + Attribute.
Enter the attribute condition text_optin | is | OptedIn and click Close.
Click the → right arrow next to your segment condition to add an element.
Select the Call API element.
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>Enable escaping of URL parameters (by default this is checked).
Choose the Method as Post.
Choose the Body / Data Format as JSON.
Enter the JSON code in the input field…
To add points, copy paste the following code:
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 } ] }
To add an offer, copy paste the following code:
First, locate your Campaign Id in the Campaigns / Manage section of the Spendgo Dashboard.
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 } ] } ] }
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.
Search msisdn and select the attribute.
The {msisdn} will change from a regular to bold font style. Click Close.
OPTIONAL STEP Send an SMS notifying your member of their added points. If you don’t want to send a message, skip ahead to step #20.
Click the → right arrow of the Call API element to add another element.
Select the Send SMS element.
Select your From number you will be sending the message from.
Enter your message Content.
Click Close at the bottom of the SMS panel.
Name your Flow at the bottom of the flow builder screen.
Click Flow Settings at bottom right of screen.
In the Frequency section, make the Flow reenter disabled so members can only enter the flow once and earn the offer once.
Within Flow Settings, click on Scheduling.
(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 end date time. If no schedule is set, it will default end 90 days after its been launched.Click the Validate button.
Click the Launch Now button.