> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mangopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# View an API Response

This call returns an API response based on the corresponding idempotency key, within 24 hours of the initial call.

### Path parameters

<ParamField path="IdempotencyKey" type="string" required>
  Min. length: 16 characters; max. length: 36 characters; only alphanumeric and dashes

  A unique string generated by the platform.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200">
    <ResponseField name="StatusCode" type="string">
      The HTTP response code indicating the success or the failure of the request.
    </ResponseField>

    <ResponseField name="ContentLength" type="string">
      The size of the message body in bytes.
    </ResponseField>

    <ResponseField name="ContentType" type="string">
      The media type (two-part identifier for file formats and format contents) of the resource.
    </ResponseField>

    <ResponseField name="Date" type="string">
      The date and time when the response was sent.
    </ResponseField>

    <ResponseField name="RequestURL" type="string">
      The URL of the API request.
    </ResponseField>

    <ResponseField name="Resource" type="object">
      The body of the request’s response.
    </ResponseField>
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200   theme={null}
  {
      "StatusCode": "200",
      "ContentLength": "591",
      "ContentType": "application/json; charset=utf-8",
      "Date": "Tue, 19 Jul 2022 08:47:59 GMT",
      "RequestURL": "https://api.mangopay.com/V2.01/clientId/users/natural",
      "Resource": {
          "Address": {
              "AddressLine1": "Rue des plantes",
              "AddressLine2": "The Oasis",
              "City": "Paris",
              "Region": "Ile de France",
              "PostalCode": "75001",
              "Country": "FR"
          },
          "FirstName": "Jane",
          "LastName": "Doe",
          "Birthday": null,
          "Nationality": null,
          "CountryOfResidence": null,
          "Occupation": null,
          "IncomeRange": null,
          "ProofOfIdentity": null,
          "ProofOfAddress": null,
          "Capacity": "NORMAL",
          "Id": "146476890",
          "Tag": "test doc july 2022",
          "CreationDate": 1658220479,
          "PersonType": "NATURAL",
          "Email": "jdoe@mail.com",
          "KYCLevel": "LIGHT",
          "TermsAndConditionsAccepted": true,
          "TermsAndConditionsAcceptedDate": 1658220479,
          "UserCategory": "PAYER"
      }
  }  
  ```
</ResponseExample>

<RequestExample>
  ```javascript NodeJS theme={null}
  const mangopayInstance = require('mangopay4-nodejs-sdk')
  const mangopay = new mangopayInstance({
    clientId: "client-id",
    clientApiKey: "api-key",
  });

  let idempotencyKey = "045896dd-2547-4f91-a352-5303bb2c258c";

  const viewApiResponse = async (idempotencyKey) => {
    return await mangopay.Idempotency.get(idempotencyKey)
      .then((response) => {
        console.info(response);
        return response;
      })
      .catch((err) => {
        console.log(err);
        return false;
      });
  };

  viewApiResponse(idempotencyKey);
  ```

  ```php PHP   theme={null}
  <?php
      require_once 'vendor/autoload.php';

      use MangoPay\MangoPayApi;
      use MangoPay\Libraries\ResponseException as MGPResponseException;
      use MangoPay\Libraries\Exception as MGPException;
      
      $api = new MangoPayApi();
      
      $api->Config->ClientId = 'your-client-id';
      $api->Config->ClientPassword = 'your-api-key';
      $api->Config->TemporaryFolder = 'your-temporary-folder-path';

      try {
          $idempotencyKey = "fk7urhkW45kpTHf445608d";

          $response = $api->Responses->Get($idempotencyKey);
      
          print_r($response);

      } catch(MGPResponseException $e) {
          print_r($e);
      } catch(MGPException $e) {
          print_r($e);
      }
  ```

  ```java Java  theme={null}
  import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  import com.mangopay.MangoPayApi;
  import com.mangopay.entities.IdempotencyResponse;

  public class ViewApiResponse {
      public static void main(String[] args) throws Exception {
          MangoPayApi mangopay = new MangoPayApi();
          mangopay.getConfig().setClientId("your-client-id");
          mangopay.getConfig().setClientPassword("your-api-key");

          var key = "P7urhkW45pTHf4498B";

          IdempotencyResponse viewReponse = mangopay.getIdempotencyApi().get(key);

          Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
          String prettyJson = prettyPrint.toJson(viewReponse);

          System.out.println(prettyJson);
      }
  }
  ```

  ```python Python   theme={null}
  from pprint import pprint
  import mangopay

  mangopay.client_id='your-client-id'
  mangopay.apikey='your-api-key'

  from mangopay.api import APIRequest
  handler = APIRequest(sandbox=True)

  from mangopay.resources import IdempotencyResponse

  key = 'ok7urhkW45-pTHf4496-80'

  idempotency_response = IdempotencyResponse.get(key)

  pprint(idempotency_response._data)  
  ```

  ```csharp .NET  theme={null}
  using MangoPay.SDK;
  using Newtonsoft.Json;

  class Program
  {
      static async Task Main(string[] args)
      {
          MangoPayApi api = new MangoPayApi();
          api.Config.ClientId = "your-client-id";
          api.Config.ClientPassword = "your-api-key";

          var idempotencyKey = "kRitowx83-okajuE-934K";

          var viewApiResponse = await api.Idempotent.GetAsync(idempotencyKey);

          string prettyPrint = JsonConvert.SerializeObject(viewApiResponse, Formatting.Indented);
          Console.WriteLine(prettyPrint);
      }
  }
  ```
</RequestExample>
