# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.waveline.ai/extract/waveline-extract/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
