View on GitHub

Documentation

Neemware Mobile CRM APIs

NOTE: As a pre-requisite for using these APIs, please SIGN UP for Neemware, register your App and obtain your APP KEY.

1. Content API

Overview:

Use this API to retrieve all types of messages associated with a specific user.

Sample Usecase:

If you are implementing a Inbox in your app and would like to retrieve all messages pertained to a specific user (device) you can use this API.

Request:

https://api.neemware.com/1/contents.json

Method:

GET

Required Parameters:

api_key – Your application specific API Key that can be obtained when you register your app.
did – Unique device id

Optional Parameters:

d_make – Make of the device
d_model – Model of the device
d_os – Device OS
d_osv – OS Version
latitude – Latitude
longitude - Longitude

Sample Curl:

curl -i -H "Accept: application/json" https://api.neemware.com/1/contents.json?api_key=<your_api_key>\&did=1234\&d_make=Apple\&d_model=iPhone\&d_os=iPhone+OS\&d_osv=6.0\&latitude=42.37\&longitude=-71.13

Sample Output:

{"uid":375305,"did":"1234","device_model":"iPhone","device_os":"iPhone OS","device_osv":"6.0","unread_count":2,"branding":"Powered by Neemware","message_center_title":"Messages","feedback_button_title":"Feedback","timestamp":1358391787,"update_client":true,  
"contents":[  
{"id":29,"content_subject":"Make a resolution to for your brain work out with Lumosity Brain Trainer","content_icon":"http://a485.phobos.apple.com/us/r1000/091/Purple/v4/4b/59/6a/4b596a21-daf6-08a3-6b8c-b9989135b574/57-sm-sq-icon.png","content_body":"Over 20 million users have trained their brain using Brain Trainer by Lumosity.com...","content_url":"https://itunes.apple.com/us/app/lumosity-brain-trainer/id338945375?mt=8&uo=4","content_type":"promotion","read":false,"banner_also":false,"created_at":1358391736},  

{"id":544,"content_subject":"What features would you like to see in the next version of this app?","content_icon":"api.neemware.com/assets/icons/question_24.png","content_body":"","content_url":"http://api.neemware.com/1/questions/544?api_key=35fa9ed4af9a4e378b24d760ccd4eaff&did=1234","content_type":"question","read":false,"banner_also":false,"created_at":1358391518},  

{"id":268,"content_subject":"Welcome to Neemware !!!","content_icon":"api.neemware.com/assets/icons/message_24.png","content_body":"Simple, open and powerful APIs for Mobile CRM.","content_url":"http://api.neemware.com/1/messages/268?api_key=35fa9ed4af9a4e378b24d760ccd4eaff&did=1234","content_type":"message","read":true,"banner_also":false,"created_at":1358388240}  
]}  

The outer header as meta data about the content such as # of unread messages for this specific user.

Also this particular user has 3 different types of content – a promotion, a question and a message. The message is read by user (“read”:true), whereas the user hasn’t read the promotion and question.

HTTP Status codes for Positive responses:

200 OK

HTTP Status codes for Negative responses:

400 Bad Request – If required parameter (did) is not passed
401 Unauthorized – If api_key is not passed or if a wrong api_key is passed

Sample iOS Code:

NWContentDataStore.m

2. API to retrieve specific content

Overview:

Use this API to retrieve a specific message by ID.

Sample Usecase:

Let us say you want to thank your power users after they take some specific action in your app, you can use this API

Request:

For Messages:
https://api.neemware.com/1/messages/ID(.json/html)
For Questions:
https://api.neemware.com/1/questions/ID(.json/html)
For Promotions:
https://api.neemware.com/1/promotions/ID(.json/html)

Method:

GET

Required Parameters:

api_key – Your application specific API Key that can be obtained when you register your app.
did – Unique device id

Optional Parameters:

d_make – Make of the device
d_model – Model of the device
d_os – Device OS
d_osv – OS Version
latitude – Latitude
longitude - Longitude

Sample Curl:

curl -i -H "Accept: application/json" https://api.neemware.com/1/messages/<your-message-id>.json?api_key=<your_api_key>\&did=1234\&d_make=Apple\&d_model=iPhone\&d_os=iPhone+OS\&d_osv=6.0\&latitude=42.37\&longitude=-71.13  

Sample Output:

{"uid":375305,"did":"1234","device_model":"iPhone","device_os":"iPhone OS","device_osv":"6.0","unread_count":0,"branding":"Powered by Neemware","message_center_title":"Messages","feedback_button_title":"Feedback","timestamp":1358393523,"update_client":true,  
"contents":  
[  
{"id":268,"content_subject":"Welcome to Neemware !!!","content_icon":"api.neemware.com/assets/icons/message_24.png","content_body":"Simple, open and powerful APIs for Mobile CRM.","content_url":"http://api.neemware.com/1/messages/268?api_key=35fa9ed4af9a4e378b24d760ccd4eaff&did=1234","content_type":"message","read":true,"banner_also":false,"created_at":1358388240}  
]  
}  

