# Example - Creating a Workflow in Aerofiler

In this example, we will demonstrate how to create an Aerofiler workflow using the API. We will begin with an Aerofiler workflow with three fields:

* Counterparty
* Start Date
* Purpose

In Aerofiler, this should appear as follows:

<figure><img src="https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2FjGgpybu2Uz3odHQJXVrZ%2Fimage.png?alt=media&#x26;token=4ba455eb-d18a-4991-b407-9cfef88d98de" alt=""><figcaption></figcaption></figure>

Go to Settings -> Organization -> API Keys. If needed, generate an API key by clicking "Create API Key":

<figure><img src="https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2FRimLcJsyaxFbDjm5ol69%2Fimage.png?alt=media&#x26;token=5eeb5c1b-e626-4cf5-b6f2-4ab641ebf705" alt=""><figcaption></figcaption></figure>

Then click "View API". To begin, click "Authorize" and then enter your API key:

<figure><img src="https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2FZZRCntmstebxUKgcrVx9%2Fimage.png?alt=media&#x26;token=9eaad99d-5ada-432e-b6ed-7661a07f81ee" alt=""><figcaption></figcaption></figure>

Next, retrieve a list of available workflows:

<figure><img src="https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2FbGDn04ahOKbATalU4ndm%2Fimage.png?alt=media&#x26;token=229b75c8-a880-4a19-ad59-fdd24d397627" alt=""><figcaption></figcaption></figure>

Then, copy  the id from the NDA workflow:

<figure><img src="https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2FkmVQgZMUU9ydBpVnIV80%2Fimage.png?alt=media&#x26;token=bd141eec-6dd4-4fac-bce4-cfaef43c6272" alt=""><figcaption></figcaption></figure>

Go to the following GET endpoint, click "Try it out" and paste the id:

<figure><img src="https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2F3wAnjTLfJGTD2mI4XY4W%2Fimage.png?alt=media&#x26;token=318104fc-abce-4907-a6d1-2aa54754d0f1" alt=""><figcaption></figcaption></figure>

The response will return the specific parameters used for the workflow:

![](https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2FBJeA5UtGqfjbeAUYY9EG%2Fimage.png?alt=media\&token=1cb759bd-7de8-40da-8a03-61b96272e2d0)

Then, go to the following POST endpoint, click "Try it out and paste the id:

<figure><img src="https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2FynTSSwObeCqdW5GsS3iY%2Fimage.png?alt=media&#x26;token=80938746-4aa1-41e6-b552-0b5dff03ab7a" alt=""><figcaption></figcaption></figure>

This will initially return some boilerplate code:

<figure><img src="https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2Fho5YQJ7LVu8rlMNXYzg0%2Fimage.png?alt=media&#x26;token=cb73cf55-0719-4aea-a705-e3047d0fe20f" alt=""><figcaption></figcaption></figure>

You can test the workflow in Aerofiler by completing the parameters from the GET request:

&#x20;

<figure><img src="https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2FXX3W0rbxkwuPXMxBfEhk%2Fimage.png?alt=media&#x26;token=8eeec935-6161-4fdb-abd7-eaa4d512f715" alt=""><figcaption></figcaption></figure>

Clicking "Execute" should create the workflow in Aerofiler:

<figure><img src="https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2FZLQFsbh6myFyjEtKi5rQ%2Fimage.png?alt=media&#x26;token=fdcc5bcd-3796-4208-8d13-279465f38f9e" alt=""><figcaption></figcaption></figure>

The output will also produce a `curl` command, including the endpoint you should use (boxed in red below) when integrating with other applications:

<figure><img src="https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2FkGmoqp0TMuIk19E3W8R0%2Fimage.png?alt=media&#x26;token=0e862abd-8dd2-4350-8bfc-70f1b6a44a72" alt=""><figcaption></figcaption></figure>

If there are errors, further details will be provided in the response:

<figure><img src="https://990055713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpzhcJuh5qEG7uLa8k3LR%2Fuploads%2FV9VNRzPqaNKfThiiyx8t%2Fimage.png?alt=media&#x26;token=7cfb1b4e-b842-4817-8b45-f895258fe36d" alt=""><figcaption></figcaption></figure>
