Push Notification
Description
This API is used to send PushNotification to the users who have given their email ID. The App which uses the SalesIQ SDK can route their app specific Notificaitons through SalesIQ server. That is, the info about the users of the App will be present in SalesIQ and hence the application developer can send a notification to the App users using this REST API.
Query Parameters
You can call this API for two reasons:
- To Send Push Notifications :
- email - Email ID corresponding to the visitor to whom PushNotification is to be sent (This email ID should be notified when user is connected to SDK in the app, using setEmail API)
- title - Title for the PushNotification
- message - Message to be shown in Push Notification
- badgecount - The badgecount that has to be set for the App ( This will be added with the existing message count of SDK)
- bundleids - Bundeids of the app for which notification needs to be sent (comma separated list)
- addinfo - This JSON can contain any information in the form of key value pairs. if a image has to be shown in the pushnotification , the URL of the image can be given in the key "imgpath"
Note:
All the above params except "addinfo" are mandatory for sending a Push Notification.
- To clear the badgecount:
- email - Email ID corresponding to the visitor
- badgecount - This param should be set as 0 for resetting badgecount
- bundleids - Bundeids of the app for which badgecount has to be cleared (comma separated list)
Pre-requisite
- A mobile Library should be created in SalesIQ portal for the app's bundleid (separately for iOS and Android)
- The library should be used in the Mobile App
- The credentials for sending PushNotificaitons must be uploaded in the corresponding Mobile Library Configuration
- Push Notification status must be enabled in the Mobile Library Configuration
URL
Copiedhttps://salesiq.zoho.com/api/v1/<screenname>/pushnotificationExample
Copiedhttps://salesiq.zoho.com/api/v1/zylker/pushnotification?email=patricia@zylker.com&message=hello&title=Zylker&badgecount=10&bundleids=com.zylker.test&addinfo={"imgpath":"https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Chat_bubbles.svg/2000px-Chat_bubbles.svg.png"} Success Response
Copied{
"data" : "patricia@zylker.com"
}Error Codes
1. General Error
This error is displayed when the push notification is not sent.code : 2111Error Message : "Unable to send push notification"
2. Visitor not found for the email
This error is sent if there are no visitors found for the given Email ID.code : 2112Error Message : "No Visitor found for the given emailid"
3. Visitor not found for the bundleid:
This error is sent if there are no visitors found for the given bundle ID.code : 2113Error Message : " No Visitor found for the given bundleid"
4. Device not Registered
This error is sent if there are no visitors found for the given Email ID.code : 2114Error Message : "No Device Registered for the Visitor"
5. Push Notifications disabled in Configuration :
This error is sent when the Push Notification Settings for the app in SalesIQ is disabled .code : 2311Error Message : "Push Notification Settings for the app in SalesIQ is disabled "
Error Response - Example
Copied{
"error" :
{
"message": "No Visitor found for the given emailid",
"code": 2112
}
}