API

General info

We maintain an sms-activate compatible API.

You can just replace sms-activate.org to daisysms.com in your software. If you are unable to change the domain, please contact support for the server's IP address so that you can edit an entry in /etc/hosts.

You may have 20 active rentals at a time. Once you get the code or cancel the rental, you can rent a new number. We encourage you to reserve a number just before you need to use it, so that you don't block the number for different users for too long. If you need a higher limit, please contact support.

In order to make API calls, you need to provide your API token as api_key in the URL.

You can get your API key on this page.

Getting user balance

curl "https://daisysms.com/stubs/handler_api.php?api_key=$APIKEY&action=getBalance"

            
# Response example (balance is in dollars): ACCESS_BALANCE:50.30
# Not authorized: BAD_KEY

Renting a number

You'll need to have sufficient balance and know the shortcode of the service. You can get the shortcode from the Services page.

You can also specify max_price - the maximum price you're willing to pay for the number. The request will fail with MAX_PRICE_EXCEEDED if the current price of the service is higher than max_price. max_price is to be specified in dollars, e.g. max_price=0.50 means 50 cents. To ensure compatibility with sms-activate, maxPrice can be used as an alias of max_price. Max price is inclusive, i.e. if you set it to 0.50, and the price is exactly 0.50, the request will succeed.

For example: the current price of service X is $0.50. We see a surge in demand where numbers get sold out instantly and we increase the price to $0.60. If you have set max_price to $0.50, you'll get an error on the next API call. However if we see the demand at $0.50 is low, we will decrease the price to $0.40. In this case your API calls will work and you will only pay $0.40 for the number.

We recommend that you include max_price with every request. This could help you prevent unexpected expenses in case we raise the price.

Each successful rental also has X-Price header set to the effective price of the rented number.

You can specify area codes in the `areas` query string parameter. Such rentals are subject to a 20% price increase. For example, areas=212,718 will only rent numbers with area codes 212 or 718.

You can specify carrier in the `carriers` query string parameter. You need to use "tmo" for T-Mobile, "vz" for Verizon, and "att" for AT&T. Such rentals are also subject to a 20% price increase. For example, carriers=tmo,vz will only rent numbers by T-Mobile or Verizon.

curl "https://daisysms.com/stubs/handler_api.php?api_key=$APIKEY&action=getNumber&service=ds&max_price=5.5"

            
# Got the number: ACCESS_NUMBER:999999:13476711222
# Max price exceeded: MAX_PRICE_EXCEEDED
# No numbers left: NO_NUMBERS
# Need to finish some rentals before renting more: TOO_MANY_ACTIVE_RENTALS
# Not enough balance left: NO_MONEY
# Example with area codes
curl "https://daisysms.com/stubs/handler_api.php?api_key=$APIKEY&action=getNumber&service=ds&max_price=5.5&areas=201,520"
# Example with carrier and area codes
curl "https://daisysms.com/stubs/handler_api.php?api_key=$APIKEY&action=getNumber&service=ds&max_price=5.5&carriers=tmo&areas=201,520"

Getting the code

You'll need the ID that you got from the rent number response. Please poll every 3 seconds or more.

# GET https://daisysms.com/stubs/handler_api.php?api_key=$APIKEY&action=getStatus&id=$ID

            
curl "https://daisysms.com/stubs/handler_api.php?api_key=$APIKEY&action=getStatus&id=308"

            
# Got code: STATUS_OK:12345
# Wrong ID: NO_ACTIVATION
# Waiting for SMS: STATUS_WAIT_CODE
# Rental cancelled: STATUS_CANCEL

Marking rental as done

Some services support getting multiple codes within your rental timeframe. Once you're done with the number and don't need to receive any more SMS to it, we suggest that you mark it as "done". This helps our service and makes sure you don't run out of the limit of numbers waiting for SMS at the same time.

# GET https://daisysms.com/stubs/handler_api.php?api_key=$APIKEY&action=setStatus&id=$ID&status=6

            
curl "https://daisysms.com/stubs/handler_api.php?api_key=$APIKEY&action=setStatus&id=308&status=6"

            
# Success: ACCESS_ACTIVATION
# Failure (rental missing): NO_ACTIVATION

Cancelling a rental

You can cancel a rental and receive the locked money back to your main balance. Please refrain from looping through numbers without using them since it may get your account banned.

# GET https://daisysms.com/stubs/handler_api.php?api_key=$APIKEY&action=setStatus&id=$ID&status=8

            
curl "https://daisysms.com/stubs/handler_api.php?api_key=$APIKEY&action=setStatus&id=308&status=8"

            
# Success: ACCESS_CANCEL
# Failure (rental missing or already got the code): ACCESS_READY

Getting a list of services with prices

There are 2 ways to get the list of services along with info about remaining numbers, prices, and whether the service can receive more than one sms. If there are more than 100 numbers remaining, you are not shown the exact amount. For example if there are 55 number remaining, you will see "55" in the response. If there are 155 numbers remaining, you will see "100". 187 is the code for USA in sms-activate API.

Getting an object that goes: service => country => data:

curl "https://daisysms.com/stubs/handler_api.php?api_key=$APIKEY&action=getPricesVerification"

Getting an object that goes: country => service => data:

curl "https://daisysms.com/stubs/handler_api.php?api_key=$APIKEY&action=getPrices"

Webhooks

You can set a webhook URL on the profile page. If you do so, incoming SMS will be forwarded in a POST request to that address. If your server doesn't respond with a 2xx status code, the attempt will be retried 15 seconds later for a maximum of 8 times. The timeout for the request is 3 seconds.

The format of the message is as follows:

{
    "activationId": 123,
    "messageId": 999,
    "service": "go",
    "text": "Your sms text",
    "code": "Your sms code",
    "country": 0,
    "receivedAt": "2022-06-01 17:30:57"
}

(The date is in UTC)

Getting numbers in batches

You can get multiple numbers in 1 request in the following format:

13479111111----https://daisysms.com/stubs/multi/result?id=1005&apikey=YOUR_API_KEY_HERE
13479111112----https://daisysms.com/stubs/multi/result?id=1006&apikey=YOUR_API_KEY_HERE

Use the following URL. Replace $APIKEY with your API key.

https://daisysms.com/stubs/multi/reserve?apikey=$APIKEY&service=mb&count=2&max_price=0.25

The URL provided with the number will contain text "WAITING" on no SMS, and the following JSON on SMS:

{"code":200,"message":"success","data":"full message here"}

The same restrictions apply as with the other methods.