MPNS Credentials (PUT)
Set MPNS credentials of the application with the application ID, environment, version, keyAlias, keyAliasPassword, and serviceName.
Roles
Users in the following roles are authorized to perform this operation:
- worklightadmin
- worklightdeployer
- worklightmonitor
- worklightoperator
Method
PUT
Path
/management-apis/1.0/runtimes/runtime-name/notifications/applications/application-name/mpnsConf/application-env/application-version/
Example
https://www.example.com/worklightadmin/management-apis/1.0/runtimes/myruntime/notifications/applications/myapplication/mpnsConf/android/1.0/?locale=de_DE
Path Parameters
- runtime-name
- The name of the runtime. This is the context root of the runtime web application, without the leading slash.
- application-name
- The name of the application.
- application-env
- The application environment.
- application-version
- The application version number.
Query Parameters
Query parameters are optional.
- locale
- The locale used for error messages.
Consumes
application/json
Produces
application/json, application/xml, text/xml
Payload
The payload in JSON format has values for keyAlias, keyAliasPassword, and serviceName.
JSON Example
{
"authenticated" : true,
"keyAlias" : "aliasName",
"keyAliasPassword" : "password",
"serviceName" : "wl.ibm.push",
}
Payload Properties
The payload has the following properties:- authenticated
- Returns whether the push configuration is authenticated.
- keyAlias
- The alias is used to access the keystore that is specified in the worklight.properties file.
- keyAliasPassword
- The password for your key alias.
- serviceName
- The common name (CN) found in the MPNS certificate's Subject value.
Response
The status of set MPNS credentials.
JSON Example
{
"productVersion" : {
"productVersion" : "7.0.0",
},
"project" : {
"name" : "PushNotifications",
},
"status" : "Success",
"type" : "SET_MPNS_CREDENTIALS",
}
XML Example
<?xml version="1.0" encoding="UTF-8"?>
<setMPNSCredentialsStatus
status="Success"
type="SET_MPNS_CREDENTIALS">
<productVersion productVersion="7.0.0"/>
<project name="PushNotifications"/>
</setMPNSCredentialsStatus>
Response Properties
The response has the following properties:
- productVersion
- The exact product version.
- project
- Project name.
- status
- The MPNS credentials are saved successfully.
- type
- Transaction type.
The productVersion has the following properties:
- productVersion
- The exact product version
The project has the following properties:
- name
- Name of the project
Errors
403The user is not authorized to call this service.
404 The corresponding runtime is not found or not running.
500 An internal error occurred.