Integrating Snappysas into your application using the API gives you the greatest flexability. Just follow these easy steps:
Your API key uniquely indentifies your account and application.
There are three pieces of functionality that you'll need to implement in your application in order to allow Snappysas to deliver in-app messages inside of your app. This includes displaying messages to users, allowing users to dismiss messages, and allowing users to like messages.
To obtain messages, make the following request in your application:
POST https://api.snappysas.com/messagefeed/messages/feed
Your request should include the following header (be sure to replace the [[API-KEY-PLACEHOLDER]]
placeholder with the API key you previously obtained):
Authorization: [[API-KEY-PLACEHOLDER]]
Your request will also need to include the following JSON body:
{ 'id': '[[USER-ID-PLACEHOLDER]]', 'name': '[[NAME-PLACEHOLDER]]', 'user-time': '[[USER-TIME-PLACEHOLDER]]' }After including the default body above, you will need to set up user attributes. These user attributes should be dynamically populated for each user who uses your application. They provide context about the user, which will eventually be used for your targeted messaging campaigns.
[[USER-ID-PLACEHOLDER]]
placeholder with an ID that will uniquely identify the current user. This ID must remain the same forever and no two users can have the same ID. SECURITY TIP: read the best practices security considerations to select a safe ID.[[NAME-PLACEHOLDER]]
placeholder with the user's real name. This field is not required, but is highly recommended (you should remove the attribute if you choose not to use it).[[USER-TIME-PLACEHOLDER]]
placeholder with the user's local time. This field is not required, but is highly recommended (you should remove the attribute if you choose not to use it).To allow a user to like a message, submit the following request after replacing the [[MESSAGE-ID]]
placeholder:
POST https://api.snappysas.com/messagefeed/messages/dismiss/[[MESSAGE-ID]]
Your request should include the following header (be sure to replace the [[API-KEY-PLACEHOLDER]]
placeholder with the API key you previously obtained):
Authorization: [[API-KEY-PLACEHOLDER]]
To allow a user to like a message, submit the following request after replacing the [[MESSAGE-ID]]
placeholder:
POST https://api.snappysas.com/messagefeed/messages/like/[[message_ID]]
To unlike the message, submit the following request after replacing the [[MESSAGE-ID]]
placeholder:
POST https://api.snappysas.com/messagefeed/messages/unlike/[[MESSAGE-ID]]
Both requests should include the following header (be sure to replace the [[API-KEY-PLACEHOLDER]]
placeholder with the API key you previously obtained):
Authorization: [[API-KEY-PLACEHOLDER]]