<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[GlowSMS Developer Blog]]></title><description><![CDATA[GlowSMS Developer Blog]]></description><link>https://glowsms.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6b0ade5224f7b7e8b4eb943b/3f3dd65c-feb4-4402-a719-2526806b7448.png</url><title>GlowSMS Developer Blog</title><link>https://glowsms.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sun, 29 Nov 2026 22:38:10 GMT</lastBuildDate><atom:link href="https://glowsms.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Getting Started with the GlowSMS REST API]]></title><description><![CDATA[Learn how to use the GlowSMS REST API for SMS verification, including API authentication, number availability, order management, and error handling.]]></description><link>https://glowsms.hashnode.dev/getting-started-with-the-glowsms-rest-api</link><guid isPermaLink="true">https://glowsms.hashnode.dev/getting-started-with-the-glowsms-rest-api</guid><category><![CDATA[REST API]]></category><category><![CDATA[api]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[software development]]></category><category><![CDATA[sms]]></category><dc:creator><![CDATA[GlowSMS]]></dc:creator><pubDate>Sat, 28 Nov 2026 14:32:06 GMT</pubDate><content:encoded><![CDATA[<p>The GlowSMS REST API enables developers to programmatically purchase temporary non-VoIP phone numbers, receive SMS verification codes, and manage verification orders without manually interacting with a web dashboard.</p>
<p>GlowSMS supports 180+ countries and 500+ online services, with real-time number availability, pay-per-use pricing, and automated refunds for eligible unsuccessful orders.</p>
<p>This tutorial walks through the complete API workflow using cURL, from checking your account balance to receiving a verification code and managing the order lifecycle.</p>
<h2>Prerequisites</h2>
<p>Before making your first API request, you will need:</p>
<ul>
<li>A GlowSMS account</li>
<li>A valid API key</li>
<li>Sufficient account balance</li>
<li>A terminal with cURL installed</li>
<li>Basic familiarity with HTTP requests and JSON</li>
</ul>
<p>You can access the official <a href="https://glowsms.com/api/docs">GlowSMS API documentation</a> for detailed endpoint specifications and integration requirements.</p>
<h2>Step 1: Configure Your API Credentials</h2>
<p>The base URL for the GlowSMS REST API is:</p>
<pre><code class="language-text">https://glowsms.com/api/v1
</code></pre>
<p>Authenticated requests require a Bearer token in the Authorization header.</p>
<p>Store your API key and base URL in environment variables:</p>
<pre><code class="language-bash">export GLOWSMS_API_KEY="YOUR_API_KEY"
export GLOWSMS_BASE_URL="https://glowsms.com/api/v1"
</code></pre>
<p>This allows you to reuse your credentials throughout the tutorial without including the actual API key in every command.</p>
<p>In production environments, API credentials should be stored securely on the server side. Never expose API keys in frontend applications, public repositories, or application logs.</p>
<h2>Step 2: Check Your Account Balance</h2>
<p>Before purchasing a number, check whether your account has sufficient funds.</p>
<p><strong>Endpoint:</strong> <code>GET /balance</code></p>
<pre><code class="language-bash">curl "$GLOWSMS_BASE_URL/balance" \
  -H "Authorization: Bearer $GLOWSMS_API_KEY"
</code></pre>
<p>Checking your balance is particularly useful before creating orders in automated workflows.</p>
<p>Website purchases and API purchases use the same GlowSMS account balance.</p>
<h2>Step 3: List Supported Services</h2>
<p>Retrieve the available services through the services endpoint.</p>
<p><strong>Endpoint:</strong> <code>GET /services</code></p>
<pre><code class="language-bash">curl "$GLOWSMS_BASE_URL/services" \
  -H "Authorization: Bearer $GLOWSMS_API_KEY"
</code></pre>
<p>GlowSMS supports more than 500 online services.</p>
<p>Use the service identifiers returned by the API when requesting offers or creating orders, rather than assuming that a service's display name matches its API identifier.</p>
<h2>Step 4: Check Number Availability and Pricing</h2>
<p>Before purchasing a number, retrieve the available offers for your selected country and service.</p>
<p><strong>Endpoint:</strong> <code>GET /offers</code></p>
<pre><code class="language-bash">curl "$GLOWSMS_BASE_URL/offers?service=google&amp;country=us" \
  -H "Authorization: Bearer $GLOWSMS_API_KEY"
