Getting started
This is where the magic begins! Follow these steps to start creating amazing apps using the API: Log into the dashboard using your SMSgic account.
Create an access token and use it in your API requests.
For more convenient work, download our Postman collection and you are ready to start.
Get account balance.
This endpoint allows you to retrieve your account balance.
curl -X GET \
-G "https://api.smsgic.com/balance" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
{
"balance": "450.000",
"sign": "£",
"code": "GBP",
}
{
"message":"Unauthenticated."
}
Get account senders.
This endpoint allows you to retrieve your account senders.
curl -X GET \
-G "https://api.smsgic.com/senders" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
{
"senders": [
{
"id": 45,
"sender": "MegaShop",
},
{
"id": 46,
"sender": "DSTLCKDM",
},
{
"id": 136,
"sender": "MEGA",
},
]
}
{
"message":"Unauthenticated."
}
Get account rates with currency.
This endpoint allows you to retrieve your account rates. Rates are filtered if use params.
Common attributes
mccstring
This field is required when mnc is present. Must match the regex /^\d{3}$/
mncstring
Must match the regex /^\d{0,3}|'null'$/.
countrystring
Part of country title for search.
country_idinteger
Valid Id of country in smsgic.com for search.
curl -X GET \
-G "https://api.smsgic.com/rates" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"mcc":"742","mnc":"551","country":"Latvia","country_id":1}'
{
"rates": [
{
"mcc": "218",
"mnc": "90",
"country": "Latvia",
"rate": 0.4397,
},
{
"mcc": "218",
"mnc": null,
"country": "Latvia",
"rate": 0.4397,
},
{
"mcc": "218",
"mnc": "05",
"country": "Latvia",
"rate": 0.4397
},
{
"mcc": "218",
"mnc": "03",
"country": "Latvia",
"rate": 0.4397,
},
]
}
{
"message":"Unauthenticated."
}
Get SMS API status.
API exposes an endpoint for checking the service status.
curl -X GET \
-G "https://api.smsgic.com/status" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
["OK"]
Calculate SMS messaging.
This endpoint allows you to receive the calculate of SMS messaging. The method supports 3000 requests per minute. There are no software restrictions on the quantity of phone numbers
Common attributes
messagestring | required
Text of sending SMS.
recipientsstring[] | required
Must match the regex /^\d{8,20}$/.
curl -X POST \
"https://api.smsgic.com/sendings/calculate" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"message":"message","recipients":["50670503888225"]}'
{
"calculate": {
"info": {
"sms_count": 3,
"subtotal": 1.35,
"total": 1.35,
"tax": 0,
},
"destinations": [
{
"numbers": [
{
"phone_number": 45879921,
"destination": "Denmark Telenor",
"sms": 1,
"rate": 0.45,
"total": 0.45,
},
],
"destination": "Denmark Telenor",
"sms_count": 1,
"price": 0.45,
"total": 0.45,
},
{
"numbers": [
{
"phone_number": 6523478945,
"destination": "Singapore ",
"sms": 1,
"rate": 0.45,
"total": 0.45,
},
],
"destination": "Singapore ",
"sms_count": 1,
"price": 0.45,
"total": 0.45,
},
{
"numbers": [
{
"phone_number": 7554684221,
"destination": "Russia ",
"sms": 1,
"rate": 0.45,
"total": 0.45,
},
],
"destination": "Russia ",
"sms_count": 1,
"price": 0.45,
"total": 0.45,
}
]
}
}
{
"message":"Unauthenticated."
}
{
"message": "Please send `message` post parameter with text for SMS",
"errors": {
"message": [
"Please send `message` post parameter with text for SMS"
]
}
}
{
"message": "Please send `recipients` post parameter with recipient`s number",
"errors": {
"recipients": [
"Please send `recipients` post parameter with recipient`s number"
]
}
}
{
"message": "The given data was invalid.",
"errors": {
"message": [
"Please send `message` post parameter with text for SMS"
],
"recipients": [
"Please send `recipients` post parameter with recipient`s number"
]
}
}
Get your account SMS messages.
This endpoint allows you to retrieve your account SMS messages.
curl -X GET \
-G "https://api.smsgic.com/sendings" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
{
"sendings": [
{
"id": 301,
"text": "Test Message",
"created_at": "2023-04-11T15:46:26.000000Z",
"scheduled_at": "2023-04-11 15:46:26",
"status": "Pending",
"total_sms": 1,
},
{
"id": 452,
"text": "SEND SMS FOR ME",
"created_at": "2023-06-06T12:39:35.000000Z",
"scheduled_at": "2023-06-06 12:39:35",
"status": "Pending",
"total_sms": 2,
},
{
"id": 457,
"text": "ANOTHER text of SMS",
"created_at": "2023-06-06T13:41:57.000000Z",
"scheduled_at": "2023-06-06 13:41:57",
"status": "Pending",
"total_sms": 2,
},
]
}
{
"message":"Unauthenticated."
}
Start SMS messaging.
This endpoint allows you create SMS messaging. Your account must have balance enough.
Common attributes
typestring
Possible options: default, infobip, twilio, messente, trumpia.
Attributes
messagestring | required
Text of sending SMS.
recipientsstring[] | required
Array of phone numbers for send SMS. Must match the regex /^\d{8,20}$/.
senderstring | required
Title of default or your account sender approved.
scheduled_atdate
Schedule SMS sending at time. Must be a valid date in the format Y-m-d H:i:s.
curl -X POST \
"https://api.smsgic.com/sendings" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"message":"message","recipients":"[\"951490713339111991\"]","sender":"INFO","scheduled_at":"2023-08-22 09:03:42"}'
{
"message": "SMS champing created",
"sending_id": 458,
}
{
"message":"Unauthenticated."
}
{
"message": "Please send `message` post parameter with text for SMS",
"errors": {
"message": ["Please send `message` post parameter with text for SMS"]
}
}
{
"message": "Please send `recipients` post parameter with recipient`s number",
"errors": {
"message": ["Please send `recipients` post parameter with recipient`s number"]
}
}
{
"message": "Please send `sender` post parameter with name of SMS sender",
"errors": {
"message": ["Please send `sender` post parameter with name of SMS sender"]
}
}
Get your account SMS messaging status.
This endpoint allows you to retrieve your account SMS messages status.
idinteger | required
The ID of the sending.
curl -X GET \
-G "https://api.smsgic.com/sendings/301" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
{
"sending": {
"id": 301,
"status": "Draft",
"updated_at": "2023-04-11T15:46:26.000000Z",
"scheduled_at": "2023-04-11 15:46:26",
}
}
{
"message":"Unauthenticated."
}
{
"message": "No query results for model 301"
}