Developer Docs

Table of contents

Search for contacts in the Stoplist

Method for searching contacts in the Stoplist. 

In the search, it is possible to use operations: like, =, >, >=, <, <=.

To search for contacts in the stoplist, make a request to this URL:

GET  http://one-api.bsg.world/api/stoplists/search

Request parameters:

ParameterRequiredTypeDefaultDescription
page[offset]Noint0Get contacts starting from offset
page[limit]Noint50Number of contacts in response
sortNostringidSort by conditions: id, phone
wayNostringascSorting options: asc, desc
search[operation]Nostring=Operator for finding values: like, =, >, >=, <, <=
search[field]NostringnoField for search: id, type, phone, date
search[value]Value for search:Nostringno
idContact ID
typeStop list. Possible values: sms, viber 
If you need to search in both stop lists, do not set the type
phonePhone number. 9 to 15 digits
dateDate of adding the contact to the stop list or a range of dates. Format ISO 8601: yyyy-mm-dd hh:mm:ss

Response parameters:

ParameterTypeDescription
idintegerContact ID
phoneintegerPhone number
created_atstringDate of adding the contact to the stop list. Display format ISO 8601: yyyy-mm-dd hh:mm:ss
sms_stoplistbooleanWhether the contact was added to the SMS stop list. Possible values: true or false
viber_stoplistbooleanWhether the contact was added to the Viber stop list. Possible values: true or false

If the request is successful, you will receive a response:

{
  "data": [
    {
      "id": 9392897,
      "phone": 12345678900,
      "created_at": "2022-04-18 19:22:16",
      "sms_stoplist": true,
      "viber_stoplist": false
    }
  ],
  "meta": {
    "page": {
      "total": 1,
      "limit": 30,
      "offset": 0
    },
    "search": {
      "field": "id",
      "operation": "like",
      "value": "string"
    }
  }
}

We use cookies (and other similar technologies) to collect data to improve your experience on our site. By using our website, you’re agreeing to the collection of data as described in our Website Data Collection Policy.