Skip to main content

Subscriber Details

POST https://chatapi.viber.com/pa/get_user_details

This endpoint allows you to retrieve the details of a specific subscriber by supplying a user ID.
You can retrieve the user ID from various events related to the user, such as the user subscribed or the user message recieved API. This request can be used twice every 12 hours for each user.

Request

Headers


Content-Type: application/json
Authorization: X-Viber-Auth-Token: YOUR_AUTHENTICATION_TOKEN

Parameters


NameTypeDescriptionNotes
idstringThe id of the subscriber.
Example
curl -X POST https://chatapi.viber.com/pa/get_user_details -H "X-Viber-Auth-Token: YOUR_AUTHENTICATION_TOKEN" -d '{"id":"jc9HsWTZ2Yf2NkRZ8KcNug=="}'

Response

Attributes


NameTypeDescriptionNotes
statusintegerThe status of the request.0 for success. In case of error, an error code will be returned. See common errors for more information
status_messagestringThe status message of the request.ok for sucess. In case of error, one of the following errors will be returned: invalidUrl, invalidAuthToken, badData, missingData and failure. See common errors for more information
message_tokenintegerThe message token of the request.
userobjectThe subscriber details.
user.idstringThe id of the subscriber.
user.namestringThe name of the subscriber.
user.avatarstringThe avatar of the subscriber.
user.countrystringThe country of the subscriber.2 letters country code (ISO ALPHA-2)
user.languagestringThe language of the subscriber.2 letters language code (ISO 639-1)
user.primary_device_osstringThe primary device OS of the subscriber.
user.api_versionintegerThe API version of the subscriber.Currently only 1. Additional versions will be added in the future
user.viber_versionstringThe Viber version of the subscriber.
user.mccintegerThe mobile country code of the subscriber.
user.mncintegerThe mobile network code of the subscriber.
user.device_typestringThe device type of the subscriber.

Headers


Content-Type: application/json

Body


Example
{
"status":0,
"status_message":"ok",
"message_token":4912661846655238145,
"user":{
"id":"01234567890A=",
"name":"John McClane",
"avatar":"http://avatar.example.com",
"country":"UK",
"language":"en",
"primary_device_os":"android 7.1",
"api_version":1,
"viber_version":"6.5.0",
"mcc":1,
"mnc":1,
"device_type":"iPhone9,4"
}
}