# Quickstart guide

## Introduction

All steps required to initialise a process flow via the [Patchworks Core API](https://doc.wearepatchworks.com/product-documentation/developer-hub/patchworks-core-api/core-api-spotlights/initialising-a-process-flow-and-sending-data-via-the-patchworks-api/broken-reference) are detailed [below](https://doc.wearepatchworks.com/product-documentation/developer-hub/patchworks-core-api/core-api-spotlights/initialising-a-process-flow-and-sending-data-via-the-patchworks-api/the-steps). This page provides a quick overview of these steps.

## Summary

{% embed url="<https://youtu.be/iQhw4UnP5M4>" %}

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fu4hlSUN67apO4ByLzAe1%2F1.png?alt=media&#x26;token=21293c5f-14dd-4eca-b7f5-592abfe0a165" alt="" data-size="line"> Prepare your data</summary>

If you're passing in a payload via the request body, it must be stringified within a JSON object. For example:

```json
{
  "payload": "{\"a-stringified-json-payload\"}"
}
```

[Go to detailed steps ➜](https://doc.wearepatchworks.com/product-documentation/developer-hub/patchworks-core-api/core-api-spotlights/initialising-a-process-flow-and-sending-data-via-the-patchworks-api/the-steps/preparing-your-data)

</details>

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F83qvL3DjjvsmiVUYlQiQ%2F2.png?alt=media&#x26;token=dc06fd43-5913-462a-b256-101b3f76867e" alt="" data-size="line"> Map your data</summary>

If you're passing in a payload via the request body for syncing to a target connection, your process flow will need a map shape - source data fields (for your incoming payload) should be added manually.

[Go to detailed steps ➜](https://doc.wearepatchworks.com/product-documentation/developer-hub/patchworks-core-api/core-api-spotlights/initialising-a-process-flow-and-sending-data-via-the-patchworks-api/the-steps/mapping-payload-data)

</details>

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FVCQL42m29ZL1W1x3Q9aW%2F3.png?alt=media&#x26;token=7b70814f-ab70-4b5f-9cae-65c9dcf89da7" alt="" data-size="line"> Get flow IDs</summary>

The initialise flow API request requires two identifiers - one for for the flow to be run and another for the specific flow version.&#x20;

To find the process flow id, access the required process flow from the dashboard. You'll find the `process flow id` above the title at the top of the canvas:

<img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F9DIEOVXUfqBLa4e3hUdI%2Fflow%20id.png?alt=media&#x26;token=3a085f96-de9a-4e01-b5fa-dadfc52ce179" alt="" data-size="original">

And you'll find all process flow version ids at the bottom of process flow settings:

<img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F8iNsW33UCfbKywSGkqky%2Fflow%20version%20id.png?alt=media&#x26;token=19f93cab-6bf9-4494-9f02-2cbf9be0c464" alt="" data-size="original">

[Go to detailed steps ➜](https://doc.wearepatchworks.com/product-documentation/developer-hub/patchworks-core-api/core-api-spotlights/initialising-a-process-flow-and-sending-data-via-the-patchworks-api/the-steps/obtaining-process-flow-and-version-ids-for-api-requests)

</details>

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fj27NPzQQFoRlKRDAmmsj%2F4.png?alt=media&#x26;token=482820e7-110b-4469-9da4-88339e687f6c" alt="" data-size="line"> Authenticate</summary>

To obtain a Patchworks token for API authentication, send a POST request to the following URL:&#x20;

```json
https://svc-fabric.pwks.co/api/v1/login
```

This request must include your Patchworks login credentials in the body:&#x20;

```json
{
    "email": "joe.bloggs@wearepatchworks.com",
    "password": "mypassword123*"
}
```

[Go to detailed steps ➜](https://doc.wearepatchworks.com/product-documentation/developer-hub/patchworks-core-api/core-api-spotlights/initialising-a-process-flow-and-sending-data-via-the-patchworks-api/the-steps/obtaining-a-token-for-patchworks-api-authentication)

</details>

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FxWO0mmwxJfEEmqcJZvM9%2F5.png?alt=media&#x26;token=72398fcd-7d39-4a4b-b718-36792c786dec" alt="" data-size="line"> Initialise flow</summary>

To initialise a process flow, send a POST request to the following URL:&#x20;

```json
https://start.wearepatchworks.com/api/v1/flows/<flowID>/start/<flowVERSION>
```

Replacing `<flowID>` and `<flowVERSION>` with details for your required process flow noted previously, and authenticate with your Patchworks token.

[Go to detailed steps ➜](https://doc.wearepatchworks.com/product-documentation/developer-hub/patchworks-core-api/core-api-spotlights/initialising-a-process-flow-and-sending-data-via-the-patchworks-api/the-steps/initialising-a-process-flow-and-sending-data)

</details>
