User Profile
Get user profile details and update profile details.

Get Profile Details

get
β€Žβ€Ž
https://<domain>/<api prefix>/<version>/user/get/profile/

Sample code

Node
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'https://<domain>/<api prefix>/<version>/user/get/profile/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access-token>',
8
},
9
formData: {}
10
};
11
request(options, function (error, response) {
12
if (error) throw new Error(error);
13
console.log(response.body);
14
});
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => "https://<domain>/<api prefix>/<version>/user/get/profile/",
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => "",
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => "GET",
14
CURLOPT_HTTPHEADER => array(
15
"apikey: <apikey>",
16
"Authorization: Bearer <access-token>"
17
),
18
));
19
​
20
$response = curl_exec($curl);
21
​
22
curl_close($curl);
23
echo $response;
Copied!

Update Profile Details

post
β€Ž
β€Žβ€Žβ€Žβ€Žβ€Žβ€Žβ€Žhttps://<domain>/<api prefix>/<version>/user/update/profile/

Sample code

Node
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://<domain>/<api prefix>/<version>/user/update/profile/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access-token>',
8
},
9
formData: {
10
'first_name': '<first_name>',
11
'last_name': '<last_name>',
12
'email': '<email>',
13
'phone_number': '<phone_number>'
14
}
15
};
16
request(options, function (error, response) {
17
if (error) throw new Error(error);
18
console.log(response.body);
19
});
Copied!

PHP

1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => "https://<domain>/<api prefix>/<version>/user/update/profile/",
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => "",
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => "POST",
14
CURLOPT_POSTFIELDS => array('first_name' => '<first_name>','last_name' => '<last_name>','email' => '<email>','phone_number' => '<phone_number>'),
15
CURLOPT_HTTPHEADER => array(
16
"apikey: <apikey>",
17
"Authorization: Bearer <access-token>"
18
),
19
));
20
​
21
$response = curl_exec($curl);
22
​
23
curl_close($curl);
24
echo $response;
Copied!

Error Responses

Status Code
Error Type
Field
Description
400
Validation Error
email
Enter a valid email address.
This field is required.
400
Validation Error
phone_number
Phone number must be entered in the format: '999999999'. Up to 15 digits allowed.
400
Validation Error
first_name
Ensure this field has no more than 255 characters.
400
Validation Error
last_name
Ensure this field has no more than 255 characters.
400
Validation Error
token_checksum_field
This field is required.
400
Validation Error
token_field
This field is required.
Token is not matching.

Upload profile image

post
β€Žβ€Žβ€Žβ€Ž
https://<domain>/<api prefix>/<version>/user/profile-image/

Sample code

Node
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://<domain>/<api prefix>/<version>/user/profile/profile-image/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access-token>',
8
},
9
formData: {
10
'image': {
11
'value': <image uri>,
12
'options': {
13
'filename': '<image name>',
14
'contentType': null
15
},
16
'cropped_image': {
17
'value': <cropped_image uri>,
18
'options': {
19
'filename': '<cropped_image name>',
20
'contentType': null
21
}
22
}
23
};
24
request(options, function (error, response) {
25
if (error) throw new Error(error);
26
console.log(response.body);
27
});
28
​
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => "https://<domain>/<api prefix>/<version>/user/profile/profile-image/",
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => "",
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 30,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => "POST",
14
CURLOPT_POSTFIELDS => array('image'=> new CURLFILE('<image root path>'), 'cropped_image'=> new CURLFILE('<cropped_image root path>')),
15
CURLOPT_HTTPHEADER => array(
16
"apikey: <apikey>",
17
"Authorization: Bearer <access-token>"
18
),
19
));
20
​
21
$response = curl_exec($curl);
22
​
23
curl_close($curl);
24
echo $response;
Copied!

Error Responses

Status Code
Error Type
Field
Description
400
Validation Error
image
Upload a valid image. The file you uploaded was either not an image or a corrupted image.
400
Validation Error
cropped_image
Upload a valid image. The file you uploaded was either not an image or a corrupted image.
429
Throttled
​
Your daily profile update limit exceeded. Expected available in <HH> hours <M minutes and ss seconds.

Get Local Info

get
β€Ž
https://<domain>/<api prefix>/<version>/get/local-info/

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'https://<domain>/<api prefix>/<version>/get/local-info/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
}
9
};
10
request(options, function (error, response) {
11
if (error) throw new Error(error);
12
console.log(response.body);
13
});
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/get/local-info/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'GET',
14
CURLOPT_HTTPHEADER => array(
15
'apikey: <apikey>',
16
'Authorization: Bearer <access token>'
17
),
18
));
19
​
20
$response = curl_exec($curl);
21
​
22
curl_close($curl);
23
echo $response;
24
​
Copied!
​