Authenticate to Rampiva Automate with an API Key

The material in this document is for informational purposes only. The products it describes are subject to change without prior notice, due to the manufacturer’s continuous development program. Rampiva makes no representations or warranties with respect to this document or with respect to the products described herein. Rampiva shall not be liable for any damages, losses, costs or expenses, direct, indirect or incidental, consequential or special, arising out of, or related to the use of this material or the products described herein.

Introduction

When integrating a third-party platform or a script with Rampiva Automate using the API, the API calls need to be authenticated. To facilitate the authentication, API keys can be created for each integration. This article describes how to create an API key and shows an example of making an API call from a script with the key.

Alternatively, to use the API without an API Key, see Authenticate to Rampiva Automate without an API Keyarchived.

Prerequisites 

  • Rampiva Automate 5.5 or later

  • Rampiva Premium-edition license


Instructions

A. Create an API Key

1

Log in to Rampiva Automate.

 

2

Open the SettingsAPI Keys panel.

3

Add a new API Key and provide the key name and validity in days.

4

After the key is created, click Copy Header to copy the authentication header to the clipboard.

The authentication header will have the following format:

Bearer 265fa20a-ba69-47a0-aab5-034fba50e062:fzMQKFhuOb63ydsOFmJJtExe6mttWFSr

B. Make an API call with the API Key

1

Use the Python script in the right column to get the user settings in Automate, using the previously created API key.

Replace the serviceLocation with the location at which the API is available in your environment, and the Authorization with the value previously copied to clipboard.

import requests serviceLocation = 'http://localhost/api/v1' authHeaders = { 'Authorization': 'Bearer 265fa20a-ba69-47a0-aab5-034fba50e062:fzMQKFhuOb63ydsOFmJJtExe6mttWFSr' } userSettings = requests.get(serviceLocation+'/scheduler/userSettings', headers=authHeaders).json() print (userSettings)
2

Sample HTTP request details.

GET http://localhost/api/v1/scheduler/userSettings HTTP/1.1 Host: localhost User-Agent: python-requests/2.23.0 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Authorization: Bearer 265fa20a-ba69-47a0-aab5-034fba50e062:fzMQKFhuOb63ydsOFmJJtExe6mttWFSr