Step 2: Create an API Public Key

After you configure a computer to generate public keys, you can generate a public key within the terminal so that you can then create an API user with an associated public key in the Monetate platform.

  1. Launch a terminal window and then type ssh-keygen -t rsa.
  2. When prompted, type a filename in which to store the key. Ensure the name is easy to remember and find.

    Avoid entering a passphrase when you create a public key.

  3. After the terminal generates the key fingerprint, type the following in the terminal window:
    ssh-keygen -f ~/.ssh/id_rsa.pub -e -m pem
  4. Highlight and copy the generated RSA public key, which should look like this example:
    -----BEGIN RSA PUBLIC KEY-----
    MIIBCgKCAQEAse2gdntbizjhgTMkbVagnyLPVZspdX7BwX1EBfAQaHwkxWwAhwtE
    1rZnwZymkvWUI0l3/h/65nCb4nZqkDNMoZdVKk7pR1W15XW5FGlthBec3lg7kBd9
    JwaKUJy9VURoEd88XmRclZpbG7+fLEY8wVZbtPkEIQ4F/AelzuYLZBISRFXupURs
    ZQV9pAZXKiXjgigQ1QX4/qABsa9IuGYsz5rebuFF++CfNcoK6NfqqltqSSH8Z8Xt
    oMgCgn2d+Iy6WvGNa/2ZjlI6TappNbtSd0IBnOqu5mAriknySA6WGPxzIQiEUO1S
    +s2VoCEP03/RL2Z2lMUQNCAfK2K8VdeGWQIDAQAB
    -----END RSA PUBLIC KEY----- 

Ensure that you copy the entire public key, starting with -----BEGIN RSA PUBLIC KEY----- all the way through ----END RSA PUBLIC KEY-----.

Adding a Public Key to a Monetate API User

After you create the public key, add it to an API user in your Monetate account.

  1. Log into the Monetate platform.
  2. Click the settings cog and then select Sites.

    Callout of the Sites option in the settings menu of the Monetate menu

  3. Click the API Keys tab.

    Callout of the API Key tab on the Site page

  4. Click to select an existing API user, or create an new one by following the steps in Creating an API User in the Manage API Keys documentation.

    Callout of the list of existing API users on the API Keys tab

  5. Click CREATE PUBLIC KEY.

    Callout of the CREATE PUBLIC KEY button

  6. Paste the RSA public key you generated into Public Key, and then click SAVE.

    Callout of the Public Key text field on the Public Key Details modal