# Fetching a Case

You can use the `id` returned by the previous example to fetch a case using the following request:

{% tabs %}
{% tab title="CURL" %}

```bash
curl -X 'GET' \
  'https://api.digicust.com/generic/api/<YOUR CUSTOMER ID>/<YOUR PROJECT ID>/cases/<YOUR CASE ID>' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <YOUR ACCESS TOKEN>'
```

{% endtab %}

{% tab title="JavaScript (native)" %}

```javascript
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.digicust.com/generic/api/<YOUR CUSTOMER ID>/<YOUR PROJECT ID>/cases/<YOUR CASE ID>');
xhr.setRequestHeader('Authorization', 'Bearer <YOUR ACCESS TOKEN>');
xhr.setRequestHeader('Accept', 'application/json');

xhr.onreadystatechange = function () {
  if (xhr.readyState === 4) {
    console.log(xhr.status);
    console.log(xhr.responseText);
  }
};

xhr.send();

```

{% endtab %}

{% tab title="JavaScript (axios)" %}

```javascript
const axios = require('axios');

axios({
  method: 'get',
  url: 'https://api.digicust.com/generic/api/<YOUR CUSTOMER ID>/<YOUR PROJECT ID>/cases/<YOUR CASE ID>',
  headers: {
    'Authorization': 'Bearer <YOUR ACCESS TOKEN>',
    'Accept': 'application/json',
  },
})
.then(function (response) {
  console.log(response.data);
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="Visual Basic.NET" %}

```visual-basic
Imports System.Net
Imports System.IO

Dim request As HttpWebRequest = DirectCast(WebRequest.Create("https://api.digicust.com/generic/api/<YOUR CUSTOMER ID>/<YOUR PROJECT ID>/cases/<YOUR CASE ID>"), HttpWebRequest)
request.Method = "GET"
request.Headers("Authorization") = "Bearer <YOUR ACCESS TOKEN>"
request.Accept = "application/json"

Dim response As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse)

Dim reader As New StreamReader(response.GetResponseStream())

Console.WriteLine(reader.ReadToEnd())
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'Authorization': 'Bearer <YOUR ACCESS TOKEN>',
    'Accept': 'application/json',
}

response = requests.get('https://api.digicust.com/generic/api/<YOUR CUSTOMER ID>/<YOUR PROJECT ID>/cases/<YOUR CASE ID>', headers=headers)

print(response.json())

```

{% endtab %}
{% endtabs %}

This case will give you among all other case information a `status.value`. This indicates the processing state of the customs case. A finished customs case will always have status `processed`.


---

# 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://guide.digicust.com/developer-api/fetching-a-case.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.