</code></pre>
<p>Both query parameters are required.</p>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Description</th>
<th>Example</th>
</tr>
</thead>
<tbody><tr>
<td>service</td>
<td>Supported service identifier</td>
<td>google</td>
</tr>
<tr>
<td>country</td>
<td>Lowercase ISO country code</td>
<td>us</td>
</tr>
</tbody></table>
<p>Number availability and pricing vary by country, service, and current inventory.</p>
<p>Applications should retrieve current offers before creating an order instead of relying on previously cached prices.</p>
<h2>Step 5: Create an SMS Verification Order</h2>
<p>Once you have selected a suitable country and service, create an order.</p>
<p><strong>Endpoint:</strong> <code>POST /orders</code></p>
<pre><code class="language-bash">curl -X POST "$GLOWSMS_BASE_URL/orders" \
  -H "Authorization: Bearer $GLOWSMS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: b3f1c9a2-6c1e-4a2b-9f77-2a5d3e8c1d90" \
  -d '{"service":"google","country":"us"}'
</code></pre>
<p>The request specifies the desired service and country.</p>
<p>If the optional <code>cost</code> parameter is omitted, GlowSMS selects the lowest-priced available offer for that combination.</p>
<p><strong>Important:</strong> This request creates a real order and deducts funds from your account balance.</p>
<h3>Preventing Duplicate Purchases with Idempotency</h3>
<p>Network failures can occur after a server has processed a purchase but before the client receives a response.</p>
<p>Retrying an order creation request without appropriate safeguards may result in an unintended duplicate purchase.</p>
<p>GlowSMS supports the <code>Idempotency-Key</code> header to help prevent this.</p>
<ul>
<li>Generate a new unique key for each intended purchase.</li>
<li>Reuse the same key when retrying that purchase after a network timeout.</li>
<li>Never reuse the example key above for unrelated purchases.</li>
</ul>
<p>This is particularly important for production applications where requests may be retried automatically.</p>
<p>After successfully creating an order, retain the returned order identifier and phone number.</p>
<h2>Step 6: Retrieve the SMS Verification Code</h2>
<p>After requesting a verification code through an authorized verification workflow, retrieve the corresponding order.</p>
<p><strong>Endpoint:</strong> <code>GET /orders/{id}</code></p>
<pre><code class="language-bash">curl "$GLOWSMS_BASE_URL/orders/ord_a1b2c3d4e5" \
  -H "Authorization: Bearer $GLOWSMS_API_KEY"
</code></pre>
<p>Replace <code>ord_a1b2c3d4e5</code> with the actual order identifier returned when creating your order.</p>
<p>Applications can check the order every 3–5 seconds while respecting the order expiration time and applicable API limits.</p>
<p>When the order status becomes <code>active</code>, the <code>code</code> field contains the received verification code.</p>
<h3>Understanding Order States</h3>
<table>
<thead>
<tr>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>active</td>
<td>A verification code has been received</td>
</tr>
<tr>
<td>completed</td>
<td>The order has been completed</td>
</tr>
<tr>
<td>cancelled</td>
<td>The order has been cancelled</td>
</tr>
<tr>
<td>timed_out</td>
<td>The order has expired</td>
</tr>
</tbody></table>
<p>Stop polling when the verification code becomes available or the order reaches a terminal state.</p>
<p>Verification codes should be treated as sensitive information and should not be exposed in application logs, analytics events, or error reports.</p>
<h2>Step 7: Complete the Order</h2>
<p>After receiving and using the verification code, complete the order.</p>
<p><strong>Endpoint:</strong> <code>POST /orders/{id}/finish</code></p>
<pre><code class="language-bash">curl -X POST "$GLOWSMS_BASE_URL/orders/ord_a1b2c3d4e5/finish" \
  -H "Authorization: Bearer $GLOWSMS_API_KEY"
</code></pre>
<p>Completing the order allows your application to explicitly close the verification workflow.</p>
<h2>Step 8: Cancel an Unsuccessful Order</h2>
<p>If a verification code has not arrived, eligible orders can be cancelled through the API.</p>
<p><strong>Endpoint:</strong> <code>POST /orders/{id}/cancel</code></p>
<pre><code class="language-bash">curl -X POST "$GLOWSMS_BASE_URL/orders/ord_a1b2c3d4e5/cancel" \
  -H "Authorization: Bearer $GLOWSMS_API_KEY"
