Home > Services & APIs > Engage > Device Messaging

Obtaining Amazon Device Messaging Credentials

Introduction

To use Amazon Device Messaging (ADM), you must be able to uniquely identify your app to Amazon. Amazon provides you credentials for this purpose:

  • API Key(s). ADM uses an API Key to verify your app's identity.
  • OAuth Credentials ("Client ID" and "Client Secret"). ADM uses OAuth credentials to verify your server's identity. Your server presents these credentials to obtain access tokens for sending messages using ADM.

For more information on using OAuth credentials and API Keys, see Understanding ADM, Integrating Your App with ADM, and Requesting an Access Token.

Getting Your OAuth Credentials and API Key

To obtain credentials and enable your app to use ADM:

  1. Create an account on the Amazon Apps & Games Developer Portal and add your app, if you have not already done so.
  2. In Apps & Services > My Apps, select the app with which you want to use ADM.
  3. Click Device Messaging.
  4. If you have already assigned a security profile to your app, proceed to step 7.
  5. To assign a security profile to your app, choose an existing security profile from Select a Security Profile or click Create a New Security Profile. A security profile provides the OAuth credentials that you use when sending messages with ADM. 

    Note: You can share the use of a security profile among more than one app. Sharing a profile allows apps to share some types of data. For example, you may have a "My Cat - Free" app and a "My Cat - HD" app. If you apply a single security profile to both apps, data accessed by that profile is available to both apps. For a shared profile, choose a name that applies to both, for example, "My Cat Apps profile".

  6. If you used an existing security profile, be sure to select Confirm to save your changes.
  7. Click View Security Profile. Then click Kindle/Android Settings.
  8. Create an API Key. Your app requires one or more API Keys.
    • (Required) For a pre-release or "debug" version of your app. In all cases, you must create an API Key for the debug version of your app, in order to test your app with ADM.
    • (Optional) For a release or "production" version of your app. If you sign the release version of your app using your own certificate, you must create an additional API Key for the release version of your app. If you allow Amazon to sign your app on your behalf, you do not need to create an additional API Key.
  9. To create an API Key, you must provide both the package name (for example, com.mycompany.bestapplication) for the app and its signature:
    • Debug application signature for the pre-release version of your app. You can obtain the SHA-256 signature of the certificate used to sign the debug version of your app by doing ONE of the following:
      • Locate the keystore file that is used to sign your app, as well as the alias of the certificate within the keystore file used for signing. For example, if the keystore file is named my_key_store and the certificate within the keystore that is used for signing is called my_certificate_alias, you would run the following command: {JAVA_HOME}/bin/keytool -list -v -alias my_certificate_alias -keystore my_keystore_file

        The output should contain an SHA-256 value. This is your application signature.

        SHA-256: 2E:0B:46:F8:D0:4A:06:AC:18:7A:2E:B0:42:95:58:FE
      • Or, if your app is in the form of a signed APK and you are developing on a Unix-like system, you can run the following command instead. Note that you must replace {your-app.apk} with the name of your APK file. unzip -p {your-app.apk} META-INF/CERT.RSA | keytool -printcert | grep SHA-256

        Provide the SHA-256 output that is returned.

    • Release application signature for the production version of your app. If you sign the release version of your app using your own certificate, provide the SHA-256 signature for that certificate to create an additional API Key. If you allow Amazon to sign your app on your behalf, you do not need to obtain an API Key for the release signature.
  10. Click Generate New Key.