GetOTP Documentation

OTP History

Developer can fetch the OTP histories via this endpoint

OTP History Request

To fetch OTP History, make a GET request to our OTP history endpoint. Take note that our OTP endpoint ending with trailing slash:

https://otp.dev/api/verify/

With the following Basic HTTP authentication method:

Description Required Data Type Example
Your API Key Yes String mtbi2w4hlendfpxa1igthcu5p6mzxf7k
Your API Token Yes String mpktanoshzf4c81e3bydjl76ixr9wugv

Note

  • Grab your API key and API token from this page
  • You can create maximum 3 count of API keys

Examples

Below is an example request using cURL:

curl -L -X GET 'https://otp.dev/api/verify/' \
-u 'mtbi2w4hlendfpxa1igthcu5p6mzxf7k:mpktanoshzf4c81e3bydjl76ixr9wugv'

The response would be a JSON structure, returned with HTTP 200 Code status code.

The histories is paginated, 10 records per page. Developer can use ?page=x query to navigate to others page

{
  "count": 14,
  "next": "https://otp.dev/api/verify/?page=2",
  "previous": null,
  "results": [
    {
      "callback_url": "http://mysite.test/payments/callback",
      "success_redirect_url": "http://mysite.test/payments/65/success",
      "fail_redirect_url": "http://mysite.test/payments/65/failed",
      "otp_id": "ttnnkgggvjef7euc72j8",
      "status": [
        {
          "channel": "email",
          "auth_status": "not_verified"
        }
      ],
      "channels": [
        "email"
      ],
      "creation_time": "2021-07-07T08:26:41.952690Z"
    },
    {
      "callback_url": "http://mysite.test/payments/callback",
      "success_redirect_url": "http://mysite.test/payments/58/success",
      "fail_redirect_url": "http://mysite.test/payments/58/failed",
      "otp_id": "ttnnkgggvjda7euc72j8",
      "status": [
        {
          "channel": "email",
          "auth_status": "verified",
          "email": "dev@gmail.test",
        }
      ],
      "channels": [
        "email"
      ],
      "creation_time": "2021-07-07T07:26:41.952690Z"
    },
    {
      "callback_url": "http://mysite.test/payments/callback",
      "success_redirect_url": "http://mysite.test/payments/52/success",
      "fail_redirect_url": "http://mysite.test/payments/52/failed",
      "otp_id": "dz3oe4x7lrqixefbgwk3",
      "status": [
        {
          "channel": "sms",
          "auth_status": "verified",
          "phone_number": "+918437195033"
        }
      ],
      "channels": [
        "sms"
      ],
      "creation_time": "2021-07-06T10:08:03.891889Z"
    },
  ]
}