How do I find the message price in the API?

Updated 3 years ago

You can use the official REST API documentation for ClickSend and search Calculate SMS Price, find the code sample and change and run it according to your data.

This is the Response of running cURL Code sample to find out price for sending two messages You can look at message price in the response next to "total_price" and "message_price", it will show total price and much each individual message costs:

{
"http_code": 200,
"response_code": "SUCCESS",
"response_msg": "Here are your data.",
"data": {
"total_price": 0.14
"total_count": 2,
"queued_count": 2,
"messages": [
{
"direction": "out",
"date": 1436871253,
"to": "+61411111111",
"body": "Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
"from": "sendmobile",
"schedule": 1436874701,
"message_id": "BF7AD270-0DE2-418B-B606-71D527D9C1AE",
"message_parts": 1,
"message_price": 0.07,
"custom_string": "this is a test",
"user_id": 1,
"subaccount_id": 1,
"country": "AU",
"carrier": "Telstra",
"status": "SUCCESS"
},
{
"direction": "out",
"date": 1436871253,
"to": "+61411111111",
"body": "Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.",
"from": "sendlist",
"schedule": 1436876011,
"message_id": "D0C273EE-816D-4DF2-8E9D-9D9C65F168F3",
"message_parts": 1,
"message_price": 0.07,
"custom_string": "this is a test",
"user_id": 1,
"subaccount_id": 1,
"country": "AU",
"carrier": "Telstra",
"status": "SUCCESS"
}
],
"currency": {
"currency_name_short": "USD",
"currency_prefix_d": "$",
"currency_prefix_c": "¢",
"currency_name_long": "US Dollars"
}
}
}


How Did We Do?


Powered by HelpDocs (opens in a new tab)