Developer Docs

Table of contents

Get contact by ID

The method allows you to receive detailed information about an existing contact, which is contained in the system, and user fields of the contact.

To get a contact, make a request to this URL:

GET http://one-api.bsg.world/api/contacts/{id}

Request parameters

ParameterRequiredTypeDescription 
idYesintegerID of the contact to get information on (the contact ID is generated automatically by the BSG system when a contact is added).

Response parameters

ParameterTypeDescription 
idintegerContact ID on which the query for information was made. 
phoneintegerContact phone number.
fieldsarrayContains the embedded custom fields parameters
idstringThe ID of the data contact field.
valuestringThe value specified in the contact field.
created_atdatetimeContact creation date ― set automatically by the BSG system when a contact is added to the Contact Book. Display format ― Y-m-d H:i:s
groupsarrayContains embedded parameters of the list to which the contact is added
idstringThe ID of the contact list to which the contact is added
namestringThe name of the list to which the contact is added.
descriptionstringThe name of the list to which the contact is added.
defaultboolIndicates whether the contact list is a default one
created_atdatetimeDate of creation/editing of the list to which the contact was added. Display Format ― Y-m-d H:i:s
hlr_statusstringStatus of verifying the contact’s phone number against the HLR database. Possible values: sent, absent, active, unknown, failed.
hlr_last_checkdatetimeDate and time when the contact’s phone number was last verified against the HLR database. Display Format ― Y-m-d H:i:s

If request is successful, you will receive a response:

{
  "data": {
    "id": 1,
    "phone": 33601148802,
    "fields": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    },
    "created_at": "2022-04-28 14:21:16",
    "groups": [
      {
        "id": 1,
        "name": "string",
        "description": "string",
        "default": 0,
        "created_at": "2022-04-28 14:21:16"
      }
    ],
    "hlr_status": "string",
    "hlr_last_check": "2022-04-28 14:21:16"
  }
}