> For the complete documentation index, see [llms.txt](https://docs.waveline.ai/extract/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.waveline.ai/extract/waveline-extract/getting-started.md).

# Getting Started

Check out our [GettingStarted Notebook](https://colab.research.google.com/drive/1iG193FpdnxYFnStxyJ6Zjvxwb3mlqa01?usp=sharing) for executable code examplesè

## 1. Create a new job  ([extract-document ](/extract/endpoints/extract-document.md)endpoint)

Before sending our request, we need to prepare a few steps:

* We encoded the invoice PDF to base64 to pass it to our endpoint.
* We decided on a [Shape](/extract/types/shape.md) that describes what we want to extract.
* We created an [API key](https://waveline.ai/extract/dashboard/api-keys) here.&#x20;

#### Command:

```bash
curl -X POST "https://waveline.ai/api/v1/extract-document" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer $WAVELINE_API_KEY" \
     -d '{
          "fileName": "invoice.pdf",
          "contentType": "application/pdf",
          "base64Content": "RGVhciBSZXNvcnQgQXJvbWEsCgpJ...",
          "shape": [
            {
              "name": "total",
              "type": "number",
              "description": "Total amount due of the invoice",
              "isArray": false
            }
          ]
        }' 
```

#### Output:

```json
{
    "id": "a5ecc735-c48e-43ea-a739-d42bfb19edb3",
    "status": "CREATED",
    "type": "extract",
    "result": null,
    "urls": {
        "get": "https://waveline.ai/api/v1/jobs/a5ecc735-c48e-43ea-a739-d42bfb19edb3"
    }
}
```

In the returned response, we can see the id of the created job. We can now see if the job is still running or already finished by querying the job endpoint with that id. To make things convenient, we already provide this URL in `urls["get"]`.&#x20;

## 2. Get the result/status of this job ([job](/extract/endpoints/jobs-id.md) endpoint)

We can easily query the jobs current state using another request:

```bash
curl "https://waveline.ai/api/v1/jobs/a5ecc735-c48e-43ea-a739-d42bfb19edb3" \
     -H "Authorization: Bearer $WAVELINE_API_KEY"
```

```json
{
    "id": "a5ecc735-c48e-43ea-a739-d42bfb19edb3",
    "status": "FINISHED",
    "type": "extract",
    "result": {
        "total": 330.75,
     },
    "urls": {
        "get": "https://waveline.ai/api/v1/jobs/a5ecc735-c48e-43ea-a739-d42bfb19edb3"
    }
}
```

In the `status` field, we see that the job has finished, which means the result is also present in the `result` field.
