Configure API Keys

To authenticate login requests, the SNAP PAC REST API uses key-value pairs in the Basic Authentication header’s username and password fields.

When logging in to the API, a user enters:

  • The key for the username
  • The value for the password

To configure API keys:

  1. In a browser window, call the Keys API:
    Example: http://10.20.30.40/admin/keys
    Note: Replace 10.20.30.40 with the IP address of your PAC controller.

  2. Log in with the API administrator username and password you created. (For instructions, see Create Your API Admin User.)
  3. On the Authentication Key Management webpage:
    1. Type a key identifier in the ID field and a key value in the Value field.
      Maximum length: 128 characters.
      Values should be long, hard-to-guess strings of characters.
    2. In the Permissions field, select either Read Only or Read-Write.
      (If you see a “Host” option, just ignore it—It’s reserved for future development.)
    3. Select Enable to grant access to the API.
    4. Click Submit to save the changes.

    Inspect Opto 22 Device

To delete an API key, click Clear. The change is immediately written to the controller. (You don’t have to click Submit.) This feature is useful for quickly removing usernames and passwords.

For API syntax and tips, see the API Reference webpage.