{"info":{"_postman_id":"7f752cd3-e736-4b8e-b0d6-cbc1afcd459d","name":"OTP API","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"27193977","collectionId":"7f752cd3-e736-4b8e-b0d6-cbc1afcd459d","publishedId":"2sA3QqfsXD","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FFFF00"},"publishDate":"2024-10-08T05:15:49.000Z"},"item":[{"name":"OTP","item":[{"name":"OTP Send","event":[{"listen":"test","script":{"id":"745118ca-d342-4c12-a69d-fb84e30e3cdd","exec":["","pm.test(\"Response status code is 200\", function () {","    pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Status should be a non-empty string\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.have.property('status').that.is.a('string').and.to.have.lengthOf.at.least(1, \"Status should not be empty\");","});","","","pm.test(\"Data object is not empty\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.data).to.exist.and.to.not.be.empty;","});","","","pm.test(\"Otp should be a non-empty string\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.data.otp).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Otp should not be empty\");","});","","// Stores the OTP value in an environment or global variable","var otp = pm.response.json().data.otp;","pm.environment.set(\"otp\", otp);","// Test to check the saved OTP field in the response","pm.test(\"Response contains the saved OTP field\", function () {","    const responseData = pm.response.json();","","    pm.expect(responseData.data.otp).to.equal(pm.environment.get(\"otp\"), \"Response should contain the saved OTP value\");","});"],"type":"text/javascript","packages":{}}}],"id":"0a42835b-5ec7-407b-abe8-92a36229a1c2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"X-API-Key","value":"{{apikey}}"}],"body":{"mode":"formdata","formdata":[{"key":"to","value":"14084446640","type":"text"},{"key":"extra","value":"{\"VAR\":\"TestVariable\"}","type":"text"}]},"url":"https://{{host}}/api/otp/sixcharusername","description":"<h3 id=\"update-otp-information\">Update OTP Information</h3>\n<p>This endpoint is used to update the OTP information for a specific user with a six-character username.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p><code>to</code> (text): The recipient's contact information.</p>\n</li>\n<li><p><code>extra</code> (text): Any extra information related to the OTP.</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li><p>Status: 200</p>\n</li>\n<li><p>Content-Type: application/json</p>\n</li>\n</ul>\n<p>The response will contain the following fields:</p>\n<ul>\n<li><p><code>status</code> (string)</p>\n</li>\n<li><p><code>data</code> (object)</p>\n<ul>\n<li><p><code>namespace</code> (string)</p>\n</li>\n<li><p><code>id</code> (string)</p>\n</li>\n<li><p><code>to</code> (string)</p>\n</li>\n<li><p><code>channel_description</code> (string)</p>\n</li>\n<li><p><code>address_description</code> (string)</p>\n</li>\n<li><p><code>extra</code> (object)</p>\n<ul>\n<li><code>VAR</code> (string)</li>\n</ul>\n</li>\n<li><p><code>provider</code> (string)</p>\n</li>\n<li><p><code>provider_id</code> (string)</p>\n</li>\n<li><p><code>delivery_status</code> (string)</p>\n</li>\n<li><p><code>failure_reason</code> (string)</p>\n</li>\n<li><p><code>otp</code> (string)</p>\n</li>\n<li><p><code>max_attempts</code> (number)</p>\n</li>\n<li><p><code>attempts</code> (number)</p>\n</li>\n<li><p><code>closed</code> (boolean)</p>\n</li>\n<li><p><code>ttl</code> (number)</p>\n</li>\n<li><p><code>url</code> (string)</p>\n</li>\n</ul>\n</li>\n</ul>\n<p>Example response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"\",\n    \"data\": {\n        \"namespace\": \"\",\n        \"id\": \"\",\n        \"to\": \"\",\n        \"channel_description\": \"\",\n        \"address_description\": \"\",\n        \"extra\": {\n            \"VAR\": \"\"\n        },\n        \"provider\": \"\",\n        \"provider_id\": \"\",\n        \"delivery_status\": \"\",\n        \"failure_reason\": \"\",\n        \"otp\": \"\",\n        \"max_attempts\": 0,\n        \"attempts\": 0,\n        \"closed\": true,\n        \"ttl\": 0,\n        \"url\": \"\"\n    }\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","otp","sixcharusername"],"host":["{{host}}"],"query":[],"variable":[]}},"response":[{"id":"14d26b8c-dac9-4766-96b7-e3bd2162057d","name":"OTP Send","originalRequest":{"method":"PUT","header":[{"key":"X-API-Key","value":"{{apikey}}"}],"body":{"mode":"formdata","formdata":[{"key":"to","value":"14084446640","type":"text"},{"key":"extra","value":"{\"VAR\":\"TestVariable\"}","type":"text"}]},"url":"https://{{host}}/api/otp/sixcharusername"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Vary","value":"Origin"},{"key":"Date","value":"Mon, 19 Aug 2024 05:22:59 GMT"},{"key":"Content-Length","value":"394"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"data\": {\n        \"namespace\": \"prod\",\n        \"id\": \"sixcharusername\",\n        \"to\": \"15628529760\",\n        \"channel_description\": \"\",\n        \"address_description\": \"\",\n        \"extra\": {\n            \"VAR\": \"TestVariable\"\n        },\n        \"provider\": \"msg91_sms_lucglo\",\n        \"provider_id\": \"\",\n        \"delivery_status\": \"PENDING\",\n        \"failure_reason\": \"\",\n        \"otp\": \"523354\",\n        \"max_attempts\": 5,\n        \"attempts\": 1,\n        \"closed\": false,\n        \"ttl\": 300,\n        \"url\": \"https://gateway.otp.plus/otp/prod/sixcharusername\"\n    }\n}"}],"_postman_id":"0a42835b-5ec7-407b-abe8-92a36229a1c2"},{"name":"OTP Verify","id":"d0035f7d-54f1-4e3d-9eb2-a54eef87e238","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"X-API-Key","value":"{{apikey}}"}],"body":{"mode":"formdata","formdata":[{"key":"to","value":"14084446640","type":"text"},{"key":"extra","value":"{\"VAR\":\"TestVariable\"}","type":"text"},{"key":"action","value":"check","type":"text"},{"key":"otp","value":"790503","type":"text"}]},"url":"https://{{host}}/api/otp/sixcharusername","description":"<h3 id=\"otp-six-character-username\">OTP Six Character Username</h3>\n<p>This endpoint is used to send an OTP (One Time Password) to a user with a six character username.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p>to (text): The recipient's contact information.</p>\n</li>\n<li><p>extra (text): Additional information related to the OTP.</p>\n</li>\n<li><p>action (text): The action for which the OTP is being sent.</p>\n</li>\n<li><p>otp (text): The actual One Time Password.</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>Upon a successful execution, the API returns a JSON object with the following fields:</p>\n<ul>\n<li><p>status: The status of the OTP request.</p>\n</li>\n<li><p>data</p>\n<ul>\n<li><p>namespace: The namespace of the OTP.</p>\n</li>\n<li><p>id: The ID of the OTP request.</p>\n</li>\n<li><p>to: The recipient's contact information.</p>\n</li>\n<li><p>channel_description: Description of the channel used for OTP delivery.</p>\n</li>\n<li><p>address_description: Description of the recipient's address.</p>\n</li>\n<li><p>extra: Additional data related to the OTP.</p>\n</li>\n<li><p>provider: The provider of the OTP service.</p>\n</li>\n<li><p>provider_id: The ID of the OTP service provider.</p>\n</li>\n<li><p>delivery_status: The status of OTP delivery.</p>\n</li>\n<li><p>failure_reason: Reason for OTP delivery failure, if any.</p>\n</li>\n<li><p>otp: The One Time Password.</p>\n</li>\n<li><p>max_attempts: The maximum number of OTP attempts allowed.</p>\n</li>\n<li><p>attempts: The number of OTP attempts made.</p>\n</li>\n<li><p>closed: Indicates whether the OTP request is closed.</p>\n</li>\n<li><p>ttl: The time-to-live for the OTP.</p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example\">Example</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"to\": \"user@example.com\",\n    \"extra\": \"Additional info\",\n    \"action\": \"Login\",\n    \"otp\": \"123456\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","otp","sixcharusername"],"host":["{{host}}"],"query":[],"variable":[]}},"response":[{"id":"f23d91b7-79ae-414e-bedc-0f99cf076544","name":"OTP Verify - Successful","originalRequest":{"method":"POST","header":[{"key":"X-API-Key","value":"{{apikey}}"}],"body":{"mode":"formdata","formdata":[{"key":"to","value":"14084446640","type":"text"},{"key":"extra","value":"{\"VAR\":\"TestVariable\"}","type":"text"},{"key":"action","value":"check","type":"text"},{"key":"otp","value":"634086","type":"text"}]},"url":"https://{{host}}/api/otp/sixcharusername"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Vary","value":"Origin"},{"key":"Content-Length","value":"361"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"data\": {\n        \"namespace\": \"prod\",\n        \"id\": \"sixcharusername\",\n        \"to\": \"14084446640\",\n        \"channel_description\": \"\",\n        \"address_description\": \"\",\n        \"extra\": {\n            \"VAR\": \"TestVariable\"\n        },\n        \"provider\": \"msg91_sms_lucglo\",\n        \"provider_id\": \"3468736b7064373836363131\",\n        \"delivery_status\": \"DELIVERED\",\n        \"failure_reason\": \"\",\n        \"otp\": \"634086\",\n        \"max_attempts\": 5,\n        \"attempts\": 2,\n        \"closed\": true,\n        \"ttl\": 282\n    }\n}"},{"id":"be39b9bd-2f56-4e63-8002-3a72f461a306","name":"OTP Verify - Timeout","originalRequest":{"method":"POST","header":[{"key":"X-API-Key","value":"{{apikey}}"}],"body":{"mode":"formdata","formdata":[{"key":"to","value":"14084446640","type":"text"},{"key":"extra","value":"{\"VAR\":\"TestVariable\"}","type":"text"},{"key":"action","value":"check","type":"text"},{"key":"otp","value":"444989","type":"text"}]},"url":"https://{{host}}/api/otp/sixcharusername"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Vary","value":"Origin"},{"key":"Content-Length","value":"305"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"error\",\n    \"message\": \"error checking OTP.\",\n    \"data\": {\n        \"namespace\": \"prod\",\n        \"id\": \"sixcharusername\",\n        \"to\": \"\",\n        \"channel_description\": \"\",\n        \"address_description\": \"\",\n        \"extra\": null,\n        \"provider\": \"\",\n        \"provider_id\": \"\",\n        \"delivery_status\": \"\",\n        \"failure_reason\": \"\",\n        \"otp\": \"\",\n        \"max_attempts\": 0,\n        \"attempts\": 0,\n        \"closed\": true,\n        \"ttl\": 0\n    }\n}"},{"id":"bd50876d-3798-4728-be39-a8907aeaf566","name":"OTP Verify - Incorrect OTP","originalRequest":{"method":"POST","header":[{"key":"X-API-Key","value":"{{apikey}}"}],"body":{"mode":"formdata","formdata":[{"key":"to","value":"14084446640","type":"text"},{"key":"extra","value":"{\"VAR\":\"TestVariable\"}","type":"text"},{"key":"action","value":"check","type":"text"},{"key":"otp","value":"123456","type":"text"}]},"url":"https://{{host}}/api/otp/sixcharusername"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Vary","value":"Origin"},{"key":"Content-Length","value":"384"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"error\",\n    \"message\": \"Incorrect OTP\",\n    \"data\": {\n        \"namespace\": \"prod\",\n        \"id\": \"sixcharusername\",\n        \"to\": \"14084446640\",\n        \"channel_description\": \"\",\n        \"address_description\": \"\",\n        \"extra\": {\n            \"VAR\": \"TestVariable\"\n        },\n        \"provider\": \"msg91_sms_lucglo\",\n        \"provider_id\": \"3468736b7469383233383238\",\n        \"delivery_status\": \"PENDING\",\n        \"failure_reason\": \"\",\n        \"otp\": \"050083\",\n        \"max_attempts\": 5,\n        \"attempts\": 2,\n        \"closed\": false,\n        \"ttl\": 290\n    }\n}"},{"id":"7346307e-9561-4abe-bec2-fc01deb64e33","name":"OTP Verify - API Excess Limit","originalRequest":{"method":"POST","header":[{"key":"X-API-Key","value":"{{apikey}}"}],"body":{"mode":"formdata","formdata":[{"key":"to","value":"14084446640","type":"text"},{"key":"extra","value":"{\"VAR\":\"TestVariable\"}","type":"text"},{"key":"action","value":"check","type":"text"},{"key":"otp","value":"790503","type":"text"}]},"url":"https://{{host}}/api/otp/sixcharusername"},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Vary","value":"Origin"},{"key":"Content-Length","value":"97"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"error\",\n    \"message\": \"API Key usage limit reached! Allowed rate is 12 API calls per hour\"\n}"}],"_postman_id":"d0035f7d-54f1-4e3d-9eb2-a54eef87e238"},{"name":"OTP Status","id":"ac062432-b186-4823-beba-c52f30f6ae3d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"X-API-Key","value":"{{apikey}}"}],"body":{"mode":"formdata","formdata":[{"key":"to","value":"","type":"text","disabled":true},{"key":"extra","value":"","type":"text","disabled":true},{"key":"","value":"","type":"text","disabled":true}]},"url":"https://{{host}}/api/otp/sixcharusername/status","description":"<h3 id=\"post-otpsixcharusernamestatus\">POST /otp/sixcharusername/status</h3>\n<p>This endpoint is used to check the status of a six-character username OTP.</p>\n<h4 id=\"request\">Request</h4>\n<p>The request should be sent as an HTTP POST to the specified URL with form-data as the request body type. The request body should include the following parameters:</p>\n<ul>\n<li><p><code>to</code> (text): The recipient to whom the OTP was sent.</p>\n</li>\n<li><p><code>extra</code> (text): Any extra information related to the OTP.</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>Upon a successful execution, the response will have a status code of 200 and a content type of <code>application/json</code>. The response body will contain a JSON object with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"object\",\n    \"properties\": {\n        \"status\": {\n            \"type\": \"string\"\n        },\n        \"data\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"namespace\": {\n                    \"type\": \"string\"\n                },\n                \"id\": {\n                    \"type\": \"string\"\n                },\n                \"to\": {\n                    \"type\": \"string\"\n                },\n                \"channel_description\": {\n                    \"type\": \"string\"\n                },\n                \"address_description\": {\n                    \"type\": \"string\"\n                },\n                \"extra\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                        \"VAR\": {\n                            \"type\": \"string\"\n                        }\n                    }\n                },\n                \"provider\": {\n                    \"type\": \"string\"\n                },\n                \"provider_id\": {\n                    \"type\": \"string\"\n                },\n                \"delivery_status\": {\n                    \"type\": \"string\"\n                },\n                \"failure_reason\": {\n                    \"type\": \"string\"\n                },\n                \"otp\": {\n                    \"type\": \"string\"\n                },\n                \"max_attempts\": {\n                    \"type\": \"integer\"\n                },\n                \"attempts\": {\n                    \"type\": \"integer\"\n                },\n                \"closed\": {\n                    \"type\": \"boolean\"\n                },\n                \"ttl\": {\n                    \"type\": \"integer\"\n                }\n            }\n        }\n    }\n}\n\n</code></pre>\n<p>The <code>status</code> field will indicate the status of the OTP, and the response will also include detailed information about the OTP status in the <code>data</code> field.</p>\n","urlObject":{"protocol":"https","path":["api","otp","sixcharusername","status"],"host":["{{host}}"],"query":[],"variable":[]}},"response":[{"id":"51ef0bff-8445-4279-a9c8-c7de5488fde3","name":"OTP Status - Before OTP Verification","originalRequest":{"method":"POST","header":[{"key":"X-API-Key","value":"qoeEx6VRdAX6WQsy"},{"key":"otp","value":"123456"}],"body":{"mode":"formdata","formdata":[{"key":"to","value":"+15628529760","type":"text"},{"key":"extra","value":"{ \"yes\": true }","type":"text"},{"key":"","value":"","type":"text","disabled":true}]},"url":"https://{{host}}/api/otp/sixcharusername/status"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Vary","value":"Origin"},{"key":"Content-Length","value":"48"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"error\",\n    \"message\": \"OTP not verified.\"\n}"},{"id":"feb4fce9-33c6-4f32-a50b-f15abf132736","name":"OTP Status - After OTP Verification","originalRequest":{"method":"POST","header":[{"key":"X-API-Key","value":"{{apikey}}"},{"key":"otp","value":"123456"}],"body":{"mode":"formdata","formdata":[{"key":"to","value":"+15628529760","type":"text"},{"key":"extra","value":"{ \"yes\": true }","type":"text"},{"key":"","value":"","type":"text","disabled":true}]},"url":"https://{{host}}/api/otp/sixcharusername/status"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Vary","value":"Origin"},{"key":"Content-Length","value":"53"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"error\",\n    \"message\": \"the OTP does not exist\"\n}"},{"id":"6c3f3552-0a69-4cea-9c88-612ab7a015ca","name":"OTP Status - SMS Delivered","originalRequest":{"method":"POST","header":[{"key":"X-API-Key","value":"{{apikey}}"},{"key":"","value":"","disabled":true}],"body":{"mode":"formdata","formdata":[{"key":"to","value":"","type":"text","disabled":true},{"key":"extra","value":"","type":"text","disabled":true},{"key":"","value":"","type":"text","disabled":true}]},"url":"https://{{host}}/api/otp/sixcharusername/status"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Vary","value":"Origin"},{"key":"Content-Length","value":"362"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"data\": {\n        \"namespace\": \"prod\",\n        \"id\": \"sixcharusername\",\n        \"to\": \"14084446640\",\n        \"channel_description\": \"\",\n        \"address_description\": \"\",\n        \"extra\": {\n            \"VAR\": \"TestVariable\"\n        },\n        \"provider\": \"msg91_sms_lucglo\",\n        \"provider_id\": \"3468736a3361373533363639\",\n        \"delivery_status\": \"DELIVERED\",\n        \"failure_reason\": \"\",\n        \"otp\": \"579800\",\n        \"max_attempts\": 5,\n        \"attempts\": 2,\n        \"closed\": false,\n        \"ttl\": 111\n    }\n}"},{"id":"63ac5230-5633-4044-a63a-01d80057c90a","name":"OTP Status - SMS Pending","originalRequest":{"method":"POST","header":[{"key":"X-API-Key","value":"{{apikey}}"},{"key":"","value":"","disabled":true}],"body":{"mode":"formdata","formdata":[{"key":"to","value":"","type":"text","disabled":true},{"key":"extra","value":"","type":"text","disabled":true},{"key":"","value":"","type":"text","disabled":true}]},"url":"https://{{host}}/api/otp/sixcharusername/status"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Vary","value":"Origin"},{"key":"Content-Length","value":"360"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"data\": {\n        \"namespace\": \"prod\",\n        \"id\": \"sixcharusername\",\n        \"to\": \"15628529760\",\n        \"channel_description\": \"\",\n        \"address_description\": \"\",\n        \"extra\": {\n            \"VAR\": \"TestVariable\"\n        },\n        \"provider\": \"msg91_sms_lucglo\",\n        \"provider_id\": \"3468736a377a313436353736\",\n        \"delivery_status\": \"PENDING\",\n        \"failure_reason\": \"\",\n        \"otp\": \"508238\",\n        \"max_attempts\": 5,\n        \"attempts\": 3,\n        \"closed\": false,\n        \"ttl\": 295\n    }\n}"}],"_postman_id":"ac062432-b186-4823-beba-c52f30f6ae3d"}],"id":"a2383247-16eb-44e8-bdaf-51c9a538d285","_postman_id":"a2383247-16eb-44e8-bdaf-51c9a538d285","description":""}]}