Social Media ‐ Create Social Media Call to Action - kangaroorewards/api-docs GitHub Wiki
In this tutorial, you will learn how to create a social media call to action through the Kangaroo Rewards API.
Objective: To demonstrate the process of creating a social media call to action via the Kangaroo Rewards API.
Prerequisites:
- Basic understanding of APIs and HTTP requests.
- A registered business account with Kangaroo Rewards.
- An API client like Postman or cURL installed.
- An OAuth2 App registered with Kangaroo Rewards
- A valid Access Token
First, ensure you have your API access key and X-Application-Key from Kangaroo Rewards. This key is necessary for authenticating your API requests.
export ACCESS_KEY="YOUR_ACCESS_KEY_HERE"
export APPLICATION_KEY="YOUR_APPLICATION_KEY_HERE"
For instructions on issuing an access token, please refer to this tutorial link.
To create a Create Social Media CTA, make a POST request to the appropriate endpoint, including the necessary information.
Note: You can only have one Social Media Call to Action active per Social Media platform action_id.
curl -X POST "https://api.kangaroorewards.com/call-to-actions" \
-H "Authorization: Bearer <ACCESS_KEY>" \
-H "X-Application-Key: <APPLICATION_KEY>" \
-H "Accept: application/vnd.kangaroorewards.api.v1+json;" \
-H "Content-Type: application/json" \
-d '{
"action_id": 4,
"points": 10
}'
- action_id: Required - The call to action platform ID associated to the desired Social Media Platform.
- points: Required - The amount of points to reward for the desired social media CTA.
Response sample:
{
"data": {
"id": 1,
"enabled": true,
"points": 10,
"result_freq": null,
"result_count": 0,
"action_freq": null,
"action_count": 1,
"action_duration_min": 0,
"action_duration_unit": null,
"conditions": null,
"action_id": 4,
}
}
In this tutorial, we demonstrated how to create a social media call to action using the Kangaroo Rewards API. We provided a step-by-step guide, including how to set up the amount of points to reward for the desired social media platform. Additionally, we highlighted that the business can only have one active social media call to action per connected social media platform. By following these instructions, users can efficiently manage their Social media Call to Action events.
- Always store your client secret and access token securely and never expose them in your source code.
- Handle API responses appropriately, including error handling to manage failed requests.
- Limit the number of API requests to avoid exceeding your quota.
- Ensure your Access Token is correct, isn't expired and has the necessary permissions.
- Check the API endpoint URLs for any typos.
- Double check all the required headers are present including Content-Type and Accept.
- Review the error messages returned by the API for clues on what went wrong.