Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourBlue
titleSince Version 1.0

Table of Contents

What is the

...

PIPEFORCE HTTP API?

The Pipeline PIPEFORCE HTTP API allows you to manage and execute pipelines via a HTTP requests, similar to REST calls. any aspect of the PIPEFORCE platform via RESTful HTTP calls. You can setup automation and data integration apps. Execute commands and pipelines. Manage users, webhooks, configs, gateway endpoints and much more using this API.

Here is a list of the most important entry-endpoints:

Path

Method

Description

/api/v3/pipeline

Status
colourGreen
titlePOST

Execute adhoc
pipeline YAML or JSON given in the body. The pipeline is not stored.

  • The request body will become the body of the pipeline.

  • Request params will be set in vars scope of the pipeline.

  • Request and response can be accessed via ${request} and ${response} object in the pipeline.

See: https://pipeforce.github.io/api#/Pipeline%20API

Info

For security reasons, executing adhoc pipelines is by default restricted to admin, support and developer users in DEV stage only.

For production stage you should always consider to use persisted pipelines instead.

/api/v3/pipeline:{path}

Status
colourYellow
titlePUT

Store
the pipeline YAML given in the body in the property store at {path}. Overwrite any existing one.

See: https://pipeforce.github.io/api#/Pipeline%20API

/api/v3/pipeline:{path}

Status
colourGreen
titlePOST

Load and execute
the persisted pipeline at {path} from the property store:

  • The request body will become the body of the pipeline.

  • Request params will be set in vars scope of the pipeline.

  • Request and response can be accessed via ${request} and ${response} object in the pipeline.

See: https://pipeforce.github.io/api#/Pipeline%20API

/api/v3/pipeline:{path}

Status
colourBlue
titleGET

Return
the pipeline source persisted at {path} from the property store.

See: https://pipeforce.github.io/api#/Pipeline%20API

/api/v3/pipeline:{path}

Status
colourRed
titleDELETE

Delete
the persisted pipeline at {path} from the property store.

See: https://pipeforce.github.io/api#/Pipeline%20API

/api/v3/property:{path}

Status
colourYellow
titlePUT

Status
colourBlue
titleGET

Status
colourRed
titleDELETE

Create, read, update and delete persisted JSON documents, attachments and other data types in the persistence DB, called the Property Store.

See: https://pipeforce.github.io/api#/Property%20API

/api/v3/command:{name}

Status
colourGreen
titlePOST

Status
colourBlue
titleGET

Execute
a single command given by name {name}.

  • The request body in

    Status
    colourGreen
    titlePOST
    requests will become the body of the command.

  • Request params of

    Status
    colourGreen
    titlePOST
    or
    Status
    colourBlue
    titleGET
    requests will become the params to the command.

Info

Since

Status
colourBlue
titleVERSION 10
this default behaviour can be changed by passing the optional request parameter ?params=body along with the command call. In this case the input to the command will be set to null. And the request body can contain a JSON or YAML which will be passed as command parameters.

See here for a full list of available commands:
https://pipeforce.github.io/api

For more details see the API Documentation.

Execute

...

pipeline (adhoc)

Info

For security reasons, executing adhoc pipelines is by default restricted to admin, support and developer users in DEV stage only.

For production stage you should always consider to use persisted pipelines instead.

In order to execute an adhoc pipeline (= execute a pipeline without persisting it), you can send a HTTP POST request to this endpoint url with the pipeline script as YAML or JSON in the body:

...

Info

The most common usage scenario is to send a pipeline YAML script to the server and execute it there without storing it.

...

You can also send and execute a pipeline in JSON format this way. In this case you have to set the Content-Type header to application/json instead.

Example: No body

In case you would like to execute a pipeline YAML script without a message body, you can run this:

Code Block
languagebash
curl -u 'username:password' \
  -X POST "https://hub-try.pipeforce.org/api/v3/pipeline" \
  -H "Content-Type: application/yaml" \
  --data-binary @- << EOF
pipeline:
 - drive.read:
     path: /my.pdf
 - pdf.stamp:
     text: "Hello World!"
 - drive.save:
     path: /my-stamped.pdf
EOF

Example: With body embedded in the pipeline

In case you would like to execute a pipeline YAML script with message body, which is embedded inside the YAML, you can run it like this example shows:

Code Block
languagebash
curl -u 'username:password' \
  -X POST "https://hub-try.pipeforce.org/api/v3/pipeline" \
  -H "Content-Type: application/yaml" \
  --data-binary @- << EOF
pipeline:
  - log:
      message: "BODY: ${body.text}"

body: {"text": "Hello World!"}
EOF

Example: With multipart body

Let's assume you would like to execute a pipeline and additionally processing one or more files in this same pipeline which must be placed in the body.

...

Note that the pipeline has the part name pipeline and one or more files must all have the name file.

Execute pipeline (persisted

...

)

A persisted pipeline is one which is stored in the property store.

...

Code Block
https://hub-NS.pipeforce.net/api/v3/pipeline:{path}
Info
  • Replace NS by your own namespace.

  • Replace {path} by the path of the pipeline in the property store.

...

Code Block
https://hub-NS.pipeforce.net/api/v3/pipeline:uuid:{uuid}
Info
  • Replace NS by your own namespace.

  • Replace {uuid} by the uuid of the pipeline property to be loaded and executed.

...

For more details about managing persisted pipelines, see the API documentation.

Example: Load and Execute persisted pipeline

In this example, a pipeline persisted under path global/app/myapp/pipeline/mypipeline will be loaded and executed at the backend without any body or request parameters:

Code Block
languagebash
curl -u 'username:password' \
  -X POST 'https://hub-NS.pipeforce.net/api/v3/pipeline:global/app/myapp/pipeline/mypipeline'

Example: Persist a pipeline (save it in property store)

In this example a new persisted pipeline will be created under path global/app/myapp/pipeline/newpipeline:

...