querySms
Returns SMS messages that match the query.
This method supports the semantics of search queries.
Request
GET https://api.bytehand.com/v2/sms/messages
Parameters
Query Parameters | |
---|---|
count | number Optional parameter. Number of objects per page. Minimum value 1, maximum value 100000. Default 10 objects. |
fields | string Optional parameter. Field names, separated by commas, to be returned for all objects in the array. Valid fields to search are determined by the type of objects being searched. By default, the most important fields are returned, individually for each type of object. To get all possible fields at once fields, use the value *. Specify only those fields that you need, this will increase the speed of work. |
page | number Optional parameter. Page number. Search results are always paginated, the number of objects per page is determined by the count field. The first page is always number one. The first is returned by default page. |
plain | boolean Optional parameter. If true then don't count the total number of objects that match the search query. Use improves performance. Default false. |
query | string Optional parameter. Search query. Use special language for writing queries. Valid search fields are determined by the type of objects being searched. Default is empty query that matches all objects. |
sort | string Optional parameter. How to sort objects. The sort order is specified using field names separated by commas. If you precede the field name with -, then the order is reversed Valid search fields are determined by the type of objects being searched. |
Authorization
Requires authorization and access right sms_view.
Response
Upon successful completion of the request, an object of type Sms[] is returned.
This method returns additional data in the headers of the HTTP response, read more in the section search queries.
Example
Request
GET https://api.bytehand.com/v2/sms/messages?query=from%3AMyShop&sort=id&fields=id%2Cstate%2Csender%2Creceiver%2Ctext X-Service-Key: ZO0XJngUXZKjlcFNpzXBbw4UriheYwlc
Response
Status Code: 200 Content-Range: Sms 0-9/518 Link: ; rel="next", ; rel="last" Content-Type: application/json;charset=UTF-8 Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache [ { "sender": "MyShop", "receiver": "8(916)9361", "text": "Test 1", "state": "rejected", "id": "164030947974825423" }, { "sender": "MyShop", "receiver": "+79167654321", "text": "Test 2", "state": "delivered", "id": "164030953803402255" }, { "sender": "MyShop", "receiver": "+79167654321", "text": "Today only! 20% off for all goods!!", "state": "delivered", "id": "164030961834893019" }, .......... ]