# Attestation request

**Create an attestation request using API. In this example, you will request an email attestation.**

**Get the connection ID:**

* Create a new GET request like previously and enter the value: « <mark style="background-color:orange;">{{base\_URL}}/connections</mark> »
* In the Params tab, add a Key "<mark style="background-color:orange;">status</mark>" with the Value "<mark style="background-color:orange;">active</mark>"
* Save the request and click `SEND`

Response:

```
[
    {
    "count": 1,
    "results": [
        {
            "createdAt": "2024-06-21T07:31:07.241Z",
            "updatedAt": "2024-06-21T07:31:07.241Z",
            "id": "694b8024-e34c-4aaa-b3c4-dd114f3cba4c",
            "contact": {
                "did": "Gjr2SvNwhHe3ZhmUNjKqHT",
                "organization": {
                    "siren": "889098612",
                    "address": "45-47 Boulevard Paul Vaillant Couturier, 94200 Ivry-sur-Seine, FRANCE",
                    "name": "ARCHIPELS"
                },
                "wallet": {
                    "type": "business",
                    "label": "Archipels",
                    "dids": [
                        "Gjr2SvNwhHe3ZhmUNjKqHT"
                    ]
                }
            },
            "label": "Archipels",
            "status": "active"
        }
]

```

In our example, the connection ID for the issuer (DID Gjr2SvNwhHe3ZhmUNjKqHT) is the first id: 694b8024-e34c-4aaa-b3c4-dd114f3cba4c

{% hint style="warning" %}
Your connectionID will have a specific value. Don't reuse the one in the example
{% endhint %}

{% hint style="danger" %}
If the request doesn't provide any existing connection, it means you have never been connected with one of the issuer from the list, or the connection has been closed or is pending.\
In this case you need to create the connection. Go to the page "[Accept an invitation](broken://pages/isdJgVoMvdKPiVcytTAw)"
{% endhint %}

Now that you have all the data, you can create the Attestation send request

* Create a new request but with the Method POST and the value <mark style="background-color:orange;">{{base\_URL}}/messages</mark>
* Select the tab `Body`, then select « raw » and copy/paste this json request:

```postman_json
{
    "content": "/email_attestation",
    "connectionId": "694b8024-e34c-4aaa-b3c4-dd114f3cba4c",
    "metadata":{
        "init": true
    }
}
```

* Save the request and click on `SEND`
* The response is `204 no content` when your request is received&#x20;

<figure><img src="/files/7GR8o1PYX59j1yOaCPkk" alt=""><figcaption></figcaption></figure>

* At the same time, a webhook is sent to the holder:

```
{
  "type": "MessageReceived",
  "payload": {
    "connectionId": "694b8024-e34c-4aaa-b3c4-dd114f3cba4c",
    "content": "Veuillez saisir votre adresse email.",
    "walletDid": "7e2uxoCMDTErr9jsuKpSHH"
  },
  "timestamp": "2024-09-05T17:21:50.482Z"
}
```

Now that you have initiated the email attestation request, send your email address

* Create a new request or modify the one you just created with the Method POST and the value <mark style="background-color:orange;">{{base\_URL}}/messages</mark>
* Select the tab `Body`, then select « raw » and copy/paste this json request:

```postman_json
{
    "content": "replace with your email address",
    "connectionId": "694b8024-e34c-4aaa-b3c4-dd114f3cba4c",
    "metadata":{
        "init": true
    }
}
```

* Save the request and click on `SEND`
* The response is `204 no content` when your request is received&#x20;
* At the same time, a webhook is sent to the holder:

```
{
  "type": "MessageReceived",
  "payload": {
    "connectionId": "694b8024-e34c-4aaa-b3c4-dd114f3cba4c",
    "content": "Un code vous a été envoyé par email, merci de le renseigner ici.",
    "walletDid": "7e2uxoCMDTErr9jsuKpSHH"
  },
  "timestamp": "2024-09-05T18:04:27.298Z"
}
```

Check your email box for an email sent from <noreply@archipel.io>

* copy the OTP
* Create a new request or modify the one you just created with the Method POST and the value <mark style="background-color:orange;">{{base\_URL}}/messages</mark>
* Select the tab `Body`, then select « raw » and copy/paste this json request (replace 123456 by the OTP received):

```postman_json
{
    "content": "123456",
    "connectionId": "694b8024-e34c-4aaa-b3c4-dd114f3cba4c",
    "metadata":{
        "init": true
    }
}
```

* Save the request and click on `SEND`
* The response is `204 no content` when your request is received&#x20;
* At the same time, a webhook is sent to the holder:

```
{
  "type": "AttestationOfferReceived",
  "payload": {
    "connectionId": "694b8024-e34c-4aaa-b3c4-dd114f3cba4c",
    "walletDid": "7e2uxoCMDTErr9jsuKpSHH",
    "attestationId": "5cf231d3-30ab-4f05-b5c8-d6dd568c4cef",
    "ssiProvider": "aries"
  },
  "timestamp": "2024-09-05T18:15:08.538Z"
}
```


---

# 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-v1.archipels.io/archipels-documentation/create-attestation-request/create-an-email-attestation-request-against-archipels/attestation-request.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.
