GetOTP Documentation

OTP History

You 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 ends with a trailing slash:

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

With the following Basic HTTP verification 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 counts 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 an HTTP 200 Code status code.

The histories are paginated, with 10 records per page. You can use ?page=x query to navigate to other pages

{
  "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",
      "metadata": "{}",
      "captcha": false,
      "risk_score": 0.0023
    },
    {
      "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",
      "metadata": "{\"order_id\":\"xfdu48sfdjsdf\", \"agent_id\":2258}",
      "captcha": true,
      "risk_score": 0.0013
    },
    {
      "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",
      "metadata": "{\"order_id\":\"mnkl23sfdjkla\", \"agent_id\":1123}",
      "captcha": true,
      "risk_score": 0.0014
    },
  ]
}