In this procedure, we walk through the necessary setup to configure your local system and the Aspera on Cloud Platform (AoC) so that you can make API calls to the Activity application.

There are two main procedures:

To download the source code used in this tutorial, click here.

md5: 4ed52cb297cdc5669b11ff5624749387
sha1: 6396f0e5f25fcc42560c858b841507a7dceb9e9f

I. Obtain the Necessary Elements for Authorization

  1. In terminal, create a directory called analytics-api-demo, move into that directory, and create the files that will contain the source code for this procedure.
    mkdir analytics-api-demo
    cd analytics-api-demo
    touch get_analytics_data.rb authentication.rb get_organization.rb constants.rb Gemfile
  2. Generate private and public keys.
    Note: To maintain security, Aspera recommends that you do not use version control to track files that contain security information. This includes the private and public keys that you create in this step. Example keys shown in this tutorial are included for purposes of demonstration only and are no longer valid.

    ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key

    The following prompt appears:

    Enter passphrase (empty for no passphrase)

    To create a key without a passphrase, press Enter twice.

    If the process is successful, you have two new files in analytics-api-demo:

    • jwtRS256.key (private)
    • jwtRS256.key.public (public)

    The contents of the jwtRS256.key file now contains something like the following:

     . . .
     ----END RSA PRIVATE KEY----

    The contents of the jwtRS256.key.public file now contains something like the following:

    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCu5Q1e6nh4OuVvT5V+Ezuv49g53xxrywtg9NIjlM7JnTK
    . . .
  3. Configure the public key to work with Open SSL:
    openssl rsa -in jwtRS256.key -pubout -outform PEM -out

    The file will now contains something like the following:

    -----BEGIN PUBLIC KEY-----
    . . .
    -----END PUBLIC KEY-----

II. Create an Integration with AoC

  1. Go to *, where * represents your subdomain. Your subdomain is unique to your organization in Aspera on Cloud. In this tutorial, turbo is used as an example subdomain.
  2. Organization menu category and click Integrations, then click Create New. A new integration form opens.
  3. Fill out the form with appropriate values for your integration.
      • Enter a name for your integration.
      • Enter values for Redirect URIs and Origins. If you do not already have a designated value for each, enter a placeholder value, such as (These values are not needed for using the API, but they are required fields in the current template.) After you enter each value, it appears under a Name header.

  4. When done, click Save.You now see a newly created Profile for your integration.
    • Click the submenu JSON Web Token Auth (next to Profile).
    • Select the check-box for Enable JWT grant type.
    • From the Allowed keys dropdown, select User-specific keys and global key.
  5. In the pop-up that appears, click Yes to confirm that you want to permit global keys.A field called Public Key (PEM Format) appears.
  6. Copy the complete contents of analytics-api-demo/*.key.public—which you created in the previous section on this page—into this field, then click Save.

    Keep the page open in the Activity App.

  7. Add the constants listed below to the file constants.rb.The values in this list are example values, only. To locate the correct values for your configuration, consult the table below.

    You will find some of the values you need on your Integrations page.

    Where to find the constant values:

    Key Value Example Value
    CLIENT_ID Found in the “Client info” section on your Integrations page BNMWnBP3Sg
    CLIENT_SECRET Found in the “Client info” section on your Integrations page ‘RpRQHCCzLOMsFo7pyCegd2W58FxmRSep’
    USER_EMAIL Your email address ‘’
    ORGANIZATION_ID The ID for your organization in Aspera on Cloud. If you do
    not know your organization ID, see the Files API call in the
    sample code file, get_organization.rb (see the link at the top of this page).
    ORGANIZATION_SUBDOMAIN The subdomain in your organization’s URL turbo
  8. Now that you have completed the setup process, go to Installing Dependencies for the Activity API.