</code></pre>
<p>Cancellation is subject to the following conditions:</p>
<ul>
<li>Orders cannot be cancelled within the first 120 seconds after purchase.</li>
<li>Attempting to cancel during this period returns <code>cannot_cancel</code>.</li>
<li>Orders that have already received a verification code are not eligible for a refund.</li>
</ul>
<p>Eligible orders that expire without receiving a verification code are automatically refunded.</p>
<p>For complete refund eligibility requirements, refer to the <a href="https://glowsms.com/refund">GlowSMS Refund Policy</a>.</p>
<h2>API Endpoint Reference</h2>
<p>The following table summarizes the endpoints covered in this tutorial.</p>
<table>
<thead>
<tr>
<th>Method</th>
<th>Endpoint</th>
<th>Purpose</th>
</tr>
</thead>
<tbody><tr>
<td>GET</td>
<td>/balance</td>
<td>Check account balance</td>
</tr>
<tr>
<td>GET</td>
<td>/services</td>
<td>Retrieve supported services</td>
</tr>
<tr>
<td>GET</td>
<td>/offers</td>
<td>Check availability and pricing</td>
</tr>
<tr>
<td>POST</td>
<td>/orders</td>
<td>Purchase a phone number</td>
</tr>
<tr>
<td>GET</td>
<td>/orders/{id}</td>
<td>Retrieve order details and SMS code</td>
</tr>
<tr>
<td>POST</td>
<td>/orders/{id}/finish</td>
<td>Complete an order</td>
</tr>
<tr>
<td>POST</td>
<td>/orders/{id}/cancel</td>
<td>Cancel an eligible order</td>
</tr>
</tbody></table>
<p>All endpoints are relative to the GlowSMS API base URL.</p>
<h2>Handling API Errors</h2>
<p>A reliable integration should account for unsuccessful requests and unexpected network conditions.</p>
<p>Common scenarios include:</p>
<ul>
<li>Invalid or missing API credentials</li>
<li>Insufficient account balance</li>
<li>Invalid service or country parameters</li>
<li>Unavailable phone numbers</li>
<li>Network timeouts</li>
<li>API rate limits</li>
<li>Orders that are no longer eligible for cancellation</li>
</ul>
<p>Applications should inspect HTTP status codes and documented error responses before deciding whether to retry a request.</p>
<p>For purchase requests, always preserve the original idempotency key when retrying the same intended transaction.</p>
<p>Avoid unlimited retries and stop checking orders once they reach a terminal state.</p>
<h2>Production Integration Best Practices</h2>
<p>When integrating the GlowSMS REST API into a production application:</p>
<ul>
<li>Keep API credentials on the server side.</li>
<li>Use HTTPS for all API requests.</li>
<li>Check current availability before purchasing numbers.</li>
<li>Generate unique idempotency keys for new purchases.</li>
<li>Implement bounded retries and appropriate request timeouts.</li>
<li>Track order identifiers and expiration times.</li>
<li>Avoid storing unnecessary SMS verification data.</li>
<li>Respect third-party platform policies and use the API only for authorized verification workflows.</li>
</ul>
<h2>Pricing and Payment Options</h2>
<p>GlowSMS operates on a pay-per-use pricing model without monthly subscriptions or recurring subscription fees.</p>
<p>Prices vary depending on the selected country, service, and available offers.</p>
<p>Supported payment methods include credit and debit cards, Apple Pay, Google Pay, Alipay, and cryptocurrency. A cryptocurrency wallet is not required to use GlowSMS.</p>
<h2>Conclusion</h2>
<p>The GlowSMS REST API provides a complete workflow for managing temporary phone numbers and SMS verification programmatically.</p>
<p>Developers can check their balance, discover supported services, retrieve current offers, create orders, receive verification codes, and manage the order lifecycle through a consistent REST API interface.</p>
<p>For further information, explore the official GlowSMS developer resources:</p>
<ul>
<li><a href="https://glowsms.com">GlowSMS Official Website</a></li>
<li><a href="https://glowsms.com/api/docs">GlowSMS REST API Documentation</a></li>
<li><a href="https://glowsms.com/service">Supported Services and Pricing</a></li>
</ul>
<p>For technical assistance, contact <a href="mailto:support@glowsms.com">support@glowsms.com</a>.</p>
<p>Published by the official GlowSMS Developer Blog.</p>
]]></content:encoded></item></channel></rss>