I want to use the API to send one to one messages how do I do that?

You will find APIs for sending messages in our detailed API docs in the Campaign methods section. If you want to send messages at a one to one level you will need to be able to identify your users using your UUID or the xtremepush UUID that identifies them. With the right id you will be able to send push notifications to a single device details on both approaches below. 
 
 
Using your UUID
  
To make sure that your UUID is stored with xtremepush and available as an alias to target your users, tag your id up to the platform using our tagging methods with the special syntax shown below:
 
iOS
[XPush hitTag:@"user.external_id" withValue:YOURUUID];
 
Android
mPushConnector.hitTag("user.external_id", YOURUUID);
 
 
You can then send a message to a single user with YOURUUID using. the following API call

curl -X POST -d '{ "apptoken":"YOUR_APPTOKEN", "title":"First ONE-To-ONE Test", "text":"ONE-To-ONE Ping!", "android": {"active":1}, "android": {"active":1}, "externalIDArray":[YOURUUID],' https://xtremepush.com/api/external/create/campaign
 
Note: you can find your app token on the platform in App Settings > General Settings.
 
Using the xtremepush UUID
 
To make sure that the xtremepush UUID is stored with user profiles in your application and available as an alias to target your users, retrieve and send our id up to your system from the mobile app. You can retrieve our id using the methods below:
 
iOS
[XPush deviceInfo]
This method returns a Dictionary that contains an xtremepush UUID as obtained from the XtremePush server.
 
Android
mPushConnector.getDeviceInfo()
This method returns a map that contains your devices GCM registration id and it's device id obtained from XtremePush server
 
 
With the  xtremepush UUID on your system you can then send a message to a single user with XTREMEPUSHUUID using. the following API call

curl -X POST -d '{ "apptoken":"YOUR_APPTOKEN", "title":"First ONE-To-ONE Test", "text":"ONE-To-ONE Ping!", "android": {"active":1}, "android": {"active":1}, "iDArray":[XTREMEPUSHUUID],' https://xtremepush.com/api/external/create/campaign
 
Quickly get a UUID and Test from a Terminal
If you are set up as a Company-Admin for your companies Apps (more on roles and User Access Management here) you will see a section in the Left Navigation called App Lists.

From here you can select App Users to view your test users. Pick an ID for one of your devices  this is the xtremepush UUID. Or click pencil icon (on the right) for your test device to see all IDs for your device this will include your UUID in the external ID field if you have sent it to the platform. 

 
 
Have more questions? Submit a request

0 Comments

Article is closed for comments.