# GET DID Nonce

With the exception of DID registration (`did_register`), each HTTP request to the IDIN server must contain a request nonce (`"nonce"`). A nonce is bound to a DID address and starts at one for the first HTTP request after the DID registration. The DID nonce then increases by one for every request, and as a result it counts to the total number of requests that the DID has made.

The current nonce of a DID (`<did_address>`) can be obtained with a GET request.

{% hint style="danger" %}
If the input nonce (`"nonce"`) in a HTTP request does not match the current nonce of the given DID, the request will be rejected by the IDIN server.
{% endhint %}

<mark style="color:blue;">`GET`</mark> `https://test-network.finema.co/did/<did_address>/nonce`

{% tabs %}
{% tab title="200 The current nonce of the DID (\<did\_address>) will be given as the response." %}

```
{
    "did_address": "did:idin:9cd19d4cbab9ca1d6f4c6a4b9117fb8904f250b47307cf4f484424f44e0c8370",
    "nonce": 17
}
```

{% endtab %}

{% tab title="422 The error message will be given as the response if the given DID address does not exist." %}

```
{
    "errors": [
        {
           "status": 422,
            "title": "Invalid Attribute",
            "detail": "the server cannot process the request",
        }
    ]
}
```

{% endtab %}
{% endtabs %}


---

# 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.finema.co/api-tutorials/did-api/get-did-nonce.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.
