2

the REST API documentation for Bluemix Push Notification services states that the possible push notification targets are deviceIds, platforms, tagNames and userIds.

I don't understand how you register a userId for a device ? I don't see any REST service that seem to take a userId in its inputs...

Thanks for your help,

Sebastien

James Young IBM
  • 616
  • 1
  • 5
  • 13
Sebastien Brunot
  • 431
  • 2
  • 10
  • 1
    Can you please clarify specifically which Push Notification service you are using? There's "IBM Push Notifications" (sometimes imfPush) and there is "Push". Sorry for the confusing nomenclature, if your Push service icon is grey then it is "Push". – James Young IBM Dec 01 '15 at 14:36
  • I'm talking about IBM Push Notifications (the last version of the service) – Sebastien Brunot Dec 03 '15 at 13:30
  • I know the old Push had consumerIds that were set client-side when registering, investigating how that was migrated to the new stuff because I'm not seeing it in the current api. What piece of documentation specifically are you looking at? – James Young IBM Dec 03 '15 at 14:14

1 Answers1

1

There is a deviceId that you can set from the REST API when using the POST devices call to register a device.

In the DeviceRegResponseModel is userId (string, optional): The user identifier for the the device registration

So essentially to set a userId you'll just want to add that to the json you send when registering a device through the REST API. So just modifying the example the REST API gives for the body:

{
  "deviceId": "TestDeviceId",
  "platform": "A",
  "token": "************",
  "userId": "John"
}

And then you can use the POST messages call with "userId": "John" in your target body to send that message to all devices registered with the userId "John".

Hope this helps.

Community
  • 1
  • 1
James Young IBM
  • 616
  • 1
  • 5
  • 13
  • Thanks a lot, that helps ! I guess that the documentation of the body schema for the POST and PUT methods should be updated accordingly. – Sebastien Brunot Dec 04 '15 at 10:51
  • Yep, I've issued a request to our documentation team to have everything updated. Thanks for bringing this to our attention. – James Young IBM Dec 04 '15 at 16:24