# Get verification info

Use the **`imp_uid`** obtained through integrated identity verification to get the customer's verification information.

### <mark style="color:blue;">**STEP 01.**</mark> Get verification ID (imp\_uid) on the server-side

The following server-side code fetches the data returned from identity verification.

{% tabs %}
{% tab title="Node.js (popup)" %}
{% code title="server-side" %}

```javascript
app.use(bodyParser.json());
  ...
  // controller that handles POST request to "/certifications"
  app.post("/certifications", async (request, response) => {
    // Get imp_uid from req.body
    const { imp_uid } = request.body;   
})
```

{% endcode %}
{% endtab %}

{% tab title="Node.js (redirection)" %}
{% code title="server-side" %}

```javascript
app.use(bodyParser.json());
  ...
  // controller that handles GET request to "/certifications/redirect"
  app.get("/certifications/redirect", async (request, response) => {
    const { imp_uid } = request.query; // Get imp_uid from req.query
})
```

{% endcode %}
{% endtab %}
{% endtabs %}

### <mark style="color:blue;">**STEP 02.**</mark> Get verification information

To get verification information from the i'mport server, you must first get a [**REST API access token**](/docs-en/api/rest-api-access-token.md). Use the `access token` and `imp_uid` (verification ID) to call the <mark style="color:blue;">**Get identity verification info REST API**</mark> that returns the verification information as follows:

{% code title="sever-side(Node.js)" %}

```javascript
  app.use(bodyParser.json());
  ...
  // controller that handles POST request to "/certifications"
  app.post("/certifications", async (request, response) => {
    const { imp_uid } = request.body; // Get imp_uid from request.body
    try {
      // Get access token
      const getToken = await axios({
        url: "https://api.iamport.kr/users/getToken",
        method: "post", // POST method
        headers: { "Content-Type": "application/json" }, // "Content-Type": "application/json"
        data: {
          imp_key: "imp_apikey", // REST API Key
          imp_secret: "ekKoeW8RyKuT0zgaZsUtXXTLQ4AhPFW3ZGseDA6bkA5lamv9OqDMnxyeB9wqOsuO9W3Mx9YSJ4dTqJ3f" // REST API Secret
        }
      });
      const { access_token } = getToken.data.response; // Access token
      ...
      // Get verification info from i'mport server using imp_uid
      const getCertifications = await axios({
        url: \`https://api.iamport.kr/certifications/\${imp_uid}\`, // Pass imp_uid
        method: "get", // GET method
        headers: { "Authorization": access_token } // Add access token to Authorization header
      });
      const certificationsInfo = getCertifications.data.response; // Save verification info
      ...
    } catch(e) {
      console.error(e);
    }
  });
```

{% endcode %}

### <mark style="color:blue;">**STEP 03.**</mark> Using verification information

Retrieve the following user information from the verification information and add the necessary service logic.

* `name`: name
* `gender`: gender (to be supported)
* `birth`: date of birth
* `unique_key`: same as CI value - unique key to identify the user, such as online social security number.

{% hint style="info" %}
Besides what is listed above, other user information, such as foreigner status, is not provided. Kakao's policy prohibits the provision of the CI value when using the Kakao Certificate.
{% endhint %}

Get the user information and use it as needed. For example, you can use it to check age restrictions as follows:

{% code title="Node.js" %}

```javascript
  // controller that handles POST request to "/certifications"
  app.post("/certifications", async (request, response) => {
    const { imp_uid } = request.body; // Get imp_uid from request.body
    try {
      // Get access token
      /* ...Omitted... */
      // Get verification info using imp_uid 
      /* ...Omitted... */
      const certificationsInfo = getCertifications.data.response; // Save verification info
      const { name, birth } = certificationsInfo;
      ...
      // Check age restrictions
      if (new Date(birth).getFullYear() <= 1999) {
        // Check successful
      } else {
        // Check failed
      }
    } catch(e) {
      console.error(e);
    }
  });
```

{% endcode %}


---

# 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://portone.gitbook.io/docs-en/etc/all/get-verification-info.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.
