Developer Docs

Table of contents

Create a contact

The method allows adding new contacts to your Contact Book. 

Please note that in the TEST account mode there is a restriction for performing this method: it is possible to create a contact only for a verified phone number (number verification is performed in the personal account of the BSG platform). 

To create a contact list, make a request to this URL:

POST http://one-api.bsg.world/api/contacts

Request parameters

ParameterRequiredTypeDescription 
phoneyesintegerContact’s phone number.
groupsLists IDs array
idnointegerList ID (generated automatically when creating a contact list)
fieldsarraythe contact details for custom fields
idnointegerCustom field ID
valuenostringCustom field data

If request is successful, you will receive a response

{
  "phone": 85267202829,
  "groups": [
    56147
  ],
  "fields": [
    {
      "id": 25964,
      "value": "TARAS SHEVCHENKO"
    }
  ]
}

Response parameters

ParameterTypeDescription 
idintegerContact ID in the BSG personal account, which is generated automatically when a contact is added to the Contact Book.
phoneintegerContact’s phone number. 
fieldsarrayContains embedded custom fields data
idintegerCustom field ID.
valuestringCustom field data.
created_atdatetimeDate when the contact was created in the system ― set by the system automatically when a contact is added to the Contact Book. Display format ― Y-m-d H:i:s
groupsarrayContains embedded data of the list where the contact is added.
idstringID of the list (generated automatically when creating a contact list) where the contact is added
namestringName of the list where the contact is added
descriptionstringDescription of the list where the contact is added
defaultboolSpecifies whether the contact list is a default one
created_atdatetimeCreation date of the list where the contact is added. Display format ― Y-m-d H:i:s
hlr_statusstringStatus of the contact phone number verification against the HLR database. Possible values: sent, absent, active, unknown, failed.
hlr_last_checkdatetimeThe date and time when the contact’s phone number was last checked against the HLR. 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"
  }
}

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.