Call Third-Party APIs from a Rampiva Workflow

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

This article provides an example of calling a third-party API from a Rampiva Workflow.

Prerequisites 

  • Rampiva Automate 7.0 or later

  • Rampiva Premium-edition license


Instructions

A. Make Sample API Calls from a Workflow

1

Add a Call API operation that will retrieve the

This operation will get the details of all users in the platform.

2

Add a Script operation to print the response headers, with the following Python script:

responseHeaders = parameters.getJsonObject("{call_api_response_headers}") print("\n") print("Response headers:") for key in responseHeaders: print(" "+key+": "+str(responseHeaders[key]))

This step is not strictly required, and only provides an example for retrieving the response headers, if needed for your usecase.

3

Add another Script operation that will parse the response as a JSON object and prints the results, with the following Python script:

responseBody = parameters.getJsonObject("{call_api_response_body}") print("\n") print("Response body:") for dataRecord in responseBody["data"]: print("===") for recordProperty in dataRecord: print(" "+recordProperty+": "+str(dataRecord[recordProperty]))

 

4

Sample full Workflow.

 

5

Test the Workflow.

 

6

If receiving an error with the message IOException: Certificate fingerprint, copy the certificate fingerprint and set it in all Call API operations to accept the untrusted certificate.

 

7

If receiving an error with the message HTTP/401 Unauthorized, the API requires authentication. Change the Authentication type setting to the appropriate value.

 

8

If receiving an error with the message HTTP/404 Not Found, verify the URL and the Verb.