1. Teleboard | Support Center
  2. Solution home
  3. API Documentation
  4. REST API - GET Requests
Open navigation

GET/contact and GET/contacts

The GET/contact request returns a list of personal contacts for a user based on the provided basic authorization credentials. The list can be limited to one contact if the "id" parameter is used.


The GET/contacts request is basically idential except that it always returns all contacts for the user. It does not support the "id" parameter!


If you  to includes company contacts in the list you need to use the Get/people request instead. It also contains some more details such as PBX line, chat channel, and a system user name.


The response has the following fields of information:


  • ID- the unique ID of the contact. 
  • fname -  the first name of the contact. 
  • lname - the last name of the contact. 
  • organization - the organization (company) of the contact. 
  • email - the email address of the contact. 
  • number - the phone number (landline) of the contact.
  • mobile - the mobile phone number of the contact. 
  • fax - the fax number of the contact.
  • website - the website of the contact.
  • image - if an image of the contact has been uploaded by the user, a path to the image will be detailed in this field.

    Otherwise for GET/contact a blank field will be shown or for GET/Contacts the default TeleConsole image will shown - telebroad.com\/assets\/images\/default_avatar.png.
  • public - a value of 1 indicates the contact is public. A value of 0 indicates it is non-public. A public contact is made available to other users in the company on their own list of contacts.
  • owned - A value of 1 indicates the contact is owned by the user, meaning that it has been created and can be edited by him. A value of 0 indicates it is not

Parameters


All parameters go in the header.


Parameter
Type
Operation
id
string
Without this parameter all contacts for the user will be returned.

Include this parameter to request one specific contact.
limit
integer
Specify the number of records to be returned by the request.
offset
Integer
Specify the first record to display. For example an offset of 3 will start the list on the 3rd record. If left empty the default will be the first record.

Examples


To get the record of a specific personal contact with use this syntax:


HTTPS method: GET


webserv.telebroad.com/api/teleconsole/rest/contact?id=9442


Response:


The record for the contact will be returned, but if a wrong ID was provided the response will be this error -


{

    "error":

    {"code":444,"message":"Contact does not exist or does not belong to you"

    }

}



To get the a list of a user's personal contacts with a limit of 3 records use this syntax:


HTTPS method: GET


webserv.telebroad.com/api/teleconsole/rest/contact?limit=3


Response:


{

    "error":null,

        "result":

        [{"id":"1592",

            "fname":"Nick",

            "lname":"Ramon",

            "organization":"GNV Consulting",

            "email":"N.ramon@gnvc.com",

            "number":"201-711-2400",

            "mobile":"201-483-5171",

            "fax":"201-711-2401",

            "website:"",

            "image":

            https:\/\/telebroad.com\/cdn\

            /avatar\/0f\/da\/c5c5ecf77f32ca541003

            b32e8b2d02hfa301.png",

            "public":"0",

            "owned":1},

        {"id":"6942",

            "fname":"Andy",

            "lname":"Klein",

            "organization":"National HS",

            "email":"andy.klein28@gmail.com",

            "number":"917-838-4128",

            "mobile":"917-383-4128",

            "fax":"",

            "website":"",

            "image":"",

            "public":"0",

            "owned":1}

        {"id":"10444",

            "fname":"Roger",

            "lname":"Smart",

            "organization":"",

            "email":"R.smart@onegoal.com",

            "number":"",

            "mobile":"672-542-3748",

            "fax":"",

            "website":"",

            "image":"",

            "public":"0",

            "owned":1}

        ]

}