简体   繁体   中英

Mobilefirst 8.0 push notification API - Push Device Registration (POST)

I am referring to the documentation on the MobileFirst Server push service REST API for Push Device Registration (POST). From the document ( https://www.ibm.com/support/knowledgecenter/SSHS8R_8.0.0/com.ibm.worklight.apiref.doc/rest_runtime/r_restapi_push_device_registration_post.html ), the payload looks like this

{
  "deviceId" : "12345-6789",
  "phoneNumber" : "123456789",
  "platform" : "A",
  "token" : "xyz",
}

I can see that the description for token is "Device token obtained via the service provider" but i still do not understand where i am supposed to obtain this token from.

Is there some other api i need to call to get this "token"? If so, what is the API? If not, then where am i supposed to get this from?

The device token is provided by the push notification cloud providers like GCM,APNS. When app is installed on mobile device, then the push sdk communicates with the push notification cloud providers(Gcm, apns) and receives the token.

When the device is registered with mobilefirst server, then this token is sent to the mobilefirst server and stored in database.

So there is no other api which can be used to get this token

Acquiring access tokens

To obtain an access token, the confidential client sends an access-token request with the "client_credentials" grant type, as described in the OAuth specification. The token request is an HTTP POST request that is sent to the URL of the token endpoint. The URL pattern for accessing the token endpoint is as follows (replace the <...> placeholders with your custom data):

http(s)://<server_ip>:<server_port>/<project_name>/api/az/v1/token

In the request, include the HTTP authorization header. The authorization server uses this header to authenticate the confidential client.

For more detail see: https://www.ibm.com/support/knowledgecenter/en/SSHS8R_8.0.0/com.ibm.worklight.dev.doc/dev/c_non_mobile_to_mobile_services.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM