/
4.1.10 Profile

4.1.10 Profile

Profile

URL: /profile.ashx 

The method allows you to retrieve information about a given user's profile.

Parameter

Description

l

Loginlogin of SIP account 

p

Passwordpassword of SIP account

cl

Check login - optional parameter - if this parameter is set, the method will return the profile of the provided login


--header 'User-Agent: vippie;ios;1.2.3' \
--header 'Content-Type: text/plain' \
--header 'X-VIPPIE-DEVICE-ID: ff66fc693846285d' \
--header 'X-VIPPIE-DEVICE-NAME: iPhone8,1' \
--header 'Authorization: Basic YW5kOmFuZDJhMzJkaW0=' 

In response we will get:

  • in case of error, code (max. 3 digits). The list of possible codes is below.
  • a JSON object representing a given user's profile.

Code

Description

400

Incorrect parameters - one of the parameters was not provided

403

Invalid HTTP method - only POST method accepted

405

Server side error

406

The login and/or password are incorrect

500

Internal server error

response:

{
"fn": "piotr",  - user first name 
"ln": "",          - user last name
"em": "",         - user email
"un": "piotr2", - vippie ID
"co": "",        - country code (ISO2)
"ci": "",         - city name
"sx": "",        - sex
"tz": 0.00,    - time zone
"bd": "",      - birthday 
"sp": 1,       - share phone number
"pn": "",      - phone
"cc": ""       - country code
}

Personal data

URL: /pd.ashx 

The method allows the user's personal data to be saved in the system.

Parameter

Description

l

Login - login of SIP account 

p

Passwordpassword of SIP account

fn

First name -user name (maximum size is 100 characters).
If you want to delete the value, set the value to "NULL"

ln

Last name - username (maximum size is 100 characters).
If you want to delete the value, set the value to "NULL"

em

Email - user's email (maximum size is 200 characters).
If you want to delete the value, set the value to "NULL".

co

Country - country of origin. Possible values are two-letter country codes according to the ISO 3166-1 alpha-2 standard.
If you want to delete the value, set the value to "NULL".

ci

City - city - (maximum size is 100 characters).
If you want to delete the value, set the value to "NULL".

sx

Sex - sex. Possible values are: "m", "f" and "-".
If you want to delete the value, set the value to "NULL".

tz

Time zone - time zone. Possible values are the floating point range from -12.00 to +14.00.
If you want to delete the value, set the value to "NULL".

bd

Birthday -date of birth. Possible values are a date in the form 'YYYY-MM-DD'.
If you want to delete the value, set the value to "NULL".

sp

Share phone number - a parameter specifying whether the user's telephone number is to be publicly available - visible in the search engine.
Possible values are: 1 - phone number available, 0 - phone number hidden.


curl --location --request POST 'https://xxxxxxx/emcd/pd.ashx?l=piotr2&p=wielkipiotr&fn=Jan&ln=Podbipieta&em=piotrand%40interia.pl' \
--header 'User-Agent: vippie;ios;1.2.3' \
--header 'Content-Type: text/plain' \
--header 'Authorization: Basic YW5kOmFuZDJhMzJkaW0=' \
--header 'X-VIPPIE-DEVICE-ID: ff66fc693846285d' \
--header 'X-VIPPIE-DEVICE-NAME: iPhone8,1' 


We will receive a code in response. The list of possible codes is below.

Code

Description

200

OK

400

Incorrect parameters - one of the parameters was not provided

403

Invalid HTTP method - only POST method accepted

405

Server side error

406

The login and/or password are incorrect

409

The email already exists in the system

410

Invalid email format

500

Internal server error

User name

URL/un.ashx 

The method allows you to save your username in the system.

WARNING

The username can only be saved once, so the interface on the dialer should have appropriate security and information about it. You cannot delete a username that has already been saved.

Parameter

Description

l

Loginlogin of SIP account 

p

Passwordpassword of SIP account

un

User name - unikalna nazwa użytkownika w systemie. Nazwa użytkownika musi zawierać min. 6 znaków i składać się tylko z liter i cyfr.


--header 'User-Agent: vippie;ios;1.2.3' \
--header 'Content-Type: text/plain' \
--header 'X-VIPPIE-DEVICE-ID: ff66fc693846285d' \
--header 'X-VIPPIE-DEVICE-NAME: iPhone8,1' \
--header 'Authorization: Basic YW5kOmFuZDJhMzJkaW0=' 

We will receive a code in response. The list of possible codes is below.

Code

Description

200

OK

400

Incorrect parameters - one of the parameters was not provided

403

Invalid HTTP method - only POST method accepted

405

Server side error

406

The login and/or password are incorrect

408

The username already exists in the system

459USERNAME_ALREADY_ASSIGNED

500

Internal server error

User password

URL/scp.ashx 

The method allows you to set or change the password to log in to the portal.

Authorization
The method requires authorization using basic authentication. Please use your SIP account login and password.

Parameters

Parameter

Description

op

Old password - current password - required only when changing the password

np

New password - the new password

To check whether the user has already set a password, call the method without providing any parameters.

Return value

We will receive a code in response. The list of possible codes is below.

Code

Description

200

OK

400

Incorrect parameters - one of the parameters was not provided

403

Invalid HTTP method - only POST method accepted

437

Password already exist.

438

Password does not exist.

439The new password must be different from the old one.
440Incorrect password - occurs when changing the password when the old password ("op") does not match the current password.

500

Internal server error

Avatar

URL: /avatar.ashx

The method allows you to upload an avatar to the server. It is important to set the enctype="multipart/form-data" attribute when sending via POST.
The server checks the Content-Type header of the sent post. The currently accepted header is image/jpeg
If an invalid header is found, the server will return error code 407.

Call method using HTML - Adding an avatar
<form action="http://127.0.0.1:8080/avatar.ashx" method="POST" enctype="multipart/form-data" name="cform">
 <input type="hidden" name="l" value="1000031">
 <input type="hidden" name="p" value="zre324bhsfc2w34fd">
 <input type="hidden" name="a" value="add">
 <input type="file" name="datafile" size="40">
 <input type="submit" value="Set - Avatar">
</form>
Call method using HTML - Deleting an avatar
<form action="http://127.0.0.1:8080/avatar.ashx" method="POST" name="cform">
 <input type="hidden" name="l" value="1000031">
 <input type="hidden" name="p" value="zre324bhsfc2w34fd">
 <input type="hidden" name="a" value="del">
 <input type="submit" value="Del - Avatar">
</form>
Call method using HTML - Downloading an avatar
<form action="http://127.0.0.1:8080/avatar.ashx" method="POST" name="cform">
 <input type="hidden" name="l" value="1000031">
 <input type="hidden" name="p" value="zre324bhsfc2w34fd">
 <input type="hidden" name="a" value="get">
 <input type="hidden" name="av" value="10000234">
 <input type="submit" value="Get - Avatar">
</form>
Call method using HTML - Sprawdzenie czy ktoś z zapisanych kontaktów zmienił avatara
<form action="http://127.0.0.1:8080/avatar.ashx" method="POST" name="cform">
 <input type="hidden" name="l" value="1000031">
 <input type="hidden" name="p" value="zre324bhsfc2w34fd">
 <input type="hidden" name="a" value="check">
 <input type="hidden" name="ts" value="2011-10-20T20:30:34">
 <input type="submit" value="Check - Avatar">
</form>

Parameter

Description

l

Loginlogin of SIP account 

p

Passwordpassword of SIP account

a

Action - Action type. Accepted parameters:

  • add - adding an avatar
  • del - deleting your avatar
  • get - download avatar
  • check - checking whether any of your saved contacts have changed their avatar

av

Avatar - login of the contact for whom we want to download? avatar

ts

Timespan - maximum time from the local (in the dialer) avatar list - possible to use with the check action

w

Width - maximum image width - optional parameter - can be used with the get action

h

Height - maximum image height - optional parameter - can be used with the get action



In response we will get:

for add action
**in case of error, code (max. 3 digits). Below is the list of possible codes: 
**date? saving the avatar in the UTC+0:00 zone and the YYYY-MM-DDTHH:MM:SS format.

for delete action
**in case of error, code (max. 3 digits). Below is the list of possible codes: 
**date of deleting the avatar in the UTC+0:00 zone and the YYYY-MM-DDTHH:MM:SS format.

for  get action
***in case of error, code (max. 3 digits).. Below is the list of possible codes: 
**file in binary form (if for some reason the file does not exist, the API will return http status 404 - Not Found).


for check action
**in case of error, code (max. 3 digits).. Below is the list of possible codes: 
**list of objects with data about a given avatar, where:

  • l - login - client login
  • ts - timespan - date of saving the avatar in the UTC+0:00 zone and the YYYY-MM-DDTHH:MM:SS format
  • fs - file exists - 1 -file exist, 0 - missing file/file does not exist
Sample list with information about avatars
[
    {
        "l": 1000030,
        "ts": "YYYY-MM-DDTHH:MM:SS",
        "fe": "1"
    },
    {
        "l": 1000033,
        "ts": "2011-10-20T20:30:34",
        "fe": "0"
    }
]

Code

Description

400

Incorrect parameters - one of the parameters was not provided

403

Invalid HTTP method - only POST method accepted

407

Invalid Content-Type header. Currently accepted types are: image/jpeg

411

Invalid file size. Max. file size is 100KB

500

Internal server error

Related content