HTTPS API v2 / Managing contacts and groups

 

The system enables remote management of contacts using the HTTPS API. Possible operations on contacts are: listing groups, listing contacts in groups, adding, editing, deleting contacts and groups.

Listing groups

Calling address

 

For using the remote operating list the group call the specified URL using the POST method.

groups/index

Available parameters

Parameter Type An example value or format Description
username String Login Username to the account
password String Password Password to the account
search String search term Search by name of the group.
sort String name

An optional parameter that allows sorting by name.

order String asc|desc An optional parameter you can change the sort order.

The parameters in bold are obligatory. Others are optional.

Return response

{
   "items":[{
      "id":17293087,
      "name":"Test API",
      "count":322
   },
   {
      "id":17293086,
      "name":"2014-10-20 11:54:20",
      "count":2
   }]
}

Listing contacts

Calling address

For using the remote operating send a text message should be sent to specific application protocol HTTP or HTTPS POST method.

contacts/index

Available parameters

Parameter Type An example value or format Description
username String Login Username to the account
password String Password Password to the account
search String search term Search among contact with this phrase.
group_id Integer|String eg. 459678754 or „none”

A digital ID in the form of a numerical value or "none" to show not assigned to groups of contacts.

sort String first_name|last_name|phone|company|tax_id|email|address|city|description

An optional parameter that allows sorting the data by a particular column.

order String asc|desc

An optional parameter you can change the sort order.

The parameters in bold are obligatory. Others are optional.

Return response

{
   "items":[{
      "id":228173579,
      "phone":"+48600700800",
      "email":"",
      "company":"",
      "first_name":"Błażej",
      "last_name":"Łopuszański",
      "tax_id":"",
      "address":"",
      "city":"",
      "description":"Dodatkowy opis",
      "blacklist":false,
      "group_id":17293086,
      "group_name":"Grupa testowa"
   },
   {
      "id":228173578,
      "phone":"+48500600700",
      "email":"biuro@serwersms.pl",
      "company":"SerwerSMS.pl",
      "first_name":"Mikołaj",
      "last_name":"Różecki",
      "tax_id":"",
      "address":"",
      "city":"",
      "description":"Szczegółowy opis kontaktu",
      "blacklist":false,
      "group_id":17293086,
      "group_name":"Grupa testowa"
   }]
}

Creating groups

Calling address

For using the remote operating send a text message should be sent to specific application protocol HTTP or HTTPS POST method.

groups/add

Available parameters

Parameter Type An example value or format Description
username String Login Username to the account
password String Password Password to the account
name String eg. „new group” Alphanumeric name describing the group. A maximum of 100 characters.

The parameters in bold are obligatory. Others are optional.

Return response

{
   "success":true,
   "id":17256255
}

Creating contacts

Calling address

For using the remote operating send a text message should be sent to specific application protocol HTTP or HTTPS POST method.

contacts/add

Available parameters

Parameter Type An example value or format Description
username String Login Username to the account
password String Password Password to the account
group_id Integer|Array eg. 15687446 ID of the group to which you want to assign a contact. It is possible to send several identifiers using an array.
phone String eg. +48500600700 The value of the phone Number field.
email String eg. adres@mail.com The value of the email. The field accepts up to 255 characters.
first_name String text The value of the field first_name. The field accepts up to 255 characters.
last_name String text

The value of the field last_name. The field accepts up to 255 characters.

company String text The value of the field company. The field accepts up to 255 characters.
tax_id String text The value of the field tax_id. The field accepts up to 255 characters.
address String text The value of the field address. The field accepts up to 255 characters.
city String text The value of the field city. The field accepts up to 255 characters.
description String text The value of the field description. The field accepts up to 255 characters.

The parameters in bold are obligatory. Others are optional.

Return response

{
   "success":true,
   "id":92890613
}

Edit group

Calling address

For using the remote operating send a text message should be sent to specific application protocol HTTP or HTTPS POST method.

groups/edit

Available parameters

Parameter Type An example value or format Description
username String Login Username to the account.
password String Password Password to the account
id Integer eg. „12345678” ID edited group.
name String eg. „new name” Alphanumeric name describing the group. A maximum of 100 characters.

The parameters in bold are obligatory. Others are optional.

Return response

{
   "success":true,
   "id":17256255
}

Edit contact

Calling address

For using the remote operating send a text message should be sent to specific application protocol HTTP or HTTPS POST method.

contacts/edit

Available parameters

Parameter Type An example value or format Description
username String Login Username to the account.
password String Password Password to the account.
id Integer eg. 12345678 ID edited contact.
group_id Integer|Array eg. 15687446 ID of the group to which you want to assign a contact. It is possible to send several identifiers using an array.
phone String eg. +48500600700 The value of the phone Number field.
email String eg. adres@mail.com The value of the email. The field accepts up to 255 characters.
first_name String text The value of the field first_name. The field accepts up to 255 characters.
last_name String text The value of the field last_name. The field accepts up to 255 characters.
company String text The value of the field company. The field accepts up to 255 characters.
tax_id String text The value of the field tax_id. The field accepts up to 255 characters.
address String text The value of the field address. The field accepts up to 255 characters.
city String text The value of the field city. The field accepts up to 255 characters.
description String text The value of the field description. The field accepts up to 255 characters.

The parameters in bold are obligatory. Others are optional.

Return response

{
   "success":true,
   "id":92890613
}

Delete group

Calling address

For using the remote operating send a text message should be sent to specific application protocol HTTP or HTTPS POST method.

groups/delete

Available parameters

Parameter Type An example value or format Description
username String Login Username to the account.
password String Password Password to the account.
id Integer group ID eg. 12345689

Group ID to delete. Note, when deleting the contacts assigned to it are not deleted.

delete_contacts Boolean true, false or none

Deletes all contacts belonging to the group to be deleted.

The parameters in bold are obligatory. Others are optional.

Return response

{
   "success":true
}

Deleting contacts

Calling address

For using the remote operating send a text message should be sent to specific application protocol HTTP or HTTPS POST method.

contacts/delete

Available parameters

Parameter Type An example value or format Description
username String Login Username to the account.
password String Password Password to the account.
id Integer contact ID eg. 12345689

ID of the contact to delete.

The parameters in bold are obligatory. Others are optional.

Return response

{
   "success":true
}

Checking groups selected contact

Calling address

For using the remote operating send a text message should be sent to specific application protocol HTTP or HTTPS POST method.

groups/check

Available parameters

Parameter Type An example value or format Description
username String Login Username to the account.
password String Password Pasword to the account.
phone String eg. +48500600700 Phone number

The parameters in bold are obligatory. Others are optional.

Return response

{
   "items":[{
      "id":"228274991",
      "group_id":17293172,
      "group_name":"Testowa grupa"
   },
   {
      "id":"228274486",
      "group_id":17885158,
      "group_name":"Grupa numer dwa"
   }]
}