RENTAL GUIDE
How to order a temporary SMS number through the API
Follow one rental from country selection to a confirmed order ID using the mysmsline public API.
Look up a country and service
With the native interface, request GET /countries, choose a returned country_code, then request GET /services/{country}. Read short_code, available_count, actual_price and offer_price from the same row. Compatibility interfaces use their own identifiers. Use one interface for the entire order.
Submit one purchase
Send POST /order-service with the selected country_code, service_code, current amount and order_source set to 2. Use your public API key from your server and give this purchase an Idempotency-Key. Save the key before submitting so your application can reuse it if the connection drops.
Distinguish a ready number from a pending allocation
A successful allocation includes the assigned number, order ID and end time. Store those fields together. HTTP 202 means the allocation is pending. Retain the order ID for follow-up. Starting a second purchase with a new key can create another charge.
Close the rental
Send the saved order ID to /complete-order when you finish. For an eligible cancellation, send the ID and reason to /cancel-order. Read the returned status to see whether the order was completed or refunded. The API reference includes request examples for all four interfaces.
Create an account →