Rest API documentation
REST API Documentation
The REST API (Representational State Transfer) is a modern, easy-to-use web service that enables simple and fast communication between systems. The REST API uses JSON or XML-based data exchange, which is familiar to many developers and easy to process, making it easy to integrate into any development environment. Our REST API offers a flexible and scalable solution for SMS sending and management functions.
You can access the REST API through HTTP methods such as POST, GET, and DELETE. The authentication process is performed using the connect function, where users of the API receive token-based authentication. After that, you can use the API to check your SMS sending credits (getCreditNumber), retrieve monthly statistics (getMonthlyStat), or even send an SMS using the sendSMS function.
The simplicity and speed of the REST API make it an excellent choice for developers, especially those who are considering flexible, web-based solutions. It can be an ideal choice for integration with various platforms, mobile applications, or other web systems. With our REST API, businesses can efficiently manage their SMS campaigns and notifications and track the status of sent messages in real time, all in a quick and easy way.
The simpleSMS REST API
- endpoint is available at the URL https://api.simplesms.hu/rest/SMSapi/.
- Rest API calls can be downloaded here in Postman.
1. Connection: connect (https://api.simplesms.hu/rest/SMSapi/connect)
A connection is required for all further REST API method calls. If there is no connection or the connection fails, further requests will be rejected with an error message.
The access_token obtained here can be used as a bearer token to access further methods.
Parameters: expects the parameters as a POST request
- username: the username provided in the API access section of the simplesms portal
- password: the password specified for API access on the simplesms portal
- domain: the password specified for API access on the simplesms portal
Return value:
- we always return an array
- values returned for a successful message:
- access_token: this must be used when calling further methods.
- expires_in: the expiration date of the token
- returns an error message in case of an incorrect response
2. Sending of SMS: sendSMS
Endpoint: https://api.simplesms.hu/rest/SMSapi/sendSMS
Parameters: This call also expects the parameters as POST.
-
country_code: country code (e.g. 36 for Hungary)
-
area_code: service provider code (e.g. 30 for Telekom, 20 for Yettel, 70 for Vodafone, 50 for Digi...)
-
number: the rest of the phone number (e.g. 1234567)
-
message: the content of the SMS intended for sending
Return value:
- If the message is successful, we return the internal ID of the SMS in the response value, which can be used later to retrieve statuses or historical information.
- In case of an incorrect response, the endpoint returns an error message.
3. Balance inquiry: getCreditNumber
Endpoint: https://api.simplesms.hu/rest/SMSapi/getCreditNumber
There are no parameters.
Return value:
- if successful, the value of the response field in the returned array contains the available balance.
- returns an error message in case of an error API endpoint.
4. Query of monthly statistics: getMonthlyStat
Endpoint: https://api.simplesms.hu/rest/SMSapi/getMonthlyStat
There are no parameters.
Return value:
- If the value is successful, the monthly statistics are returned in a single array in the return array, broken down by YYYY-MM, with domestic and foreign SMS numbers separated.
- returns an error message in case of an error API endpoint.
5. Status of SMS: getStatus
Endpoint: https://api.simplesms.hu/rest/SMSapi/getStatus
The system provides the option to query the current status.
Parameters: The parameter is expected as POST in the API call.
- sms_id: the internal ID of the SMS returned by sendSMS.
Return value:
- If the request is successful, the response is contained in the response field of the returned array, where all information related to the SMS can be found.
- data provided at the time of sending
- date of creation
- delivery status
- time of last status change
- in case of an error, return the error message to the API.
6. History of SMS status: getHístory()
Endpoint: https://api.simplesms.hu/rest/SMSapi/getHistory
The system provides the option to query changes of SMS status.
Parameters: The parameter is expected as POST in the API call.
- sms_id: the internal ID of the SMS returned by sendSMS
Return value:
- If the request is successful, the response is contained in the response field of the returned array, where all information related to the SMS can be found.
- last status data (code, message, date, comment for certain types)
- In case of an error, the error message is returned by the API.
For more details and to set up integrations, please review the full API documentation or contact us if you have any questions!