Accessing Centerprise’s Server APIs Through a Third-Party Tool

Astera Centerprise provides you with the flexibility to execute your jobs through a third-party tool, without using the Centerprise client. Let’s learn how to achieve this in the article below.

Use Case

In this use case, we have our Centerprise client on a local machine and server installed on a virtual machine. Instead of using Centerprise client, we will use Postman as a third-party tool to send REST requests to the server in order to execute the job.

Workflow in Centerprise

The workflow document in Centerprise consists of a Variables object, a FileTransferTask object and a RunDataflow object.

We will pass the name of the file that we want to download and process to the FileTransferTask from the Variables object. The Variables object takes an input from the REST call sent through Postman, and passes it to FTP to download the file with that name. We then pass the file path of the downloaded file to the RunDataflow object.

1-workflow

In the following section, we will cover a step-by-step overview of how you can achieve this.

How to Execute a Job Using Postman

1. We will make the first API call for logging into the Centerprise server to generate an access token. Provide the following credentials in the request body and click on Send.

  • User: admin

  • Password: Admin123

  • RememberMe: 1

    2-POST-request

Centerprise server will provide you with an access token in response.

3-access-token

2. In the second step, we will send the path of the file that we want to download from FTP, in the form of a string, to the Variables object.

9-run-job-api

In the parameters:

  • ActionName: Variables

    Name of the object present inside the workflow to which the name of the file will be passed

  • Parameters: sourceFilePath

    The value of the input variable field inside the workflow

  • Value: [file path of the file that you want to download]

    The value of the input variable field inside the workflow

    As soon as you send this API request, Centerprise will provide you with a jobID that you can use to get the job status.

    6-job-id

    3. In the third step, we will make a GET call to fetch the job’s status by providing the job ID.

    8-get-job-status

    This is what Centerprise’s response would look like.

    9-response

    This concludes accessing Centerprise’s server APIs through a third-party tool.