{"info":{"_postman_id":"daa8a183-4c45-4af3-98ee-a0db99cd4a48","name":"2Factor API Documentation","description":"<html><head></head><body><p>2Factor provides a robust and scalable HTTP API platform for sending SMS OTPs, transactional messages, and promotional bulk SMS efficiently.</p>\n<p>In addition to SMS services, we also provide advanced WhatsApp solutions: <a href=\"https://2factor.in/v3/lp/Chatbots/Whatsapp-Chatbot-Provider.php\">WhatsApp Chatbot Provider</a>, <a href=\"https://2factor.in/v3/lp/blogs/What-is-WhatsApp-Business-API-The-Complete-Guide-2025\">WhatsApp Business API Guide 2025</a>, and <a href=\"https://2factor.in/v3/lp/whatsapp-api-service-provider-in-india.php\">WhatsApp API Service Provider in India</a>.  </p>\n<hr>\n<h1 id=\"authentication\"><strong>Authentication</strong></h1>\n<p>2Factor employs API key-based authentication to ensure secure access. Each client is assigned a unique <code>APIKey</code> that identifies their account.</p>\n<p><strong>Additional Security Features:</strong></p>\n<ul>\n<li><strong>IP-Based Restrictions</strong>: To enhance security, clients can restrict API access to a specific set of IP addresses.</li>\n</ul>\n<hr>\n<h1 id=\"api-throughput-and-scalability\">API Throughput and Scalability</h1>\n<p>The <strong>2Factor Cloud API</strong> is designed for enterprise-grade performance and reliability, trusted by leading organizations.</p>\n<h4 id=\"default-performance\">Default Performance</h4>\n<ul>\n<li><p><strong>Throughput</strong>: Supports up to <strong>200 requests per second</strong> under default configurations.</p>\n</li>\n<li><p><strong>Response Times</strong>: Average response times range from <strong>100 ms to 500 ms</strong>.</p>\n</li>\n</ul>\n<h4 id=\"high-availability-ha-cluster-for-enhanced-scalability\">High Availability (HA) Cluster for Enhanced Scalability</h4>\n<p>For clients with high scalability needs, we offer a <strong>High Availability (HA) Cluster</strong> infrastructure:</p>\n<ul>\n<li><p><strong>Throughput</strong>: Supports up to <strong>2000 transactions per second (TPS)</strong>.</p>\n</li>\n<li><p><strong>Response Times</strong>: Average response times range from <strong>50ms to 150 ms</strong>.</p>\n</li>\n</ul>\n<h4 id=\"scalability-requests\">Scalability Requests</h4>\n<p>To scale up or discuss your specific requirements, contact <a href=\"https://null\"><b>support@2factor.in</b></a>.</p>\n<hr>\n<h1 id=\"data-privacy-security-measures\">Data Privacy &amp; Security Measures</h1>\n<p>At <strong>2Factor</strong>, safeguarding customer data is a top priority. The following measures ensure that all data is securely processed, stored, and accessed in compliance with industry standards:</p>\n<hr>\n<h3 id=\"security-measures\">Security Measures</h3>\n<h4 id=\"api-hosting-and-encryption\"><strong>API Hosting and Encryption</strong></h4>\n<ul>\n<li><p><strong>Cloudflare Serverless Environment</strong>: All <strong>2Factor API endpoints</strong> are hosted on Cloudflare's serverless environment for scalability.</p>\n</li>\n<li><p><strong>End-to-End Encryption</strong>: Cloudflare employs <strong>SSL/TLS encryption</strong> to ensure secure transmission of data between the client, Cloudflare, and 2Factor's backend systems.</p>\n</li>\n</ul>\n<h4 id=\"threat-intelligence-and-protection\"><strong>Threat Intelligence and Protection</strong></h4>\n<ul>\n<li><p><strong>Web Application Firewall (WAF)</strong>: Cloudflare’s WAF protects publicly accessible API endpoints from vulnerabilities and unauthorized access attempts.</p>\n<ul>\n<li><p><strong>Rule Set</strong>: Protects against thousands of commonly known web exploits and intrusion attempts.</p>\n</li>\n<li><p><strong>IP-Based Restrictions</strong>: Backend systems enforce strict IP-based access controls to block unintended audiences.</p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"brute-force-and-local-firewall-protection\"><strong>Brute Force and Local Firewall Protection</strong></h4>\n<ul>\n<li><p>Each Linux virtual machine (VM) hosting code and data stores is secured with:</p>\n<ul>\n<li><p>A <strong>local firewall</strong>.</p>\n</li>\n<li><p><strong>Brute-force monitoring software</strong> to detect and prevent unauthorized login attempts.</p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"logging-and-monitoring\"><strong>Logging and Monitoring</strong></h4>\n<ul>\n<li>Random checks are conducted to monitor access attempts to data stores or VMs from unauthorized IPs, ensuring continuous oversight of system security.</li>\n</ul>\n<hr>\n<h3 id=\"additional-security-features-for-clients\">Additional Security Features for Clients</h3>\n<h4 id=\"ip-based-access-control\"><strong>IP-Based Access Control</strong></h4>\n<ul>\n<li><strong>Client-Specific IP Restrictions</strong>: Clients can enforce IP-based restrictions on their API accounts to prevent unauthorized use.</li>\n</ul>\n<hr>\n<h3 id=\"data-retention-and-disposal-policies\">Data Retention and Disposal Policies</h3>\n<h4 id=\"data-retention\"><strong>Data Retention</strong></h4>\n<ul>\n<li><p><strong>Banking Clients</strong>: Data is retained for <strong>7 years</strong>, as required by industry regulations.</p>\n</li>\n<li><p><strong>Other Clients</strong>: Data is typically retained for <strong>1 year</strong>, after which it is archived in flat files.</p>\n</li>\n</ul>\n<h4 id=\"data-archival-and-disposal\"><strong>Data Archival and Disposal</strong></h4>\n<ul>\n<li><p>After the retention period, data is dumped into <strong>SQL flat files</strong> and stored in <strong>S3/S3-compatible cold storage</strong>.</p>\n</li>\n<li><p>While no formal archival/disposal agreements exist, the above process ensures long-term data security and compliance.</p>\n</li>\n</ul>\n<hr>\n<h3 id=\"access-to-sms-logs\">Access to SMS Logs</h3>\n<h4 id=\"multi-factor-authentication\"><strong>Multi-Factor Authentication</strong></h4>\n<ul>\n<li><p>To access SMS logs, users must complete <strong>2-factor authentication</strong>:</p>\n<ul>\n<li><p><strong>Step 1</strong>: Log in with a username and password.</p>\n</li>\n<li><p><strong>Step 2</strong>: Verify the login attempt using an SMS OTP sent to the registered phone number.</p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"access-control\"><strong>Access Control</strong></h4>\n<ul>\n<li><p><strong>Account Owners</strong>: Full access to SMS logs.</p>\n</li>\n<li><p><strong>2Factor Technical Support Team</strong>: Limited access on a <strong>need-to-know basis</strong> to resolve support tickets.</p>\n</li>\n<li><p><strong>Third Parties</strong>: No access is provided to external entities or unauthorized users.</p>\n</li>\n</ul>\n<hr>\n<h3 id=\"contact\">Contact</h3>\n<p>For more information about 2Factor’s security measures, data retention policies, or access controls, reach out to our support team at <a href=\"https://null\"><b>support@2factor.in</b></a>.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Authentication","slug":"authentication"},{"content":"API Throughput and Scalability","slug":"api-throughput-and-scalability"},{"content":"Data Privacy & Security Measures","slug":"data-privacy-security-measures"}],"owner":"301893","collectionId":"daa8a183-4c45-4af3-98ee-a0db99cd4a48","publishedId":"TWDamFGh","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-02-24T16:02:12.000Z"},"item":[{"name":"Getting Started","item":[{"name":"1: Create a 2Factor Account","item":[],"id":"9c41c219-48c5-4432-b3d2-15f333fd322f","description":"<h3 id=\"how-to-create-a-free-trial-account-on-2factor\">How to Create a Free Trial Account on 2Factor</h3>\n<p>To get started with <strong>2Factor</strong>, follow these steps:</p>\n<hr />\n<h3 id=\"requirements-for-free-trial-signup\"><strong>Requirements for Free Trial Signup</strong></h3>\n<ol>\n<li><p><strong>Email ID</strong>: Your valid email address.</p>\n</li>\n<li><p><strong>Phone Number</strong>: A phone number to register your account.</p>\n</li>\n</ol>\n<hr />\n<h3 id=\"steps-to-create-a-free-trial-account\"><strong>Steps to Create a Free Trial Account</strong></h3>\n<ol>\n<li><p>Visit the <strong>2Factor signup page</strong>.</p>\n</li>\n<li><p>Enter your <strong>Email ID</strong> and <strong>Phone Number</strong> to register.</p>\n</li>\n<li><p>Upon successful registration:</p>\n<ul>\n<li><p>You will receive <strong>250 free credits</strong> to test and integrate our services.</p>\n</li>\n<li><p>Account details will be sent to your <strong>registered email address</strong>.</p>\n</li>\n</ul>\n</li>\n</ol>\n<hr />\n<h3 id=\"preparing-to-send-sms-via-2factor\"><strong>Preparing to Send SMS via 2Factor</strong></h3>\n<p>Before you can send SMS messages, ensure the following prerequisites are ready:</p>\n<ol>\n<li><p><strong>Sender ID/Header</strong>:</p>\n<ul>\n<li><p>A unique, <strong>6-character identifier</strong> representing your company or brand name.</p>\n</li>\n<li><p>Example: <code>MYBRND</code>.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>SMS Template</strong>:</p>\n<ul>\n<li><p>The predefined text message you intend to send.</p>\n</li>\n<li><p>Templates must comply with DLT guidelines.</p>\n</li>\n</ul>\n</li>\n</ol>\n<hr />\n<h3 id=\"requesting-sender-id-and-template-approval\"><strong>Requesting Sender ID and Template Approval</strong></h3>\n<ol>\n<li><p>Log in to the <strong>2Factor Dashboard</strong>.</p>\n</li>\n<li><p>Navigate to:</p>\n<ul>\n<li><strong>Transactional SMS &gt; Manage Sender IDs &gt; Request Sender ID/Template</strong>.</li>\n</ul>\n</li>\n<li><p>Submit your Sender ID and SMS Template for approval.</p>\n</li>\n</ol>\n<ul>\n<li><p><strong>Approval Time</strong>: Templates are usually approved within <strong>30 minutes to 1 hour</strong> during working hours.</p>\n</li>\n<li><p>Once approved:</p>\n<ul>\n<li><p>You will receive an <strong>email notification</strong>.</p>\n</li>\n<li><p>The approved Sender ID and Template, along with the relevant <strong>API endpoint</strong>, will be shared.</p>\n</li>\n</ul>\n</li>\n</ul>\n<hr />\n<h3 id=\"begin-api-testing\"><strong>Begin API Testing</strong></h3>\n<p>Once your Sender ID and Template are approved:</p>\n<ul>\n<li><p>You can start testing the <strong>2Factor API</strong> immediately.</p>\n</li>\n<li><p>API documentation and credentials will be provided in your email.</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"dlt-registration-for-sms-delivery\"><strong>DLT Registration for SMS Delivery</strong></h3>\n<p>To successfully deliver SMS messages, you must complete the <strong>DLT Registration process</strong>. This process ensures compliance with regulatory requirements. For more details on DLT registration, refer to <strong>Step 2</strong> of the documentation.</p>\n<hr />\n<p>If you have any questions or need assistance, contact us at <a href=\"https://null\"><b>support@2factor.in</b></a>.</p>\n","_postman_id":"9c41c219-48c5-4432-b3d2-15f333fd322f"},{"name":"2: Complete DLT Registration","item":[],"id":"e15c57d0-7d23-4484-bcd1-4175e233b857","description":"<p><strong>Overview of DLT Registration</strong></p>\n<p>The Telecom Regulatory Authority of India (TRAI) mandates that all entities engaging in commercial communications register on the Distributed Ledger Technology (DLT) platform. This initiative aims to curb Unsolicited Commercial Communication (UCC) and enhance mobile subscriber privacy in India. Detailed information about these regulations is available in the Telecom Commercial Communications Customer Preference Regulation, 2018 (TCCCPR 2018)  </p>\n<p><strong>Purpose of These Changes</strong></p>\n<p>The primary objective is to reduce the incidence of fraud and spam via SMS and voice calls. By conducting Know Your Customer (KYC) processes with telecom operators, end-to-end traceability is ensured in cases of fraudulent activities. Additionally, pre-defining SMS content helps control spam and prevent deceptive messages.</p>\n<p><strong>Enterprises vs. Telemarketers</strong></p>\n<p>The DLT platform categorizes registrants as either Enterprises or Telemarketers:</p>\n<ul>\n<li><p><strong>Enterprises</strong>: Commercial businesses (individuals or companies) offering products or services and seeking to communicate with customers via SMS or voice services.</p>\n</li>\n<li><p><strong>Telemarketers</strong>: Entities that facilitate communication on behalf of enterprises. They are further classified into:</p>\n<ul>\n<li><p><strong>Telemarketer Aggregators</strong>: Individuals or companies that collect SMS/voice traffic from enterprises without a direct connection to telecom operators.</p>\n</li>\n<li><p><strong>Telemarketer Delivery</strong>: Individuals or companies that collect SMS/voice traffic from enterprises and have a direct connection with telecom operators.</p>\n</li>\n</ul>\n</li>\n</ul>\n<p><strong>Note</strong>: You or your clients must register on the DLT platform as an <strong>Enterprise</strong>. Solv Technologies (2Factor) will act as the Telemarketer on your behalf. Our Telemarketer Registration Number is (1002884117264848 - SOLV TECHNOLOGIES)</p>\n<p><strong>How to Register on the DLT Platform</strong></p>\n<p>If you intend to send SMS messages to users in India, DLT registration is mandatory. Registration with at least one telecom operator is required.</p>\n<p>We recommend starting with Vodafone's DLT platform, as their support is prompt and approval times are minimal. Alternatively, you may choose other telecom operators' DLT portals.</p>\n<ul>\n<li><p><a href=\"https://2factor.in/v3/dlt/vodafone-vilpower-dlt-steps/\"><b>Vodafone DLT Registartion Guide</b></a></p>\n</li>\n<li><p><a href=\"https://2factor.in/v3/dlt/airtel-dlt-steps/index.html\">Airtel DLT Registration Guide</a></p>\n</li>\n<li><p><a href=\"https://2factor.in/v3/dlt/videocon-vispl-smartping-dlt-steps/\">Videocon DLT Registration Guide<br /></a></p>\n</li>\n</ul>\n<p>For further assistance, feel free to contact us at <a href=\"https://null\">support@2factor.in</a>.</p>\n","_postman_id":"e15c57d0-7d23-4484-bcd1-4175e233b857"},{"name":"3: Link Your DLT Account with 2Factor","item":[],"id":"8b58d562-2399-469f-b894-f8b5181ed52e","description":"<p>After your SMS templates have been approved on the <strong>DLT Portal</strong>, the next step is to map them to your <strong>2Factor account</strong>. This ensures seamless integration between your DLT-registered templates and 2Factor's Cloud SMS API.</p>\n<hr />\n<h3 id=\"steps-to-link-your-dlt-account\"><strong>Steps to Link Your DLT Account</strong></h3>\n<ol>\n<li><p><a href=\"https://dlt-registration.2factor.in\"><b>Log in to the 2Factor DLT Portal ( </b>https://dlt-registration.2factor.in</a> )</p>\n<ul>\n<li>Navigate to the <strong>DLT Registration</strong> section under <strong>\"My DLT Registrations\"</strong>.</li>\n</ul>\n</li>\n<li><p><strong>Update Your DLT Details</strong>:</p>\n<ul>\n<li><p>Enter the <strong>DLT Principal Entity ID (PE ID)</strong> associated with your approved templates.</p>\n</li>\n<li><p>Ensure that all required fields, such as your DLT registration number and sender ID, are correctly updated.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Mapping Process</strong>:</p>\n<ul>\n<li><p>Once your details are submitted, 2Factor will map your templates to its system.</p>\n</li>\n<li><p>This process typically takes a few hours to complete.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Account Activation</strong>:</p>\n<ul>\n<li><p>After the mapping is finalized, your <strong>Cloud SMS API account</strong> will be activated.</p>\n</li>\n<li><p>You will receive an email notification confirming the completion of the setup.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Send a Test Message</strong>:</p>\n<ul>\n<li>Use your mapped templates to send a test SMS via the 2Factor API.</li>\n</ul>\n</li>\n</ol>\n<hr />\n<h3 id=\"important-notes\"><strong>Important Notes</strong></h3>\n<ul>\n<li><p>Ensure the <strong>DLT templates</strong> and <strong>sender IDs</strong> you submit match those approved by your telecom operator.</p>\n</li>\n<li><p>Mapping delays are minimal but may vary depending on template and sender ID validation.</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"support\"><strong>Support</strong></h3>\n<p>For assistance with DLT account mapping or any other inquiries, contact us at <a href=\"https://null\"><b>support@2factor.in</b></a>.</p>\n","_postman_id":"8b58d562-2399-469f-b894-f8b5181ed52e"}],"id":"bc198c63-7c63-45a4-9070-c6992e6421aa","_postman_id":"bc198c63-7c63-45a4-9070-c6992e6421aa","description":""},{"name":"Send SMS OTP","item":[{"name":"Send OTP - AUTOGEN","item":[{"name":"Send OTP ( AUTOGEN )","id":"e169bd6f-1356-4bff-998b-19f83f9825f4","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"connection":true,"accept-encoding":true,"accept":true,"user-agent":true},"strictSSL":false,"followRedirects":false,"disableUrlEncoding":true},"request":{"method":"GET","header":[],"url":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN/:otp_template_name","description":"<p>Use this endpoint to send a system-generated 6-digit OTP directly to the end user. The OTP is automatically generated by <strong>2Factor.in</strong>, ensuring randomness and security.</p>\n","urlObject":{"protocol":"https","path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN",":otp_template_name"],"host":["2factor","in"],"query":[],"variable":[{"description":{"content":"<p>APIKey value obtained from 2Factor.in</p>\n","type":"text/plain"},"type":"any","value":"XXXX-XXXX-XXXX-XXXX-XXXX","key":"api_key"},{"description":{"content":"<p>Phone number formated in the international number format ( +</p>\n","type":"text/plain"},"type":"any","value":"+919999999999","key":"phone_number"},{"description":{"content":"<p>(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up.</p>\n","type":"text/plain"},"type":"any","value":"OTP1","key":"otp_template_name"}]}},"response":[{"id":"241ccba1-d799-4774-9bac-e78621cd6d1d","name":"OTP Sent Successfully","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Success\",\n    \"Details\": \"ab88279e-0105-415f-912e-2f24162b8cbb\"\n}"},{"id":"75858ef8-e78e-4273-9e53-c724fdf7b82c","name":"Invalid Phone Number Length","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Error\",\n    \"Details\": \"Invalid Phone Number - Length Mismatch(Expected: 10)\"\n}"},{"id":"cc5b4bc6-45f3-4ff2-91aa-0f091a816de9","name":"Invalid API Key Provided","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Error\",\n    \"Details\": \"Invalid API Key\"\n}"},{"id":"f076ed69-01f2-4ecf-9501-262a29e183ed","name":"Invalid OTP value length","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Error\",\n    \"Details\": \"Invalid OTP Code - Length Mismatch(Expected: 4-6)\"\n}"}],"_postman_id":"e169bd6f-1356-4bff-998b-19f83f9825f4"},{"name":"Send OTP ( AUTOGEN2 )","id":"5ac86c3d-878e-455f-ab77-f0eb2b6fa61b","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"connection":true,"accept-encoding":true,"accept":true,"user-agent":true},"strictSSL":false,"followRedirects":false,"disableUrlEncoding":true},"request":{"method":"GET","header":[],"url":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN2/:otp_template_name","description":"<p>Use this endpoint to send a system-generated 6-digit OTP to the end user. The generated OTP value is included in the <strong>API response</strong>, allowing your application to directly use it for validation purposes.</p>\n<h4 id=\"sample-api-response\"><strong>Sample API Response</strong></h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>jsonCopy code{\n  \"Status\": \"Success\",\n  \"Details\": \"l60gaseavbemjvlgw7o-7303503698702e11\",\n  \"OTP\": \"565059\"\n}\n\n</code></pre><ul>\n<li><p><strong>Status</strong>: Indicates the success of the API request.</p>\n</li>\n<li><p><strong>Details</strong>: A unique identifier for the OTP request.</p>\n</li>\n<li><p><strong>OTP</strong>: The 6-digit OTP generated by the system.</p>\n</li>\n</ul>\n<hr />\n<h4 id=\"verifying-otp\"><strong>Verifying OTP</strong></h4>\n<p>To verify the OTP entered by the user, you have two options:</p>\n<ol>\n<li><p>Use the <strong>VERIFY</strong> endpoint for server-side validation.</p>\n</li>\n<li><p>Match the OTP entered by the user with the <code>OTP</code> value provided in the API response.</p>\n</li>\n</ol>\n","urlObject":{"protocol":"https","path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN2",":otp_template_name"],"host":["2factor","in"],"query":[],"variable":[{"id":"1d7f18c9-c192-468a-92ba-244ea11a95be","description":{"content":"<p>APIKey value obtained from 2Factor.in</p>\n","type":"text/plain"},"type":"any","value":"XXXX-XXXX-XXXX-XXXX-XXXX","key":"api_key"},{"id":"82a1df2e-6dd2-4477-be1b-eafbfed31f53","description":{"content":"<p>Phone number formated in the international number format ( +</p>\n","type":"text/plain"},"type":"any","value":"+919999999999","key":"phone_number"},{"id":"6c9f6b92-baee-41a7-ac29-be1af73d11d9","description":{"content":"<p>(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up.</p>\n","type":"text/plain"},"type":"any","value":"OTP1","key":"otp_template_name"}]}},"response":[{"id":"1d70197f-1957-4893-b0ef-c6f62693c027","name":"OTP Sent Successfully","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN2/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN2",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n  \"Status\": \"Success\",\n  \"Details\": \"l60gaseavbemjvlgw7o-7303503698702e11\",\n  \"OTP\": \"565059\"\n}\n"},{"id":"d585411d-c782-4240-8d9e-610273b19d7b","name":"Invalid Phone Number Length","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN2/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN2",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Error\",\n    \"Details\": \"Invalid Phone Number - Length Mismatch(Expected: 10)\"\n}"},{"id":"61173eeb-acb5-4002-bbf9-b08d3adac785","name":"Invalid API Key Provided","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN2/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN2",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Error\",\n    \"Details\": \"Invalid API Key\"\n}"},{"id":"90268bb1-2d59-4b05-84b7-c2ba52d07904","name":"Invalid OTP value length","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN2/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN2",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Error\",\n    \"Details\": \"Invalid OTP Code - Length Mismatch(Expected: 4-6)\"\n}"}],"_postman_id":"5ac86c3d-878e-455f-ab77-f0eb2b6fa61b"},{"name":"Send OTP ( AUTOGEN3 )","id":"5a887eb4-b72c-46f6-85ff-2d6d820b64d3","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"connection":true,"accept-encoding":true,"accept":true,"user-agent":true},"strictSSL":false,"followRedirects":false,"disableUrlEncoding":true},"request":{"method":"GET","header":[],"url":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN3/:otp_template_name","description":"<h4 id=\"sending-otp\"><strong>Sending OTP</strong></h4>\n<p>Use this endpoint to send a system-generated 4-digit OTP to the end user. The OTP is automatically generated and securely transmitted.</p>\n<h4 id=\"verifying-otp\"><strong>Verifying OTP</strong></h4>\n<p>To validate the OTP entered by the user, use the <strong>VERIFY</strong> endpoint provided below. This ensures the entered OTP matches the system-generated value.</p>\n","urlObject":{"protocol":"https","path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN3",":otp_template_name"],"host":["2factor","in"],"query":[],"variable":[{"id":"60a38960-bc22-4b7e-94cc-5a02d29d2930","description":{"content":"<p>APIKey value obtained from 2Factor.in</p>\n","type":"text/plain"},"type":"any","value":"XXXX-XXXX-XXXX-XXXX-XXXX","key":"api_key"},{"id":"aca989c9-da87-4b97-8f91-4ac5f8fdd8ad","description":{"content":"<p>Phone number formated in the international number format ( +</p>\n","type":"text/plain"},"type":"any","value":"+919999999999","key":"phone_number"},{"id":"34bdc5fa-38eb-43d0-8db5-68ff91e0c178","description":{"content":"<p>(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up.</p>\n","type":"text/plain"},"type":"any","value":"OTP1","key":"otp_template_name"}]}},"response":[{"id":"021a37e9-f1b8-4770-adab-080ebcb7c669","name":"OTP Sent Successfully","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Success\",\n    \"Details\": \"ab88279e-0105-415f-912e-2f24162b8cbb\"\n}"},{"id":"7447ec6e-a777-4c9b-a46c-b00149f7565f","name":"Invalid Phone Number Length","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Error\",\n    \"Details\": \"Invalid Phone Number - Length Mismatch(Expected: 10)\"\n}"},{"id":"17f7dc3e-5667-4bae-94b5-1fb5474b2be2","name":"Invalid API Key Provided","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Error\",\n    \"Details\": \"Invalid API Key\"\n}"},{"id":"295a1a13-fb67-43ff-8fc0-b1fbdc26c294","name":"Invalid OTP value length","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/AUTOGEN/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number","AUTOGEN",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Error\",\n    \"Details\": \"Invalid OTP Code - Length Mismatch(Expected: 4-6)\"\n}"}],"_postman_id":"5a887eb4-b72c-46f6-85ff-2d6d820b64d3"}],"id":"e2f9aba1-369d-4b94-b28c-9bcc61d360c5","description":"<p>The following endpoints are designed for scenarios where <strong>2Factor.in automatically generates a random OTP</strong> and sends it to the end user.</p>\n<hr />\n<h4 id=\"sending-otp\"><strong>Sending OTP</strong></h4>\n<p>Use the specified API endpoint to send a randomly generated OTP to the end user. This eliminates the need for manual OTP generation on the client side.</p>\n<hr />\n<h4 id=\"verifying-otp\"><strong>Verifying OTP</strong></h4>\n<p>To verify the OTP value entered by the end user, utilize the <strong>VERIFY OTP</strong> API endpoints. These endpoints ensure the accuracy and validity of the entered OTP against the generated value.</p>\n<hr />\n<p>These endpoints streamline the OTP management process, providing secure and efficient functionality for user authentication workflows.</p>\n","_postman_id":"e2f9aba1-369d-4b94-b28c-9bcc61d360c5"},{"name":"Send OTP - Custom OTP","item":[{"name":"Send OTP ( Manual Generation )","id":"9cd1d2b1-deb6-4eb1-99bc-c1d77a48ec7e","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"connection":true,"accept-encoding":true,"accept":true,"user-agent":true},"strictSSL":false,"followRedirects":false,"disableUrlEncoding":true},"request":{"method":"GET","header":[],"url":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/:otp_value/:otp_template_name","description":"<p>Use this endpoint to send a <strong>custom 4-6 digit OTP value</strong> to the end user. This allows flexibility to define OTP values based on specific application requirements.</p>\n","urlObject":{"protocol":"https","path":["API","V1",":api_key","SMS",":phone_number",":otp_value",":otp_template_name"],"host":["2factor","in"],"query":[],"variable":[{"description":{"content":"<p>APIKey value obtained from 2Factor.in</p>\n","type":"text/plain"},"type":"any","value":"XXXX-XXXX-XXXX-XXXX-XXXX","key":"api_key"},{"description":{"content":"<p>Phone number formated in the international number format ( +</p>\n","type":"text/plain"},"type":"any","value":"+919999999999","key":"phone_number"},{"description":{"content":"<p>4-6 character OTP value to be sent to the user</p>\n","type":"text/plain"},"type":"any","value":"12345","key":"otp_value"},{"description":{"content":"<p>(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up.</p>\n","type":"text/plain"},"type":"any","value":"OTP1","key":"otp_template_name"}]}},"response":[{"id":"4bf61e10-de20-477d-82a3-9f4267e9b53a","name":"OTP Sent Successfully","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/:otp_value/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number",":otp_value",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_value","value":"12345","description":"4-6 character OTP value to be sent to the user"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Success\",\n    \"Details\": \"ab88279e-0105-415f-912e-2f24162b8cbb\"\n}"},{"id":"3aac0359-759e-43e1-87c3-f77f85a62393","name":"Invalid API Key Provided","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/:otp_value/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number",":otp_value",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_value","value":"12345","description":"4-6 character OTP value to be sent to the user"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Error\",\n    \"Details\": \"Invalid API Key\"\n}"},{"id":"7978d80c-8825-4189-946a-e53d9d7ffc6a","name":"Invalid Phone Number Length","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/:otp_value/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number",":otp_value",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_value","value":"123","description":"4-6 character OTP value to be sent to the user"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Error\",\n    \"Details\": \"Invalid Phone Number - Length Mismatch(Expected: 10)\"\n}"},{"id":"d05246c0-4219-4f7b-a9a8-4b3909dde6e9","name":"Invalid OTP value length","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/:phone_number/:otp_value/:otp_template_name","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS",":phone_number",":otp_value",":otp_template_name"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"+919999999999","description":"Phone number formated in the international number format ( +<countryCode><PhoneNumber>"},{"key":"otp_value","value":"123","description":"4-6 character OTP value to be sent to the user"},{"key":"otp_template_name","value":"OTP1","description":"(*optional) Name of the OTP template to be sent. In absense of any value, a default OTP template would be picked up."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"Status\": \"Error\",\n    \"Details\": \"Invalid OTP Code - Length Mismatch(Expected: 4-6)\"\n}"}],"_postman_id":"9cd1d2b1-deb6-4eb1-99bc-c1d77a48ec7e"}],"id":"cabb570d-3d1d-43ac-8302-9f849773ad41","description":"<p>The below endpoints are useful when you want to pass the custom generated OTP value to the end user.</p>\n","_postman_id":"cabb570d-3d1d-43ac-8302-9f849773ad41"},{"name":"Verify OTP Input","item":[{"name":"Verify OTP ( Using OTP Session Id + OTP Value)","id":"2abe0791-c6ff-4310-a9c7-db061b1a4202","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"connection":true,"accept-encoding":true,"accept":true,"user-agent":true},"strictSSL":false,"followRedirects":false,"disableUrlEncoding":true},"request":{"method":"GET","header":[],"url":"https://2factor.in/API/V1/:api_key/SMS/VERIFY/:otp_session_id/:otp_entered_by_user","description":"<p>Use this endpoint to verify the OTP value entered by user.</p>\n","urlObject":{"protocol":"https","path":["API","V1",":api_key","SMS","VERIFY",":otp_session_id",":otp_entered_by_user"],"host":["2factor","in"],"query":[],"variable":[{"description":{"content":"<p>APIKey value obtained from 2Factor.in</p>\n","type":"text/plain"},"type":"any","value":"XXXX-XXXX-XXXX-XXXX-XXXX","key":"api_key"},{"description":{"content":"<p>OTP session id printed in the send OTP request</p>\n","type":"text/plain"},"type":"any","value":"XXXX-XXXX-XXXX-XXXX-XXXX","key":"otp_session_id"},{"description":{"content":"<p>OTP value entered by the end user</p>\n","type":"text/plain"},"type":"any","value":"123455","key":"otp_entered_by_user"}]}},"response":[{"id":"95770fad-82f4-4f16-97d5-caab49a55bbc","name":"OTP Matched","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/VERIFY/:otp_session_id/:otp_entered_by_user","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS","VERIFY",":otp_session_id",":otp_entered_by_user"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"otp_session_id","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"OTP session id printed in the send OTP request"},{"key":"otp_entered_by_user","value":"12345","description":"OTP value entered by the end user"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\"Status\":\"Error\",\"Details\":\"OTP Matched\"}"},{"id":"723cb283-118f-4c26-bc37-b3c053641de4","name":"OTP Mismatched","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/VERIFY/:otp_session_id/:otp_entered_by_user","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS","VERIFY",":otp_session_id",":otp_entered_by_user"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"otp_session_id","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"OTP session id printed in the send OTP request"},{"key":"otp_entered_by_user","value":"12345","description":"OTP value entered by the end user"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\"Status\":\"Error\",\"Details\":\"OTP Mismatch\"}"},{"id":"d202b7a8-24e8-4e98-99fb-e69550448b5e","name":"OTP Expired","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/VERIFY/:otp_session_id/:otp_entered_by_user","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS","VERIFY",":otp_session_id",":otp_entered_by_user"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"otp_session_id","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"OTP session id printed in the send OTP request"},{"key":"otp_entered_by_user","value":"12345","description":"OTP value entered by the end user"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\"Status\":\"Error\",\"Details\":\"OTP Expired\"}"},{"id":"39392938-09a3-453b-8827-3ac6a4a9fe01","name":"Incorrect OTP Session Id Passed","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/VERIFY/:otp_session_id/:otp_entered_by_user","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS","VERIFY",":otp_session_id",":otp_entered_by_user"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"otp_session_id","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"OTP session id printed in the send OTP request"},{"key":"otp_entered_by_user","value":"12345","description":"OTP value entered by the end user"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\r\n  \"Status\": \"Error\",\r\n  \"Details\": \"Invalid API / SessionId Combination - No Entry Exists\"\r\n}"}],"_postman_id":"2abe0791-c6ff-4310-a9c7-db061b1a4202"},{"name":"Verify OTP ( Using PhoneNumber + OTP Value)","id":"80e57b40-920d-4e11-92c0-e9e8430a7e94","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"connection":true,"accept-encoding":true,"accept":true,"user-agent":true},"strictSSL":false,"followRedirects":false,"disableUrlEncoding":true},"request":{"method":"GET","header":[],"url":"https://2factor.in/API/V1/:api_key/SMS/VERIFY3/:phone_number/:otp_entered_by_user","description":"<p>Use this endpoint to verify the OTP value entered by user.</p>\n","urlObject":{"protocol":"https","path":["API","V1",":api_key","SMS","VERIFY3",":phone_number",":otp_entered_by_user"],"host":["2factor","in"],"query":[],"variable":[{"description":{"content":"<p>APIKey value obtained from 2Factor.in</p>\n","type":"text/plain"},"type":"any","value":"XXXX-XXXX-XXXX-XXXX-XXXX","key":"api_key"},{"description":{"content":"<p>Customer's phone number</p>\n","type":"text/plain"},"type":"any","value":"91XXXXXXXXXX","key":"phone_number"},{"description":{"content":"<p>OTP value entered by the end user</p>\n","type":"text/plain"},"type":"any","value":"123455","key":"otp_entered_by_user"}]}},"response":[{"id":"5e755c53-dbaa-476d-a3be-5a674f6587c8","name":"OTP Matched","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/VERIFY3/:phone_number/:otp_entered_by_user","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS","VERIFY3",":phone_number",":otp_entered_by_user"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"91XXXXXXXXXX","description":"Customer's phone number"},{"key":"otp_entered_by_user","value":"12345","description":"OTP value entered by the end user"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\"Status\":\"Error\",\"Details\":\"OTP Matched\"}"},{"id":"c06be9fc-1cbb-4f28-9600-856b320cc816","name":"OTP Mismatched","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/VERIFY3/:phone_number/:otp_entered_by_user","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS","VERIFY3",":phone_number",":otp_entered_by_user"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"91XXXXXXXXXX","description":"Customer's phone number"},{"key":"otp_entered_by_user","value":"12345","description":"OTP value entered by the end user"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\"Status\":\"Error\",\"Details\":\"OTP Mismatch\"}"},{"id":"99f6bab2-8d02-41f4-86d1-00f505c5e914","name":"OTP Expired","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://2factor.in/API/V1/:api_key/SMS/VERIFY3/:phone_number/:otp_entered_by_user","protocol":"https","host":["2factor","in"],"path":["API","V1",":api_key","SMS","VERIFY3",":phone_number",":otp_entered_by_user"],"variable":[{"key":"api_key","value":"XXXX-XXXX-XXXX-XXXX-XXXX","description":"APIKey value obtained from 2Factor.in"},{"key":"phone_number","value":"91XXXXXXXXXX","description":"Customer's phone number"},{"key":"otp_entered_by_user","value":"12345","description":"OTP value entered by the end user"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\"Status\":\"Error\",\"Details\":\"OTP Expired\"}"}],"_postman_id":"80e57b40-920d-4e11-92c0-e9e8430a7e94"}],"id":"9a942ca2-6ba4-4c82-aa6e-44b584ae45fb","description":"<p>2Factor provides two methods to verify the OTP entered by the user, offering flexibility based on your application requirements:</p>\n<ol>\n<li><p><strong>Using Unique SMS Request ID + OTP Value</strong></p>\n<ul>\n<li><p>Verify the OTP by combining the unique request ID (provided in the API response when the OTP was sent) with the OTP value entered by the user.</p>\n</li>\n<li><p>This method ensures precise mapping of the OTP to the specific request.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Using User's Phone Number + OTP Value</strong></p>\n<ul>\n<li><p>Validate the OTP directly against the user's phone number and the OTP value entered by the user.</p>\n</li>\n<li><p>This method is simpler and does not require storing the unique request ID.</p>\n</li>\n</ul>\n</li>\n</ol>\n<hr />\n<p>These verification options ensure secure and efficient validation workflows tailored to different use cases.</p>\n","_postman_id":"9a942ca2-6ba4-4c82-aa6e-44b584ae45fb"},{"name":"Sandbox / Testing","item":[],"id":"6cef8eec-75fc-4629-80f1-e0f83fa992a1","description":"<h1 id=\"2factorin-sandbox-environment\">2Factor.in Sandbox Environment</h1>\n<h2 id=\"overview\">Overview</h2>\n<p>The 2Factor.in Sandbox Environment allows developers to integrate and test SMS OTP APIs without sending actual SMS messages or incurring charges. This testing environment provides realistic API responses that mimic production behavior, enabling seamless development and testing workflows.</p>\n<h2 id=\"how-to-enable-sandbox-mode\">How to Enable Sandbox Mode</h2>\n<p>To enable sandbox/testing endpoints for your account:</p>\n<ol>\n<li><p><strong>Send an email to</strong>: <code>support@2factor.in</code></p>\n</li>\n<li><p><strong>Include the following information</strong>:</p>\n<ul>\n<li><p>Your account API key</p>\n</li>\n<li><p>Specific sample phone number(s) for testing (e.g., <code>+919920123456</code>)</p>\n</li>\n<li><p>Request to enable sandbox mode for testing purposes</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Wait for confirmation</strong>: Our support team will confirm when sandbox mode is activated for your account and specified phone numbers.</p>\n</li>\n</ol>\n<h2 id=\"sandbox-endpoints\">Sandbox Endpoints</h2>\n<p>Once enabled, all API endpoints will return dummy responses instead of sending actual SMS messages. The sandbox maintains the same URL structure as production endpoints.</p>\n<h3 id=\"base-url\">Base URL</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>https://2factor.in/API/V1/{your-api-key}/SMS/\n\n</code></pre><hr />\n<h2 id=\"sms-generation-endpoints\">SMS Generation Endpoints</h2>\n<h3 id=\"1-auto-generated-otp-autogen\">1. Auto-Generated OTP (AUTOGEN)</h3>\n<p><strong>Endpoint Pattern:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET https://2factor.in/API/V1/{api-key}/SMS/{phone}/AUTOGEN/{template}\nGET https://2factor.in/API/V1/{api-key}/SMS/{phone}/AUTOGEN\n\n</code></pre><p><strong>Example Request:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET https://2factor.in/API/V1/XXXX-XXXX-XXXX-XXXX-XXXX/SMS/+919920123456/AUTOGEN/OTPTest\n\n</code></pre><p><strong>Sandbox Response:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"Status\": \"Success\",\n  \"Details\": \"mf2djpsmqnrwmwob7z-978c24505cf48a13\"\n}\n\n</code></pre>\n<p><strong>Response Fields:</strong></p>\n<ul>\n<li><p><code>Status</code>: Always \"Success\" in sandbox</p>\n</li>\n<li><p><code>Details</code>: Unique session ID for OTP verification (randomly generated)</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"2-auto-generated-otp-with-otp-in-response-autogen2\">2. Auto-Generated OTP with OTP in Response (AUTOGEN2)</h3>\n<p><strong>Endpoint Pattern:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET https://2factor.in/API/V1/{api-key}/SMS/{phone}/AUTOGEN2/{template}\nGET https://2factor.in/API/V1/{api-key}/SMS/{phone}/AUTOGEN2\n\n</code></pre><p><strong>Example Request:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET https://2factor.in/API/V1/XXXX-XXXX-XXXX-XXXX-XXXX/SMS/+919920123456/AUTOGEN2/OTPTest\n\n</code></pre><p><strong>Sandbox Response:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"Status\": \"Success\",\n  \"Details\": \"mf2dxd0bhngrkfjm79j-978c33db288487d8\",\n  \"OTP\": \"521983\"\n}\n\n</code></pre>\n<p><strong>Response Fields:</strong></p>\n<ul>\n<li><p><code>Status</code>: Always \"Success\" in sandbox</p>\n</li>\n<li><p><code>Details</code>: Unique session ID for OTP verification</p>\n</li>\n<li><p><code>OTP</code>: 6-digit OTP code (randomly generated)</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"3-custom-template-sms\">3. Custom Template SMS</h3>\n<p><strong>Endpoint Pattern:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET https://2factor.in/API/V1/{api-key}/SMS/{phone}/{template-name}\n\n</code></pre><p><strong>Example Request:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET https://2factor.in/API/V1/XXXX-XXXX-XXXX-XXXX-XXXX/SMS/+919920123456/MyCustomTemplate\n\n</code></pre><p><strong>Sandbox Response:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"Status\": \"Success\",\n  \"Details\": \"mf2djpsmqnrwmwob7z-978c24505cf48a13\"\n}\n\n</code></pre>\n<hr />\n<h2 id=\"otp-verification-endpoints\">OTP Verification Endpoints</h2>\n<h3 id=\"1-standard-otp-verification-verify\">1. Standard OTP Verification (VERIFY)</h3>\n<p><strong>Endpoint Pattern:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET https://2factor.in/API/V1/{api-key}/SMS/VERIFY/{session-id}/{otp}\n\n</code></pre><p><strong>Example Request:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET https://2factor.in/API/V1/XXXX-XXXX-XXXX-XXXX-XXXX/SMS/VERIFY/mf2ddmrx85yxvr8c4i90h22-978c35134572494d8/123456\n\n</code></pre><p><strong>Sandbox Response (Default):</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"Status\": \"Error\",\n  \"Details\": \"OTP Mismatch\"\n}\n\n</code></pre>\n<p><strong>Special Test Case:</strong><br />For testing successful verification, use the special test session and OTP:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET https://2factor.in/API/V1/{api-key}/SMS/VERIFY/Dummy-12345/12345\n\n</code></pre><p><strong>Success Response:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"Status\": \"Success\",\n  \"Details\": \"OTP Matched\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"2-alternative-otp-verification-verify2\">2. Alternative OTP Verification (VERIFY2)</h3>\n<p><strong>Endpoint Pattern:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET https://2factor.in/API/V1/{api-key}/SMS/VERIFY2/{session-id}/{otp}\n\n</code></pre><p><strong>Example Request:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET https://2factor.in/API/V1/XXXX-XXXX-XXXX-XXXX-XXXX/SMS/VERIFY2/mf2ddmrx85yxvr8c4i90h22-978c35134572494d8/123456\n\n</code></pre><p><strong>Sandbox Response:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"Status\": \"Error\",\n  \"Details\": \"OTP Mismatch\"\n}\n\n</code></pre>\n<p><strong>Note:</strong> VERIFY2 endpoints always return \"OTP Mismatch\" in sandbox mode for testing error handling.</p>\n<hr />\n<h2 id=\"testing-workflow-example\">Testing Workflow Example</h2>\n<p>Here's a complete testing workflow using sandbox endpoints:</p>\n<h3 id=\"step-1-generate-otp\">Step 1: Generate OTP</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl \"https://2factor.in/API/V1/your-api-key/SMS/+919920123456/AUTOGEN2/TestTemplate\"\n\n</code></pre>\n<p><strong>Response:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"Status\": \"Success\",\n  \"Details\": \"mf2dxd0bhngrkfjm79j-978c33db288487d8\",\n  \"OTP\": \"521983\"\n}\n\n</code></pre>\n<h3 id=\"step-2-verify-otp-testing-mismatch\">Step 2: Verify OTP (Testing Mismatch)</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl \"https://2factor.in/API/V1/your-api-key/SMS/VERIFY/mf2dxd0bhngrkfjm79j-978c33db288487d8/123456\"\n\n</code></pre>\n<p><strong>Response:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"Status\": \"Error\",\n  \"Details\": \"OTP Mismatch\"\n}\n\n</code></pre>\n<h3 id=\"step-3-test-success-case\">Step 3: Test Success Case</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl \"https://2factor.in/API/V1/your-api-key/SMS/VERIFY/Dummy-12345/12345\"\n\n</code></pre>\n<p><strong>Response:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"Status\": \"Success\",\n  \"Details\": \"OTP Matched\"\n}\n\n</code></pre>\n<hr />\n<h2 id=\"important-notes\">Important Notes</h2>\n<h3 id=\"⚠️-sandbox-limitations\">⚠️ Sandbox Limitations</h3>\n<ul>\n<li><p><strong>No actual SMS sent</strong>: All endpoints return dummy responses</p>\n</li>\n<li><p><strong>Random session IDs</strong>: Each request generates a new random session ID</p>\n</li>\n<li><p><strong>Fixed test credentials</strong>: Only <code>Dummy-12345/12345</code> returns success for VERIFY</p>\n</li>\n<li><p><strong>Account-specific</strong>: Sandbox mode must be enabled per account and phone number</p>\n</li>\n</ul>\n<h3 id=\"🔧-development-tips\">🔧 Development Tips</h3>\n<ol>\n<li><p><strong>Use AUTOGEN2</strong> for testing complete workflows (includes OTP in response)</p>\n</li>\n<li><p><strong>Test both success and failure scenarios</strong> using appropriate endpoints</p>\n</li>\n<li><p><strong>Session IDs are random</strong> - don't hardcode them in your tests</p>\n</li>\n<li><p><strong>Always test error handling</strong> using VERIFY2 endpoints</p>\n</li>\n</ol>\n<h3 id=\"📞-support\">📞 Support</h3>\n<ul>\n<li><p><strong>Email</strong>: <a href=\"mailto:support@2factor.in\">support@2factor.in</a></p>\n</li>\n<li><p><strong>Subject</strong>: \"Sandbox Environment Setup Request\"</p>\n</li>\n<li><p><strong>Include</strong>: API key, test phone numbers, and use case description</p>\n</li>\n</ul>\n<hr />\n<h2 id=\"http-status-codes\">HTTP Status Codes</h2>\n<p>All sandbox endpoints return HTTP 200 with JSON response body. Check the <code>Status</code> field in the response to determine success or failure:</p>\n<ul>\n<li><p><code>\"Status\": \"Success\"</code> - Operation completed successfully</p>\n</li>\n<li><p><code>\"Status\": \"Error\"</code> - Operation failed (check <code>Details</code> for reason)</p>\n</li>\n</ul>\n<hr />\n<h2 id=\"rate-limits\">Rate Limits</h2>\n<p>Sandbox endpoints do not follow any rate limiting as production endpoints.</p>\n","_postman_id":"6cef8eec-75fc-4629-80f1-e0f83fa992a1"}],"id":"46b8df37-b085-45e0-9dae-ce6b52f722c9","description":"<h3 id=\"sms-otp-api-endpoints-sending-and-verifying-otps\">SMS OTP API Endpoints: Sending and Verifying OTPs</h3>\n<p>This section outlines the API endpoints available for sending and verifying SMS OTPs. The service supports both <strong>manual</strong> and <strong>automatic</strong> OTP generation to meet diverse client requirements.</p>\n<hr />\n<h3 id=\"customizing-sms-text\"><strong>Customizing SMS Text</strong></h3>\n<p>To send OTP messages with a custom sender ID and customized SMS text, follow the steps below:</p>\n<ol>\n<li><p><strong>DLT Template Registration</strong><br /> Register your SMS content template on any telecom operator's DLT portal. Ensure the content complies with regulatory requirements and includes placeholders where applicable.</p>\n</li>\n<li><p><strong>Template Approval and Submission</strong><br /> Once the SMS content template is approved:</p>\n<ul>\n<li><p>Log in to the <a href=\"https://2factor.in/CP/\">2Factor Dashboard</a>.</p>\n</li>\n<li><p>Navigate to <strong>SMS OTP &gt; OTP Templates</strong> and submit the approved template details, including the DLT registration information.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Need Support?</strong><br /> For guidance with the template registration or submission process, contact us at <a href=\"https://null\"><b>support@2factor.in</b></a>.</p>\n</li>\n</ol>\n<hr />\n<p>This approach ensures compliance with regulatory standards while allowing businesses to customize their SMS OTP messages.</p>\n","_postman_id":"46b8df37-b085-45e0-9dae-ce6b52f722c9"},{"name":"Send Transactional SMS","item":[{"name":"Send Single SMS","item":[{"name":"Send Single SMS","id":"726383fc-97cb-4355-b6c3-4041adbf0ddd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"module","value":"TRANS_SMS","description":"<p>Module name - TRANS_SMS for transactional SMS</p>\n","type":"text"},{"key":"apikey","value":"7e825d24-XXXX-XXXX-XXXX-0200cd93604211","description":"<p>API key issued against your account</p>\n","type":"text"},{"key":"to","value":"91XXXXXXXXXX,91YYYYYYYYYY","description":"<p>Phone numbers separated by comma</p>\n","type":"text"},{"key":"from","value":"HEADER","description":"<p>DLT approved sender id</p>\n","type":"text"},{"key":"msg","value":"DLT Approved Message Text Goes Here","description":"<p>DLT approved SMS text</p>\n","type":"text"},{"key":"scheduletime","value":"2022-01-01 13:27:00","description":"<p>(*optional) Time at which SMS needs to be triggered</p>\n<p>Note: Schedule time must be at least 5 minutes greater than the current time</p>\n","type":"text"},{"key":"peid","value":"DLT Registration Number","description":"<p>(*optional) PE Id of the DLT approved content template</p>\n","type":"text"},{"key":"ctid","value":"DLT Content Template Id","description":"<p>(*optional) CT Id of the DLT approved content template</p>\n","type":"text"},{"key":"campaignname","value":"Name For a Click Tracking Campaign","description":"<p>(*optional) To enable dynamic shortlinking of a URL in the message &amp; track clicks</p>\n","type":"text"},{"key":"campaignwebhook","value":"URL for receiving Webhook notification on shortlink clicks","description":"<p>(*Optional) Publicly accessible URL for receiving realtime webhook about link click</p>\n","type":"text"}]},"url":"https://2factor.in/API/R1/","description":"<h4 id=\"sending-single-transactional-sms\"><strong>Sending Single Transactional SMS</strong></h4>\n<p>Use this endpoint to send <strong>Transactional SMS</strong>, including:</p>\n<ul>\n<li><p>OTPs</p>\n</li>\n<li><p>Order notifications</p>\n</li>\n<li><p><strong>Service Implicit</strong> and <strong>Service Explicit</strong> messages</p>\n</li>\n</ul>\n<hr />\n<h4 id=\"important-notes\"><strong>Important Notes</strong></h4>\n<ul>\n<li><strong>Compliance Requirement</strong>: Starting <strong>April 1, 2021</strong>, only SMS formats approved through the DLT platform are supported. Ensure all message templates are registered and approved on the DLT portal prior to sending.</li>\n</ul>\n","urlObject":{"protocol":"https","path":["API","R1",""],"host":["2factor","in"],"query":[],"variable":[]}},"response":[{"id":"28fc5ebe-4c91-43cf-b7de-a40bdea5bccc","name":"Success","originalRequest":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"module","value":"TRANS_SMS","description":"Module name - TRANS_SMS for transactional SMS","type":"text"},{"key":"apikey","value":"7e825d24-XXXX-XXXX-XXXX-0200cd936042","description":"API key issued against your account","type":"text"},{"key":"to","value":"91XXXXXXXXXX,91YYYYYYYYYY","description":"Phone numbers separated by comma","type":"text"},{"key":"from","value":"HEADER","description":"DLT approved sender id","type":"text"},{"key":"msg","value":"DLT Approved Message Text Goes Here","description":"DLT approved SMS text","type":"text"}]},"url":"https://2factor.in/API/R1/"},"status":"OK","code":200,"_postman_previewlanguage":"plain","header":[{"key":"Date","value":"Sun, 02 May 2021 18:17:23 GMT"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Set-Cookie","value":"__cfduid=d6b8d8179a8366eabdad5847956f4ee711619979442; expires=Tue, 01-Jun-21 18:17:22 GMT; path=/; domain=.compute-india.in; HttpOnly; SameSite=Lax; Secure"},{"key":"Host","value":"cp.compute-india.in"},{"key":"X-Real-IP","value":"180.188.235.14"},{"key":"X-Forwarded-Proto","value":"https"},{"key":"CF-Ray","value":"64933efdaa5518a3-SIN"},{"key":"Accept-Encoding","value":"gzip"},{"key":"Accept","value":"*/*"},{"key":"User-Agent","value":"PostmanRuntime/7.26.10"},{"key":"CF-Connecting-IP","value":"180.188.235.14"},{"key":"CF-IPCountry","value":"IN"},{"key":"cf-request-id","value":"09cfe5b286000018a3ab3a7000000001"},{"key":"CF-Visitor","value":"{\"scheme\":\"https\"}"},{"key":"Expect-CT","value":"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""},{"key":"Report-To","value":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report?s=Uz8asmu9U4m8qPypOUhIR%2Ft3jaM2KI427sPBiAc7TqmURUL0leiRn931ZfYTbPaqgbu92tVXiENN%2F8vkc1di4YRupqcp4TcgkXMcn3APnvfkM%2FLO\"}],\"group\":\"cf-nel\",\"max_age\":604800}"},{"key":"NEL","value":"{\"report_to\":\"cf-nel\",\"max_age\":604800}"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"cloudflare"}],"cookie":[],"responseTime":null,"body":"{\"Status\":\"Success\",\"Details\":\"09cfe5b29d000018a3acb36000000001\"}"},{"id":"8e50bc41-f3a9-4ec1-9379-d592e09d77d7","name":"Error","originalRequest":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"module","value":"TRANS_SMS","description":"Module name - TRANS_SMS for transactional SMS","type":"text"},{"key":"apikey","value":"7e825d24-XXXX-XXXX-XXXX-0200cd936042","description":"API key issued against your account","type":"text"},{"key":"to","value":"91XXXXXXXXXX,91YYYYYYYYYY","description":"Phone numbers separated by comma","type":"text"},{"key":"from","value":"HEADER","description":"DLT approved sender id","type":"text"},{"key":"msg","value":"DLT Approved Message Text Goes Here","description":"DLT approved SMS text","type":"text"}]},"url":"https://2factor.in/API/R1/"},"status":"Bad Request","code":400,"_postman_previewlanguage":"plain","header":[{"key":"Date","value":"Sun, 02 May 2021 18:19:30 GMT"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Host","value":"cp.compute-india.in"},{"key":"X-Real-IP","value":"180.188.235.14"},{"key":"X-Forwarded-Proto","value":"https"},{"key":"CF-Ray","value":"6493421b7c7f18a3-SIN"},{"key":"Accept-Encoding","value":"gzip"},{"key":"Accept","value":"*/*"},{"key":"Cookie","value":"__cfduid=d6b8d8179a8366eabdad5847956f4ee711619979442"},{"key":"User-Agent","value":"PostmanRuntime/7.26.10"},{"key":"CF-Connecting-IP","value":"180.188.235.14"},{"key":"CF-IPCountry","value":"IN"},{"key":"cf-request-id","value":"09cfe7a528000018a308a49000000001"},{"key":"CF-Visitor","value":"{\"scheme\":\"https\"}"},{"key":"Expect-CT","value":"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""},{"key":"Report-To","value":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report?s=ctxF%2Ff3SnTWJicX4XaGftuNj21d%2BAdk0R%2FQiWlUpFVeMmKckfYbAlYqbcJn42Nf5ugBrQa%2Fnd8kdey5KmXOZlG9tZlfdNjvxeT6CxlSAzIyag6Y7\"}],\"group\":\"cf-nel\",\"max_age\":604800}"},{"key":"NEL","value":"{\"report_to\":\"cf-nel\",\"max_age\":604800}"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"cloudflare"}],"cookie":[],"responseTime":null,"body":"{\"Status\":\"Error\",\"Details\":\"ERR_DETAILS_GO_HERE\"}"}],"_postman_id":"726383fc-97cb-4355-b6c3-4041adbf0ddd"}],"id":"400b023d-31d8-46e3-9a46-3b2ce700a437","_postman_id":"400b023d-31d8-46e3-9a46-3b2ce700a437","description":""},{"name":"Send Bulk Messages","item":[{"name":"Send Bulk SMS","id":"772116d7-6bf0-447b-847c-82f088a6ca1e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"module\": \"TRANS_SMS\",\r\n    \"apikey\": \"XXXX-XXXX-XXXX-XXXX-XXXX\",\r\n    \"messages\": [\r\n        {\r\n            \"smsFrom\": \"HEADER\",\r\n            \"smsTo\": \"+91XXXXXXXXXX\",\r\n            \"smsText\": \"This is your first message.\",\r\n            \"callback_value1\": \"Enter Custom value\",\r\n            \"callback_value2\": \"Enter Custom value\",\r\n            \"callback_format\": \"json\"\r\n        },\r\n        {\r\n            \"smsFrom\": \"HEADER\",\r\n            \"smsTo\": \"+91XXXXXXXXXX\",\r\n            \"smsText\": \"This is your second message.\",\r\n            \"callback_value1\": \"Enter Custom value\",\r\n            \"callback_value2\": \"Enter Custom value\",\r\n            \"callback_format\": \"json\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://2factor.in/API/R1/Bulk/","description":"<h3 id=\"sending-bulk-sms\">Sending Bulk SMS</h3>\n<p>This endpoint allows you to send Bulk SMS messages using the 2Factor.in API.</p>\n<hr />\n<h2 id=\"endpoint\">Endpoint</h2>\n<ul>\n<li><p><strong>URL</strong>: <code>https://2factor.in/API/R1/Bulk/</code></p>\n</li>\n<li><p><strong>Method</strong>: <code>POST</code></p>\n</li>\n<li><p><strong>Headers</strong>:</p>\n<ul>\n<li><code>Content-Type</code>: <code>application/json</code></li>\n</ul>\n</li>\n</ul>\n<hr />\n<h2 id=\"request-details\">Request Details</h2>\n<h3 id=\"input-fields-and-their-meanings\">Input Fields and Their Meanings</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Field</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Required</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>module</code></td>\n<td><code>string</code></td>\n<td>Yes</td>\n<td>Specifies the type of operation. Must always be set to <code>\"TRANS_SMS\"</code>.</td>\n</tr>\n<tr>\n<td><code>apikey</code></td>\n<td><code>string</code></td>\n<td>Yes</td>\n<td>Your unique API key for authentication. Ensure it's valid and linked to an active service.</td>\n</tr>\n<tr>\n<td><code>messages</code></td>\n<td><code>array</code></td>\n<td>Yes</td>\n<td>An array of SMS message objects. Each object represents an individual SMS to be sent.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"message-object-each-item-in-the-messages-array\"><strong>Message Object</strong> (Each Item in the <code>messages</code> Array)</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th></th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n<th>Example Value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>smsFrom</td>\n<td>string</td>\n<td>Yes</td>\n<td>DLT-approved Sender ID (6 characters max)</td>\n<td>TFACTR</td>\n</tr>\n<tr>\n<td>smsTo</td>\n<td>string</td>\n<td>Yes</td>\n<td>Recipient mobile with country code</td>\n<td>+919999999999</td>\n</tr>\n<tr>\n<td>smsText</td>\n<td>string</td>\n<td>Yes</td>\n<td>DLT approved message content</td>\n<td>Your OTP is 123456</td>\n</tr>\n<tr>\n<td>callback_value1</td>\n<td>string</td>\n<td>No</td>\n<td>Custom value echoed back in webhook</td>\n<td>order_12345</td>\n</tr>\n<tr>\n<td>callback_value2</td>\n<td>string</td>\n<td>No</td>\n<td>Second custom value echoed back</td>\n<td>user_789</td>\n</tr>\n<tr>\n<td>callback_format</td>\n<td>string</td>\n<td>No</td>\n<td>Webhook format (json or raw-url-encoded)</td>\n<td>json</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"sample-request-payload\">Sample Request Payload</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n  \"module\": \"TRANS_SMS\",\n  \"apikey\": \"XXXXX-XXXX-XXXX-XXXX-XXXX\",\n  \"messages\": [\n    {\n      \"smsFrom\": \"TFACTR\",\n      \"smsTo\": \"+919876543210\",\n      \"smsText\": \"Welcome! Your verification code is 483920\",\n      \"callback_value1\": \"order_98765\",\n      \"callback_value2\": \"cust_1122\",\n      \"callback_format\": \"json\"\n    },\n    {\n      \"smsFrom\": \"TFACTR\",\n      \"smsTo\": \"+918765432109\",\n      \"smsText\": \"Payment received. Thank you!\",\n      \"callback_value1\": \"txn_554433\",\n      \"callback_format\": \"json\"\n    }\n  ]\n}\n\n</code></pre><hr />\n<h2 id=\"response-details\">Response Details</h2>\n<h3 id=\"successful-response\">Successful Response</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Field</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>success</code></td>\n<td><code>boolean</code></td>\n<td>Indicates whether the request was successfully processed.</td>\n</tr>\n<tr>\n<td><code>requestId</code></td>\n<td><code>string</code></td>\n<td>A unique identifier for tracking the request.</td>\n</tr>\n<tr>\n<td><code>messageCount</code></td>\n<td><code>integer</code></td>\n<td>The total number of messages processed in the request.</td>\n</tr>\n<tr>\n<td><code>timestamp</code></td>\n<td><code>string</code></td>\n<td>The time at which the request was processed, in ISO 8601 format.</td>\n</tr>\n<tr>\n<td><code>processingTime</code></td>\n<td><code>integer</code></td>\n<td>The total time (in milliseconds) taken to process the request.</td>\n</tr>\n<tr>\n<td><code>queueStats</code></td>\n<td><code>object</code></td>\n<td>Details about the queue processing, including successful and failed chunks.</td>\n</tr>\n<tr>\n<td><code>messages</code></td>\n<td><code>array</code></td>\n<td>Contains details of each processed message, including its <code>messageId</code> and the original input data.</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"example-successful-response\">Example Successful Response</h4>\n<p>API Response prints requests which are successfully accepted, as well as requests which have been rejected for input validations on the phone number value.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n  \"success\": true,\n  \"requestId\": \"f4bda732-XXXX-XXXX-XXXX-518b4ea82708\",\n  \"messageCount\": 2,\n  \"timestamp\": \"2024-12-16T10:59:17.311Z\",\n  \"processingTime\": 1224,\n  \"queueStats\": {\n    \"success\": true,\n    \"totalChunks\": 1,\n    \"successfulChunks\": 1,\n    \"failedChunks\": 0\n  },\n  \"messages\": [\n    {\n      \"messageId\": \"f4bda732-XXXX-XXXX-XXXX-518b4ea82708-1\",\n      \"smsFrom\": \"TFACTR\",\n      \"smsTo\": \"+91XXXXXXXXXX\"\n    },\n    {\n      \"messageId\": \"f4bda732-XXXX-XXXX-XXXX-518b4ea82708-2\",\n      \"smsFrom\": \"TFACTR\",\n      \"smsTo\": \"+91XXXXXXXXXX\"\n    }\n  ],\n \"rejectedSamples\": [\n {\n \"index\": 0,\n \"phone\": \"+91abcg\",\n \"reason\": \"Phone number should only contain digits (with optional leading + sign)\"\n },\n {\n \"index\": 2,\n \"phone\": \"+911\",\n \"reason\": \"Phone number must match the required format\"\n },\n {\n \"index\": 4,\n \"phone\": \"+911\",\n \"reason\": \"Phone number must match the required format\"\n }\n ]\n}\n\n</code></pre><hr />\n<h3 id=\"error-responses\">Error Responses</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Field</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>success</code></td>\n<td><code>boolean</code></td>\n<td>Indicates whether the request was successfully processed. Always <code>false</code> for errors.</td>\n</tr>\n<tr>\n<td><code>requestId</code></td>\n<td><code>string</code></td>\n<td>A unique identifier for tracking the request.</td>\n</tr>\n<tr>\n<td><code>error</code></td>\n<td><code>string</code></td>\n<td>A short description of the error encountered.</td>\n</tr>\n<tr>\n<td><code>errorType</code></td>\n<td><code>string</code></td>\n<td>The category of error (e.g., <code>ValidationError</code>, <code>UnexpectedError</code>).</td>\n</tr>\n<tr>\n<td><code>details</code></td>\n<td><code>array</code></td>\n<td>Detailed information about the validation or processing errors.</td>\n</tr>\n<tr>\n<td><code>timestamp</code></td>\n<td><code>string</code></td>\n<td>The time at which the error occurred, in ISO 8601 format.</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"example-error-responses\">Example Error Responses</h4>\n<p><strong>Case 1: Invalid API Key</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n  \"success\": false,\n  \"requestId\": \"e3de200f-XXXX-XXXX-XXXX-2a9255bb7c51\",\n  \"error\": \"Validation failed\",\n  \"errorType\": \"ValidationError\",\n  \"details\": [\n    {\n      \"field\": \"apikey\",\n      \"error\": \"Invalid API Key Or TRANSACTIONAL_SMS Service Is Inactive\"\n    }\n  ],\n  \"timestamp\": \"2024-12-16T10:59:47.062Z\"\n}\n\n</code></pre><p><strong>Case 2: Invalid JSON Format</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>jsonCopy code{\n  \"success\": false,\n  \"requestId\": \"147dbbef-XXXX-XXXX-XXXX-6271da57cdca\",\n  \"error\": \"Validation failed\",\n  \"errorType\": \"ValidationError\",\n  \"details\": [\n    {\n      \"error\": \"Failed to parse request body as JSON\",\n      \"details\": \"Expected ',' or ']' after array element in JSON at position 294 (line 15 column 5)\"\n    }\n  ],\n  \"timestamp\": \"2024-12-16T11:00:22.700Z\"\n}\n\n</code></pre><hr />\n<h4 id=\"webhook--callback-payload-sent-to-your-url\"><strong>Webhook / Callback Payload (sent to your URL)</strong></h4>\n<p>JSON</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n  \"SessionId\": \"30b3c545-5e1a-482e-9fac-1a76e805020d-1\",\n  \"SmsFrom\": \"TFACTR\",\n  \"SmsTo\": \"9876543210\",\n  \"SmsStatus\": \"DELIVERED\",\n  \"SentAt\": \"2025-11-24 19:43:06\",\n  \"StatusAt\": \"2025-11-24 19:43:08\",\n  \"callback_value1\": \"order_98765\",\n  \"callback_value2\": \"cust_1122\"\n}\n\n</code></pre><h2 id></h2>\n<p>Key Validation Rules</p>\n<ol>\n<li><p><strong>Module</strong>: Must always be <code>\"TRANS_SMS\"</code>.</p>\n</li>\n<li><p><strong>API Key</strong>: Must be valid and linked to an active service.</p>\n</li>\n<li><p><strong>Messages Array</strong>: Must contain at least one message and not exceed 1000 messages per request.</p>\n</li>\n<li><p><strong>Phone Numbers</strong>:</p>\n<ul>\n<li><p>Must be in international format (e.g., <code>+91XXXXXXXXXX</code>).</p>\n</li>\n<li><p>Only numeric characters are allowed, with an optional leading <code>+</code>.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>SMS Content</strong>: Message length must not exceed 1000 characters.</p>\n</li>\n</ol>\n<hr />\n<h2 id=\"notes\">Notes</h2>\n<ul>\n<li><p>Double-check your JSON structure to avoid formatting errors.</p>\n</li>\n<li><p>Use authorized Sender IDs (<code>smsFrom</code>) configured in your account.</p>\n</li>\n<li><p>Validate phone numbers and SMS text before sending the request to reduce errors.</p>\n</li>\n</ul>\n","urlObject":{"protocol":"https","path":["API","R1","Bulk",""],"host":["2factor","in"],"query":[],"variable":[]}},"response":[{"id":"710db3d2-bbd9-4f02-b096-4e7ca90c6545","name":"Send Bulk SMS","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"module\": \"TRANS_SMS\",\r\n  \"apikey\": \"XXXXX-XXXX-XXXX-XXXX-XXXX\",\r\n  \"messages\": [\r\n    {\r\n      \"smsFrom\": \"TFACTR\",\r\n      \"smsTo\": \"+919876543210\",\r\n      \"smsText\": \"Welcome! Your verification code is 483920\",\r\n      \"callback_value1\": \"order_98765\",\r\n      \"callback_value2\": \"cust_1122\",\r\n      \"callback_format\": \"json\"\r\n    },\r\n    {\r\n      \"smsFrom\": \"TFACTR\",\r\n      \"smsTo\": \"+918765432109\",\r\n      \"smsText\": \"Payment received. Thank you!\",\r\n      \"callback_value1\": \"txn_554433\",\r\n      \"callback_format\": \"json\"\r\n    }\r\n  ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://2factor.in/API/R1/Bulk/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 16 Dec 2024 11:25:46 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"263"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Access-Control-Allow-Headers","value":"Content-Type"},{"key":"Access-Control-Allow-Methods","value":"POST, OPTIONS"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"8f2e508c782185d1-BOM"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n  \"success\": true,\n  \"requestId\": \"f4bda732-XXXX-XXXX-XXXX-518b4ea82708\",\n  \"messageCount\": 2,\n  \"timestamp\": \"2024-12-16T10:59:17.311Z\",\n  \"processingTime\": 1224,\n  \"queueStats\": {\n    \"success\": true,\n    \"totalChunks\": 1,\n    \"successfulChunks\": 1,\n    \"failedChunks\": 0\n  },\n  \"messages\": [\n    {\n      \"messageId\": \"f4bda732-XXXX-XXXX-XXXX-518b4ea82708-1\",\n      \"smsFrom\": \"TFACTR\",\n      \"smsTo\": \"+91XXXXXXXXXX\"\n    },\n    {\n      \"messageId\": \"f4bda732-XXXX-XXXX-XXXX-518b4ea82708-2\",\n      \"smsFrom\": \"TFACTR\",\n      \"smsTo\": \"+91XXXXXXXXXX\"\n    }\n  ]\n}"}],"_postman_id":"772116d7-6bf0-447b-847c-82f088a6ca1e"}],"id":"04f200f8-7181-4329-a407-588e853f04ba","description":"<p>The 2Factor Bulk SMS API allows you to send multiple SMS messages in a single API request. This is ideal for sending transactional or promotional messages to multiple recipients simultaneously.</p>\n","_postman_id":"04f200f8-7181-4329-a407-588e853f04ba"}],"id":"5cfdbec3-08c4-4966-b98c-f2c6677a3f85","description":"<h4 id=\"sending-non-promotional-sms\"><strong>Sending Non-Promotional SMS</strong></h4>\n<p>Use the following endpoint to send <strong>Non-Promotional SMS</strong> requests categorized under <strong>Service Implicit</strong>. This endpoint allows delivery of SMS text approved for <strong>Service Implicit</strong> or <strong>Service Explicit</strong> message types on the DLT platform.</p>\n<hr />\n<h4 id=\"important-notes\"><strong>Important Notes</strong></h4>\n<ul>\n<li><strong>Compliance Requirement</strong>: Effective <strong>April 1, 2021</strong>, only DLT-approved SMS text templates are allowed via 2Factor. Ensure your SMS templates are registered and approved on the DLT portal before initiating requests.</li>\n</ul>\n<hr />\n<p>This endpoint ensures compliance with regulatory standards while enabling the secure delivery of service-based SMS messages.</p>\n","_postman_id":"5cfdbec3-08c4-4966-b98c-f2c6677a3f85"},{"name":"Send Promotional SMS","item":[{"name":"Send SMS","id":"1abc3ca8-b48a-4177-8072-e5a45bed20b5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"module","value":"PROMO_SMS","description":"<p>Module name - PROMO_SMS for Promotional SMS</p>\n","type":"text"},{"key":"apikey","value":"7e825d24-XXXX-XXXX-XXXX-0200cd93604211","description":"<p>API key issued against your account</p>\n","type":"text"},{"key":"to","value":"91XXXXXXXXXX,91YYYYYYYYYY","description":"<p>Phone numbers separated by comma</p>\n","type":"text"},{"key":"from","value":"HEADER","description":"<p>DLT approved sender id</p>\n","type":"text"},{"key":"msg","value":"DLT Approved Message Text Goes Here","description":"<p>DLT approved SMS text</p>\n","type":"text"},{"key":"scheduletime","value":"2022-01-01 13:27:00","description":"<p>(*optional) Time at which SMS needs to be triggered</p>\n<p>Note: Schedule time must be at least 5 minutes greater than the current time</p>\n","type":"text"}]},"url":"https://2factor.in/API/R1/","description":"<h4 id=\"purpose\"><strong>Purpose</strong></h4>\n<p>This endpoint is used to send <strong>Promotional SMS</strong>, such as:</p>\n<ul>\n<li><p>Offers and discounts</p>\n</li>\n<li><p>Seasonal greetings</p>\n</li>\n<li><p>Coupon codes</p>\n</li>\n<li><p>Re-targeting messages</p>\n</li>\n</ul>\n<h4 id=\"message-categories\"><strong>Message Categories</strong></h4>\n<p>Supports <strong>Service Explicit</strong> and <strong>Promotional Messages</strong> as registered on the DLT platform.</p>\n","urlObject":{"protocol":"https","path":["API","R1",""],"host":["2factor","in"],"query":[],"variable":[]}},"response":[{"id":"2d5a945c-10dd-42d9-a1e2-3d0a852fd79e","name":"Success","originalRequest":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"module","value":"PROMO_SMS","description":"Module name - PROMO_SMS for promotional SMS","type":"text"},{"key":"apikey","value":"7e825d24-XXXX-XXXX-XXXX-0200cd936042","description":"API key issued against your account","type":"text"},{"key":"to","value":"91XXXXXXXXXX,91YYYYYYYYYY","description":"Phone numbers separated by comma","type":"text"},{"key":"from","value":"HEADER","description":"DLT approved sender id","type":"text"},{"key":"msg","value":"DLT Approved Message Text Goes Here","description":"DLT approved SMS text","type":"text"}]},"url":"https://2factor.in/API/R1/"},"status":"OK","code":200,"_postman_previewlanguage":"plain","header":[{"key":"Date","value":"Sun, 02 May 2021 18:17:23 GMT"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Set-Cookie","value":"__cfduid=d6b8d8179a8366eabdad5847956f4ee711619979442; expires=Tue, 01-Jun-21 18:17:22 GMT; path=/; domain=.compute-india.in; HttpOnly; SameSite=Lax; Secure"},{"key":"Host","value":"cp.compute-india.in"},{"key":"X-Real-IP","value":"180.188.235.14"},{"key":"X-Forwarded-Proto","value":"https"},{"key":"CF-Ray","value":"64933efdaa5518a3-SIN"},{"key":"Accept-Encoding","value":"gzip"},{"key":"Accept","value":"*/*"},{"key":"User-Agent","value":"PostmanRuntime/7.26.10"},{"key":"CF-Connecting-IP","value":"180.188.235.14"},{"key":"CF-IPCountry","value":"IN"},{"key":"cf-request-id","value":"09cfe5b286000018a3ab3a7000000001"},{"key":"CF-Visitor","value":"{\"scheme\":\"https\"}"},{"key":"Expect-CT","value":"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""},{"key":"Report-To","value":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report?s=Uz8asmu9U4m8qPypOUhIR%2Ft3jaM2KI427sPBiAc7TqmURUL0leiRn931ZfYTbPaqgbu92tVXiENN%2F8vkc1di4YRupqcp4TcgkXMcn3APnvfkM%2FLO\"}],\"group\":\"cf-nel\",\"max_age\":604800}"},{"key":"NEL","value":"{\"report_to\":\"cf-nel\",\"max_age\":604800}"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"cloudflare"}],"cookie":[],"responseTime":null,"body":"{\"Status\":\"Success\",\"Details\":\"09cfe5b29d000018a3acb36000000001\"}"},{"id":"ad1e8173-3b0d-433b-b7f9-bd49032cd711","name":"Error","originalRequest":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"module","value":"PROMO_SMS","description":"Module name - PROMO_SMS for promotional SMS","type":"text"},{"key":"apikey","value":"7e825d24-XXXX-XXXX-XXXX-0200cd936042","description":"API key issued against your account","type":"text"},{"key":"to","value":"91XXXXXXXXXX,91YYYYYYYYYY","description":"Phone numbers separated by comma","type":"text"},{"key":"from","value":"HEADER","description":"DLT approved sender id","type":"text"},{"key":"msg","value":"DLT Approved Message Text Goes Here","description":"DLT approved SMS text","type":"text"}]},"url":"https://2factor.in/API/R1/"},"status":"Bad Request","code":400,"_postman_previewlanguage":"plain","header":[{"key":"Date","value":"Sun, 02 May 2021 18:19:30 GMT"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Host","value":"cp.compute-india.in"},{"key":"X-Real-IP","value":"180.188.235.14"},{"key":"X-Forwarded-Proto","value":"https"},{"key":"CF-Ray","value":"6493421b7c7f18a3-SIN"},{"key":"Accept-Encoding","value":"gzip"},{"key":"Accept","value":"*/*"},{"key":"Cookie","value":"__cfduid=d6b8d8179a8366eabdad5847956f4ee711619979442"},{"key":"User-Agent","value":"PostmanRuntime/7.26.10"},{"key":"CF-Connecting-IP","value":"180.188.235.14"},{"key":"CF-IPCountry","value":"IN"},{"key":"cf-request-id","value":"09cfe7a528000018a308a49000000001"},{"key":"CF-Visitor","value":"{\"scheme\":\"https\"}"},{"key":"Expect-CT","value":"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""},{"key":"Report-To","value":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report?s=ctxF%2Ff3SnTWJicX4XaGftuNj21d%2BAdk0R%2FQiWlUpFVeMmKckfYbAlYqbcJn42Nf5ugBrQa%2Fnd8kdey5KmXOZlG9tZlfdNjvxeT6CxlSAzIyag6Y7\"}],\"group\":\"cf-nel\",\"max_age\":604800}"},{"key":"NEL","value":"{\"report_to\":\"cf-nel\",\"max_age\":604800}"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Server","value":"cloudflare"}],"cookie":[],"responseTime":null,"body":"{\"Status\":\"Error\",\"Details\":\"ERR_DETAILS_GO_HERE\"}"}],"_postman_id":"1abc3ca8-b48a-4177-8072-e5a45bed20b5"}],"id":"592e4c16-6058-4dc1-8d56-332453333307","description":"<h4 id=\"sending-promotional-sms\"><strong>Sending Promotional SMS</strong></h4>\n<p>Use this endpoint to send <strong>Promotional SMS</strong> to your clients, including:</p>\n<ul>\n<li><p>Offers and discounts</p>\n</li>\n<li><p>Seasonal greetings</p>\n</li>\n<li><p>Coupon codes</p>\n</li>\n<li><p>Re-targeting messages</p>\n</li>\n</ul>\n<hr />\n<h4 id=\"important-notes\"><strong>Important Notes</strong></h4>\n<ul>\n<li><p><strong>Message Types</strong>: Supports <strong>Service Explicit</strong> and <strong>Promotional Messages</strong> as approved on the DLT platform.</p>\n</li>\n<li><p><strong>Compliance Requirement</strong>: Starting <strong>April 1, 2021</strong>, only DLT-approved SMS formats are allowed. Ensure all promotional content is registered and approved on the DLT portal before initiating requests.</p>\n</li>\n</ul>\n","_postman_id":"592e4c16-6058-4dc1-8d56-332453333307"},{"name":"Encrypted SMS Endpoints ( *Premium )","item":[],"id":"6692b257-16b0-496e-a500-0f0f5313d062","description":"<p>The <strong>Encrypted SMS API</strong> provides secure methods to send SMS messages and retrieve their delivery statuses. The API ensures data confidentiality using *<em>AES-256 bit encryption in GCM &amp; CBC mode.__*</em></p>\n<hr />\n<h2 id=\"authentication\">Authentication</h2>\n<p>All API requests require the <strong>Secret-Key</strong> in the headers for authentication. The key must be encrypted using <strong>AES-256 GCM / CBC mode</strong>.</p>\n<hr />\n<h2 id=\"endpoints\">Endpoints</h2>\n<h3 id=\"1-send-sms\"><strong>1. Send SMS</strong></h3>\n<h4 id=\"endpoint-information\">Endpoint Information</h4>\n<ul>\n<li><p><strong>URL</strong>: <code>https://2factor.in/API/R1?module=ENC&amp;encmode=GCM</code></p>\n</li>\n<li><p><strong>Method</strong>: <code>POST</code></p>\n</li>\n<li><p><strong>Headers</strong>:</p>\n<ul>\n<li><code>Secret-Key</code>: The AES-256 bit encrypted key.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"request-payload\">Request Payload</h4>\n<p>The request requires an encrypted JSON payload structured as follows:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-c\">{\n    \"module\": \"TRANS_SMS\",\n    \"apikey\": \"954817d9-XXXX-XXXX-XXXX-XXXX-cd936042\",\n    \"to\": \"91XXXXXXXXXX\",\n    \"from\": \"SENDER\",\n    \"msg\": \"Your DLT Approved SMS Text\"\n}\n\n</code></pre>\n<h4 id=\"steps-to-encrypt-and-send\">Steps to Encrypt and Send</h4>\n<ol>\n<li><p><strong>Prepare JSON Payload</strong>: Use the format above with valid API key and message details.</p>\n</li>\n<li><p><strong>Encrypt the Payload</strong>: Encrypt using AES-256 CBC / GCM mode with the provided sandbox secret key.</p>\n</li>\n<li><p><strong>Send Encrypted Payload</strong>: Include the encrypted value in the body of the POST request.</p>\n<p> <code>encmode supported CBC &amp; GCM values to indicate the mode of encryption. default encryption mode is CBC</code></p>\n</li>\n</ol>\n<h4 id=\"sample-request-curl\">Sample Request (cURL)</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl -X POST \"https://2factor.in/API/R1/?module=ENC\" \\\n-H \"Secret-Key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\" \\\n-d \"&lt;EncryptedPayload&gt;\"\n\n</code></pre><hr />\n<h3 id=\"2-retrieve-sms-delivery-status\"><strong>2. Retrieve SMS Delivery Status</strong></h3>\n<h4 id=\"endpoint-information-1\">Endpoint Information</h4>\n<ul>\n<li><p><strong>URL</strong>: <code>https://2factor.in/API/R1?module=ENC</code></p>\n</li>\n<li><p><strong>Method</strong>: <code>POST</code></p>\n</li>\n<li><p><strong>Headers</strong>:</p>\n<ul>\n<li><code>Secret-Key</code>: The AES-256 bit encrypted key.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"request-payload-1\">Request Payload</h4>\n<p>The request requires an encrypted JSON payload structured as follows:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"module\": \"TRANS_SMS_DLR\",\n    \"apikey\": \"54817d9-XXXX-XXXX-XXXX-XXXX-cd936042\",\n    \"sessionid\": \"XXXXXXXXXXXXX-8477e7fc9c7749c6\",\n    \"smsdate\": \"2024-01-18\"\n}\n\n</code></pre><h4 id=\"steps-to-encrypt-and-send-1\">Steps to Encrypt and Send</h4>\n<ol>\n<li><p><strong>Prepare JSON Payload</strong>: Use the format above with valid API key, session ID, and date.</p>\n</li>\n<li><p><strong>Encrypt the Payload</strong>: Encrypt using AES-256 GCM mode with the provided sandbox secret key.</p>\n</li>\n<li><p><strong>Send Encrypted Payload</strong>: Include the encrypted value in the body of the POST request.</p>\n</li>\n</ol>\n<h4 id=\"sample-request-curl-1\">Sample Request (cURL)</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl -X POST \"https://2factor.in/API/R1/?module=ENC\" \\\n-H \"Secret-Key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\" \\\n-d \"&lt;EncryptedPayload&gt;\"\n\n</code></pre><hr />\n<h2 id=\"responses\">Responses</h2>\n<h3 id=\"general-response-structure\">General Response Structure</h3>\n<p>All API responses are in JSON format. Below are common scenarios and their respective responses:</p>\n<p><strong>Note:</strong> <strong>Error</strong> responses are printed in json plaintext , <strong>Success</strong> respomses would be in an encrypted format as given in the below examples</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Scenario</strong></th>\n<th><strong>HTTP Code</strong></th>\n<th><strong>Response Example</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Successful request</td>\n<td>200</td>\n<td><code>{\"Status\": \"Success\", \"Details\": \"\"}</code></td>\n</tr>\n<tr>\n<td>Invalid or missing <code>Secret-Key</code></td>\n<td>400</td>\n<td><code>{\"Status\": \"Error\", \"Details\": \"Secret-Key is missing in the request header\"}</code></td>\n</tr>\n<tr>\n<td>Invalid payload encryption</td>\n<td>400</td>\n<td><code>{\"Status\": \"Error\", \"Details\": \"Decryption failed...\"}</code></td>\n</tr>\n<tr>\n<td>GET method used instead of POST</td>\n<td>400</td>\n<td><code>{\"Status\": \"Error\", \"Details\": \"HTTP GET is not supported on this endpoint\"}</code></td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"example-decrypted-responses\">Example Decrypted Responses</h3>\n<h4 id=\"for-sending-sms\">For Sending SMS</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"Status\": \"Success\",\n    \"Details\": \"wYW/rnHQquWW2U7d0fk9PQniy5oGI+fbkFazRtrY4FEfCzt241yqf2jPeXu3FmOiHijgn8acnilxh48T9bNPKQ==\"\n}\n\n</code></pre><p>The decrypted <code>Details</code> field provides a unique SMS request ID.</p>\n<h4 id=\"for-retrieving-delivery-status\">For Retrieving Delivery Status</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"Status\": \"Success\",\n    \"Details\": \"1 record found for the specified filters\",\n    \"DeliveryStatus\": \"DELIVERED\",\n    \"SentAt\": \"2024-01-18 19:25:41\",\n    \"DeliveredAt\": \"2024-01-18 19:42:33\"\n}\n\n</code></pre><p>Or, if no records are found:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"Status\": \"Success\",\n    \"Details\": \"No records found for the specified filters\"\n}\n\n</code></pre><hr />\n<h2 id=\"error-handling\">Error Handling</h2>\n<p>The API provides clear error messages for troubleshooting. Common errors include:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Error Condition</strong></th>\n<th><strong>HTTP Code</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Missing <code>Secret-Key</code> header</td>\n<td>400</td>\n<td>The <code>Secret-Key</code> header is required for authentication.</td>\n</tr>\n<tr>\n<td>Invalid <code>Secret-Key</code> value</td>\n<td>400</td>\n<td>Ensure the correct encryption key is provided.</td>\n</tr>\n<tr>\n<td>Payload not properly formatted or encoded</td>\n<td>400</td>\n<td>The payload must be encrypted and Base64-encoded before submission.</td>\n</tr>\n<tr>\n<td>Incorrect HTTP method used</td>\n<td>400</td>\n<td>The endpoint supports only POST requests.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h2 id=\"security-best-practices\">Security Best Practices</h2>\n<ul>\n<li><p><strong>Encryption</strong>: Ensure all payloads are encrypted with AES-256 GCM mode.</p>\n</li>\n<li><p><strong>Transport Layer Security</strong>: Always use HTTPS for secure transmission.</p>\n</li>\n<li><p><strong>Key Management</strong>: Safeguard your <code>Secret-Key</code> and <code>API-Key</code> and avoid exposing them in public repositories or documentation.</p>\n</li>\n<li><p><strong>Response Validation</strong>: Decrypt and validate responses to ensure the integrity of the data.</p>\n</li>\n</ul>\n","_postman_id":"6692b257-16b0-496e-a500-0f0f5313d062"},{"name":"Read More","item":[{"name":"WhatsApp Messaging APIs","item":[],"id":"a32ba9bf-b527-473a-a854-a49832f09121","description":"<p>For pricing and setup, see our <a href=\"https://2factor.in/v3/lp/whatsapp-business-api-pricing.php\">WhatsApp Business API Pricing</a> and <a href=\"https://2factor.in/v3/lp/Whatsapp-Integration/whatsapp-business-api-integration.php\">WhatsApp Business API Integration Guide</a>.</p>\n","_postman_id":"a32ba9bf-b527-473a-a854-a49832f09121"},{"name":"Whatsapp Voice Calling APIs","item":[],"id":"779f8a62-c29c-4314-b140-a1a2115836bb","description":"<p>We also provide a dedicated <a href=\"https://2factor.in/v3/lp/whatsapp-voice-calling-api.php\">WhatsApp Voice Calling API</a> for businesses looking to add call capabilities.</p>\n<h4 id=\"learn-more-about-whatsapp-solutions\">Learn More About WhatsApp Solutions</h4>\n<ul>\n<li><p><a href=\"https://2factor.in/v3/lp/Chatbots/Whatsapp-Chatbot-Provider.php\">WhatsApp Chatbot Provider</a></p>\n</li>\n<li><p><a href=\"https://2factor.in/v3/lp/blogs/What-is-WhatsApp-Business-API-The-Complete-Guide-2025\">WhatsApp Business API Guide 2025</a></p>\n</li>\n<li><p><a href=\"https://2factor.in/v3/lp/whatsapp-business-api-pricing.php\">WhatsApp Business API Pricing</a></p>\n</li>\n<li><p><a href=\"https://2factor.in/v3/lp/whatsapp-voice-calling-api.php\">WhatsApp Voice Calling API</a></p>\n</li>\n<li><p><a href=\"https://2factor.in/v3/lp/whatsapp-api-service-provider-in-india.php\">WhatsApp API Service Provider in India</a></p>\n</li>\n<li><p><a href=\"https://2factor.in/v3/lp/whatsapp-marketing/official-whatsapp-business-api-india.php\">Official WhatsApp API Provider</a></p>\n</li>\n<li><p><a href=\"https://2factor.in/v3/lp/Whatsapp-Integration/whatsapp-business-api-integration.php\">WhatsApp Business API Integration</a></p>\n</li>\n</ul>\n","_postman_id":"779f8a62-c29c-4314-b140-a1a2115836bb"}],"id":"0772f624-e0eb-42d8-9813-82436ca7b976","description":"<h3 id=\"dynamic-shortlinking-in-transactional-sms-api-for-cta-whitelisting\">Dynamic Shortlinking in Transactional SMS API (for CTA Whitelisting)</h3>\n<p>In alignment with the latest <strong>TRAI guidelines</strong>, all URLs included in SMS text must be pre-whitelisted on the DLT platform. To meet this compliance requirement, <strong>2Factor</strong> introduces the <strong>Dynamic Shortlinking Feature</strong> as part of the Transactional SMS API.</p>\n<hr />\n<h4 id=\"feature-highlights\"><strong>Feature Highlights</strong></h4>\n<ol>\n<li><p><strong>Dynamic URL Shortening</strong></p>\n<ul>\n<li><p><strong>Automatic URL Shortening</strong>: URLs in SMS messages are dynamically shortened at runtime.</p>\n</li>\n<li><p><strong>DLT Compliance</strong>: Shortened URLs adhere to DLT-approved formatting standards.</p>\n<ul>\n<li><p><strong>Example</strong>: <code>https://e.1rp.in/DLT_HEADER/h6fgsf</code></p>\n</li>\n<li><p>For example, if your SMS header is <code>TFACTR</code>, URLs in your SMS will be replaced with shortened versions like:</p>\n<ul>\n<li><code>https://e.1rp.in/TFACTR/h6fgs</code></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li><p><strong>Free Alternative to Third-Party Services</strong>: This feature serves as a free replacement for services like Bit.ly.</p>\n</li>\n</ol>\n<hr />\n<h4 id=\"how-to-enable-url-shortening\"><strong>How to Enable URL Shortening</strong></h4>\n<ol>\n<li><p>Add the parameter <code>shortenurl=1</code> in your <strong>R1 - Transactional API</strong> request to activate the feature.</p>\n</li>\n<li><p>Whitelist the following URL format on the <strong>DLT portal under CTA-Whitelisting</strong>:</p>\n<ul>\n<li><code>https://e.1rp.in/DLT_HEADER/\\\\*</code></li>\n</ul>\n</li>\n<li><p>This ensures all dynamically created short URLs comply with DLT regulations.</p>\n</li>\n</ol>\n<hr />\n<h4 id=\"webhook-support-for-click-tracking\"><strong>Webhook Support for Click Tracking</strong></h4>\n<ul>\n<li><p><strong>Real-Time Tracking</strong>: Monitor user interaction with shortened URLs in real-time.</p>\n</li>\n<li><p><strong>Enable Click Tracking</strong>:</p>\n<ul>\n<li><p>Use the parameter <code>shortenurlwebhook</code> to specify the webhook URL for click notifications.</p>\n</li>\n<li><p>Pass a custom callback value using the parameter <code>shortenurlcallback</code> to include it in webhook payloads.</p>\n</li>\n</ul>\n</li>\n</ul>\n<hr />\n<h3 id=\"runtime-peid-and-ctid-support-in-transactional-sms-api\"><strong>Runtime PEID and CTID Support in Transactional SMS API</strong></h3>\n<p>To eliminate delays caused by DLT template replication (previously up to 4 hours), clients can now pass <strong>DLT Principal Entity ID (PEID)</strong> and <strong>DLT Content Template ID (CTID)</strong> in real-time during the API request.</p>\n<hr />\n<h4 id=\"sample-api-request\"><strong>Sample API Request</strong></h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>plaintextCopy codehttps://2factor.in/API/R1/?module=TRANS_SMS&amp;apikey=API_KEY&amp;to=CONTACT_NUMBER&amp;from=DLT_HEADER&amp;msg=DLT_APPROVED_CONTENT&amp;peid=PE_ID&amp;ctid=CT_ID\n\n</code></pre><hr />\n<h4 id=\"parameter-notes\"><strong>Parameter Notes</strong></h4>\n<ul>\n<li><p><strong><code>PE_ID</code></strong>: Replace with the Principal Entity ID of the DLT-approved message.</p>\n</li>\n<li><p><strong><code>CT_ID</code></strong>: Replace with the Content Template ID of the DLT-approved message.</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"url-shortening-and-click-tracking-for-campaign-performance-tracking\">URL Shortening and Click Tracking (for Campaign Performance Tracking)</h3>\n<p>The Transactional SMS API now includes URL shortening with <strong>real-time click tracking</strong>, enabling businesses to measure campaign performance effectively.</p>\n<hr />\n<h4 id=\"key-benefits\"><strong>Key Benefits</strong></h4>\n<ol>\n<li><p>Dynamically shorten URLs included in SMS messages.</p>\n</li>\n<li><p>Monitor user interactions, such as phone numbers that access the links.</p>\n</li>\n<li><p>Receive real-time click data via webhook.</p>\n</li>\n</ol>\n<hr />\n<h4 id=\"sample-api-request-1\"><strong>Sample API Request</strong></h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>plaintextCopy codehttps://2factor.in/API/R1/?module=TRANS_SMS&amp;apikey=API_KEY&amp;to=CONTACT_NUMBER&amp;from=DLT_HEADER&amp;msg=DLT_APPROVED_CONTENT&amp;campaignname=CAMPAIGN_NAME&amp;campaignwebhook=URL_ENCODED_CALLBACK_URL\n\n</code></pre><hr />\n<h4 id=\"parameter-notes-1\"><strong>Parameter Notes</strong></h4>\n<ul>\n<li><p><strong><code>campaignwebhook</code></strong> <strong>(Optional)</strong>: A URL-encoded callback URL to receive real-time click notifications.</p>\n<ul>\n<li>If omitted, URL shortening is enabled, but click tracking will not be activated.</li>\n</ul>\n</li>\n</ul>\n<hr />\n<h3 id=\"webhook-callback-details\">Webhook Callback Details</h3>\n<p>When a user clicks on a shortened link, <strong>2Factor</strong> sends an HTTP POST request to the specified <code>campaignwebhook</code> URL. The payload contains the following information:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Field</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>accessed</code></td>\n<td>Timestamp when the link was accessed (format: <code>YYYY-MM-DD HH:MM:SS</code>).</td>\n</tr>\n<tr>\n<td><code>phoneNo</code></td>\n<td>The phone number of the user who clicked the link.</td>\n</tr>\n<tr>\n<td><code>campaignName</code></td>\n<td>The campaign name associated with the message.</td>\n</tr>\n<tr>\n<td><code>ip</code></td>\n<td>IP address of the user who clicked the link.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h4 id=\"example-webhook-payload\"><strong>Example Webhook Payload</strong></h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>plaintextCopy codeaccessed=2024-11-29 14:30:00&amp;phoneNo=9876543210&amp;campaignName=PromoCampaign&amp;ip=192.168.1.1\n\n</code></pre><hr />\n<h3 id=\"developer-guidelines\">Developer Guidelines</h3>\n<ol>\n<li><p><strong>Parameter Encoding</strong>: Ensure all parameters are properly URL-encoded before making API requests.</p>\n</li>\n<li><p><strong>API Security</strong>:</p>\n<ul>\n<li><p>Use IP-based restrictions to secure API access.</p>\n</li>\n<li><p>Regularly rotate API keys to prevent unauthorized access.</p>\n</li>\n</ul>\n</li>\n<li><p>For support, contact <strong>2Factor Support</strong>.</p>\n</li>\n</ol>\n<hr />\n","_postman_id":"0772f624-e0eb-42d8-9813-82436ca7b976"}],"event":[{"listen":"prerequest","script":{"id":"41a2ccb5-992a-4c9a-b350-080641d72310","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"c51f37f2-3314-4eda-8e37-dc7bf4860acc","type":"text/javascript","exec":[""]}}]}