The subject and body of the message is given by content_url and content_body respectively. The message is also hosted in a URL pointed by content_url. The mobile app can display this URL in a Webview.

HTTP Status codes for Positive responses:

200 OK

HTTP Status codes for Negative responses:

400 Bad Request – If required parameter (did) is not passed
401 Unauthorized – If api_key is not passed or if a wrong api_key is passed

Sample iOS Code:

NWContentDataStore.m
Use /messages, /questions, or /promotions instead of /contents in the above linked example

3. API to mark specific content as read

Overview:

Use this API to mark a specific content as read (by the user).

Sample Use Case:

Let us say you are displaying the content in the inbox, or a specific message as a banner. If a user clicks on a specific message, you can track the click on that message by making a ‘read’ call.

Request:

For Messages:
https://api.neemware.com/1/messages/ID/read
For Questions:
https://api.neemware.com/1/questions/ID/read
For Promotions:
https://api.neemware.com/1/promotions/ID/read

Method:

PUT

Required Parameters:

api_key – Your application specific API Key that can be obtained when you register your app.
did – Unique device id

Optional Parameters:

d_make – Make of the device
d_model – Model of the device
d_os – Device OS
d_osv – OS Version
latitude – Latitude
longitude - Longitude

Sample Curl:

curl -i -H "Accept: application/json" -X PUT -d "api_key=<your-api-key>&did=1234&d_make=Apple&d_model=iPhone&d_os=iPhone+OS&d_osv=6.0&latitude=42.37&longitude=-71.13"  https://api.neemware.com/1/messages/<YOUR-MESSAGE-ID>/read  

HTTP Status codes for Positive responses:

200 OK

HTTP Status codes for Negative responses:

400 Bad Request – If required parameter (did) is not passed
401 Unauthorized – If api_key is not passed or if a wrong api_key is passed

Sample iOS Code:

NWContentDataStore.m

4. API to submit Feedback

Overview:

Use this API to send user feedback to the server.

Sample Use Case:

You care about user feedback. You would like to solicit feedbacks from users, store them and respond to them. Then you need this API.

Request:

https://api.neemware.com/1/feedbacks

Method:

POST

Required Parameters:

api_key – Your application specific API Key that can be obtained when you register your app.
did – Unique device id

Optional Parameters:

rating – Rating given by the user
description – Description provided by the user
email – Email provided by the user

Sample Curl:

curl -i -H "Accept: application/json" -X POST --data "api_key=<your-api-key>&did=1234&rating=5&description=Great+Design&[email protected]" https://api.neemware.com/1/feedbacks  

HTTP Status codes for Positive responses:

201 Created – If the feedback is created successfully in the server

HTTP Status codes for Negative responses:

400 Bad Request – If required parameter (did) is not passed
401 Unauthorized – If api_key is not passed or if a wrong api_key is passed

Sample iOS Code:

NWConnection.m

5. API to record user sessions

Overview:

Use this API to send user length of a user session to the server.

Sample Use Case:

You might have mechanisms in your app to gather time spent by a user in your app. Using this API you can store that session in server.

Request:

https://api.neemware.com/1/sessions

Method:

POST

Required Parameters:

api_key – Your application specific API Key that can be obtained when you register your app.
did – Unique device id
session_length – In seconds

Optional Parameters:

d_make – Make of the device
d_model – Model of the device
d_os – Device OS
d_osv – OS Version
latitude – Latitude
longitude - Longitude

Sample Curl:

curl -i -H "Accept: application/json" -X POST --data "api_key=<your-api-key>&did=1234&session_length=100" https://api.neemware.com/1/sessions  

HTTP Status codes for Positive responses:

200 OK

HTTP Status codes for Negative responses:

400 Bad Request – If required parameter (did) is not passed
401 Unauthorized – If api_key is not passed or if a wrong api_key is passed

Sample iOS Code:

Neemware.m

6. API to register events

Overview:

Use this API to register specific events based on user actions.

Sample Use Case:

If you have a shopping cart in your app and you would like to track all users who ‘Checkedout’ items through their shopping cart. Then you can easily register that specific event through this API.

Request:

https://api.neemware.com/1/events

Method:

POST

Required Parameters:

api_key – Your application specific API Key that can be obtained when you register your app.
did – Unique device id
event_name – e.g. “Checkedout”

Optional Parameters:

d_make – Make of the device
d_model – Model of the device
d_os – Device OS
d_osv – OS Version
latitude – Latitude
longitude - Longitude

Sample Curl:

curl -i -H "Accept: application/json" -X POST --data "api_key=<your-api-key>&did=1234&event_name=Checkedout" https://api.neemware.com/1/events  

HTTP Status codes for Positive responses:

200 OK

HTTP Status codes for Negative responses:

400 Bad Request – If required parameter (did, event_name) is not passed
401 Unauthorized – If api_key is not passed or if a wrong api_key is passed

Sample iOS Code:

Neemware.m