- Created by Andrey Veprikov, last modified on Apr 15, 2024
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 49 Current »
Basic Details
Parameters used in both requests are described here.
Parameters
Name | Type | Requirement | Description |
---|---|---|---|
shop_id | string | required | Unique Store Key in PersonaClick. Located there: Account > Settings > Store Settings |
shop_secret | string | required if "did" isn't used | Store Secret Key in PersonaClick. Located there: Account > Settings > Store Settings |
did | string | required if "shop_secret" isn't used | Unique Device ID. See "Initialization (REST API)" for information about getting and using Device ID. |
seance | string | required | Unique ID of the current user session. See "Initialization (REST API)" for information about getting and using User Session ID. |
segment | string | optionally | Can take one of the values: "A" or "B" according to the segment to which the user is assigned. You can use your algorithm to divide users evenly between the segments. |
referer | string | optionally | Request source URL |
Update User Profile
Method Objective
The method updates the user's profile or creates a new profile bound to the user's current device if it was not created earlier.
If you don't have user data, never send bogus data. It'll cause problems in profile handling in the future. For example, don't send a non-existent email, like anonymous@example.com
, or an automatically generated email address that doesn't have anything to do with the user's actual email.
Request
Endpoint | Request Type | Content-Type |
---|---|---|
https://api.personaclick.com/profile/set | POST | application/json |
Parameters
Only parameters related to the profile update request are listed here. See "Basic Details" above for more information on required parameters and the API endpoint.
Main request parameters
Name | Type | Requirement | Description |
---|---|---|---|
string | optionally | User Email. | |
first_name | string | optionally | User First Name. |
gender | string | optionally | User Gender (m – male, f – female). |
id | number/string | optionally | Store side user ID. |
last_name | string | optionally | User Surname. |
phone | string | optionally | User Phone. |
Additional request parameters
Name | Type | Requirement | Description |
---|---|---|---|
age | number | optionally | User age (in years). |
auto | Object array | optionally | Vehicle data. Available properties:
See the example below. |
birthday | string | optionally | User birthday in the format YYYYY-MM-DD. |
bought_something | boolean | optionally | The user has or hasn't ever bought something in the store. |
fb_id | string | optionally | Facebook User ID. |
kids | Object array | optionally | Children's data. Available properties:
See the example below. |
location | string | optionally | The user's current location from the list of locations in the product feed. |
loyalty_bonuses | number | optionally | The current number of store bonuses at the user. |
loyalty_bonuses_to_next_level | number | optionally | The number of store bonuses necessary for the user to reach the next loyalty level. |
loyalty_card_location | string | optionally | The location (from the list of locations in the product feed) where the user last used the loyalty card. |
loyalty_id | string | optionally | The Loyalty Program user ID (loyalty card). |
loyalty_status | string | optionally | The user's current status in the loyalty program. |
telegram_id | string | optionally | Telegram User ID. |
vk_id | string | optionally | VKontakte User ID. |
Custom Properties
Name | Type | Requirement | Description |
---|---|---|---|
A custom property can have any name except the reserved ones | string | optionally | The custom property must be created before it can be used. Located there: Account > Settings > Profile Property If property creation isn't available in the account, contact PersonaClick support. |
integer | |||
float | |||
array of string | |||
json | |||
date (YYYY-MM-DD hh:mm:ss) |
API Response Code
HTTP status code | Description |
---|---|
200 OK | The request was successful. |
400 Bad Request | See the "message" property of the API response for details. |
403 Forbidden | See the "message" property of the API response for details. |
API Response Data
The response is JSON type with the following properties:
Name | Type | Description |
---|---|---|
status | string | Current status. Can have one of two values:
|
message | string | The text of the error if it occurred |
payload | Object | Reserved for the JS SDK internal use |
Request Example
curl 'https://api.personaclick.com/profile/set' \ -X 'POST' \ -H 'content-type: application/json' \ -d '{"id":100500,"email":"john.doe@examplemail.com","phone":"4400114527199","first_name":"John","last_name":"Doe","birthday":"1990-03-11","age":31,"gender":"m","location":"NY","bought_something":true,"loyalty_id":"000001234567","loyalty_card_location":"NY","loyalty_status":"5% discount","loyalty_bonuses":1123,"loyalty_bonuses_to_next_level":1877,"fb_id":"000000000354677","vk_id":"vk031845","telegram_id":"0125762968357835","kids":[{"gender":"m","birthday":"2001-04-12"},{"gender":"f","birthday":"2015-07-28"}],"auto":[{"brand":"Nissan","model":"Qashqai","vds":"TM7N243E4G0BJG978"}],"custom_string_property":"the string value of the custom property","custom_integer_property":100500,"custom_float_property":7.62,"custom_array_of_string_property":["value1","value2","value3"],"custom_json_property":{"key1":"value1","key2":"value2","key3":"value3"},"custom_date_property":"2021-12-31 23:55:00","shop_id":"0d42fd8b713d0752776ca589cc0056","seance":"R5eQXkrKCf","shop_secret":"0123456789abcdef0123456789abcdef"}'
Read User Profile
Method Objective
The method returns full profile data of the current user.
Request
Endpoint | Request Type |
---|---|
https://api.personaclick.com/profile | GET |
Parameters
Only parameters related to the profile read request are listed here. See "Basic Details" above for more information on required parameters and the API endpoint.
The parameters below can only be used in conjunction with the "shop_secret" parameter (see "Basic Details" above). When using the "did" parameter, all parameters listed below are ignored.
Any of the parameters below can be used to obtain profile properties:
Name | Type | Requirement | Description |
---|---|---|---|
string | required | User Email | |
phone | string | required | Phone Number |
loyalty_id | string | required | User Loyalty Card ID |
API Response Code
HTTP status code | Description |
---|---|
200 OK | The request was successful. |
400 Bad Request | See the "message" property of the API response for details. |
403 Forbidden | See the "message" property of the API response for details. |
API Response Data
All properties available for saving in the profile are available for reading. See properties of the profile update method above.
Additionally, the following properties can be got:
Name | Type | Description |
---|---|---|
status | string | Available only in case of an error. Contains the "error" value in this case. |
message | string | Available only in case of an error. Contains a description of the error. |
additional_emails | array | The array of additional user email addresses. |
additional_phones | array | The array of additional user phone numbers. |
additional_loyalty_ids | array | The array of additional user loyalty cards. |
has_email | boolean | It shows whether the profile has an email or not. |
gender | string | The gender of the current user. If not forced by the "Update User Profile" method, it has the same value as the "computed_gender" property (see below). |
computed_gender | string | The calculated value of gender is based on the user's interaction with the products. |
custom_properties | Object | It contains non-empty custom profile properties created there: Account > Settings > Profile Property |
orders | Object array | Each element contains the following properties:
|
tags | Array | Tags that were created there: Account > Settings > User tags, and assigned to the user on the profile page manually. |
Request Example
curl https://api.personaclick.com/profile?email=john.doe@examplemail.com&shop_id=0d42fd8b713d0752776ca589cc0056&shop_secret=0123456789abcdef0123456789abcdef
Get Last Order Products
Method Objective
The method allows getting product data from the user's last order.
Request
Endpoint | Request Type |
---|---|
https://api.personaclick.com/orders/last_for_user | GET |
Parameters
See "Basic Details" above for more information on required parameters and the API endpoint.
API Response Code
HTTP status code | Description |
---|---|
200 OK | The request was successful. |
400 Bad Request | See the "message" property of the API response for details. |
404 Not Found | The store isn't found. |
API Response Data
Each array entry contains an object with the following product properties.
Name | Type | Description |
---|---|---|
barcode | string | Product barcode, if it was imported in the product catalog |
brand | string | Product vendor |
categories | Object array | Object array with details of the product category hierarchy, where each object has properties: "id" – category ID (type: string) "name" – category name (type: string) "parent" – parent category ID (type: string) "url" – category page url (type: string) |
category_ids | String array | Array of IDs of the product category hierarchy |
currency | string | Product currency (type: string, matches the currency of the PersonaClick account, or the user value set in the settings of the PersonaClick account) |
description | string | Product description |
discount | number | The percentage difference between the old price and current price |
discount_formatted | string | The percentage difference between the old price and current price that is formatted as a string with the "%" symbol |
fashion_colors | Object array | Object array with details of the product category hierarchy, where each object has properties: "color" – product color (type: string) "picture" – color-matched product image (type: string) |
fashion_original_sizes | array | Original product sizes |
fashion_sizes | array | Normalised product sizes (see XML) |
id | string | Product ID |
image_url | string | URL of the original product image |
image_url_handle | string | Relative URL of the original product image |
image_url_resized | Object | Object with the URLs of the resize product image. Available object keys matching the size of the image in pixels: 120, 140, 160, 180, 200, 220, 310, 520 |
is_new | boolean | New arrival product (type: boolean). See the parameter in the product catalog import (XML, HTTP API) |
leftovers | string | Rough number of the products left in stock. Available values are: "one" - one product "few" - 2-10 products "lot" - over 10 products |
model | string | Model and product name |
name | string | Product name |
oldprice | number | Integer old price of the product |
oldprice_formatted | string | Formatted integer old price of the product, including currency |
oldprice_full | number | Old price of the product |
oldprice_full_formatted | string | Formatted old price of the product, including currency |
params | Object array | Object array with pairs of "key" (type: string), "values" (type: array) properties. The data matches the values of the "param" parameter of the product feed/catalog (XML, HTTP API). |
price | number | Integer current price of the product |
price_formatted | string | Formatted integer current price of the product, including currency |
price_full | number | Current price of the product |
price_full_formatted | string | Formatted current price of the product, including currency |
rating | number | Product rating |
stock_quantity | number | The available quantity of products |
url | string | Product page URL |
url_handle | string | Relative product page URL |
Request Example
curl https://api.personaclick.com/orders/last_for_user?shop_id=0d42fd8b713d0752776ca589cc0056&did=vxlwRZ7Cnk
Get Last Messages
Method Objective
The method allows getting the details of messages.
Request
Endpoint | Request Type |
---|---|
https://api.personaclick.com/notifications | GET |
Parameters
Name | Type | Requirement | Description |
---|---|---|---|
shop_id | string | required | Unique Store Key in PersonaClick. Located there: Account > Settings > Store Settings |
shop_secret | string | required | Store Secret Key in PersonaClick. Located there: Account > Settings > Store Settings |
date_from | string | required | Start date of the message history period. Format: YYYY-MM-DD |
did | string | any of the listed are required | Unique Device ID. See "Initialization (REST API)" for information about getting and using Device ID. It has priority over other IDs when used concurrently. |
string | User's email address to select a profile | ||
phone | string | User's phone number to select a profile | |
loyalty_id | string | User's loyalty card to select a profile | |
external_id | string | User's internal store ID to select a profile | |
type | string | required | Comma-separated message types from available:
|
channel | string | required | Comma-separated message channels from available:
|
page | number | optionally | Page number (first page - 1, by default - 1). |
limit | number | optionally | The number of rows in the API response (by default - 20, maximum - 50). |
API Response Code
HTTP status code | Description |
---|---|
200 OK | The request was successful. |
400 Bad Request | Bad request. See the "message" property of the API response for details. |
404 Not Found | The store or profile isn't found. See the "message" property of the API response for details. |
API Response Data
Each array entry contains an object with the following campaign properties
Name | Type | Description |
---|---|---|
payload | Object | This contains a "messages" Object Array, where each object has the following properties:
|
status | string | Current status. Can have one of two values:
|
message | string | The text of the error if it occurred |
Request Example
curl https://api.personaclick.com/notifications?shop_id=0d42fd8b713d0752776ca589cc0056&shop_secret=0123456789abcdef0123456789abcdef&date_from=2023-07-01&email=john.doe@examplemail.com&type=bulk,trigger,transactional&channel=web_push,mobile_push
Forced Email Change
Method Objective
The method allows forcing a change of email in the user's profile.
Request
Endpoint | Request Type | Content-Type |
---|---|---|
https://api.personaclick.com/profile/force_change_email | POST | application/json |
Parameters
Name | Type | Requirement | Description |
---|---|---|---|
shop_id | string | required | Unique Store Key in PersonaClick. Located there: Account > Settings > Store Settings |
shop_secret | string | required | Store Secret Key in PersonaClick. Located there: Account > Settings > Store Settings |
old_email | string | required | Current user email |
new_email | string | required | New user email |
i_understand_what_i_am_doing | string | required | Any value means understanding and agreeing to comply with the request |
API Response Code
HTTP status code | Description |
---|---|
200 OK | The request was successful. |
400 Bad Request | See the "message" property of the API response for details. |
404 Not Found | The old email isn't found. |
API Response Data
The response is JSON type with the following properties:
Name | Type | Description |
---|---|---|
status | string | Current status. Can have one of two values:
|
message | string | The text of the error if it occurred |
Request Example
curl 'https://api.personaclick.com/profile/force_change_email' \ -X 'POST' \ -H 'content-type: application/json' \ -d '{"shop_id":"0d42fd8b713d0752776ca589cc0056","shop_secret":"0123456789abcdef0123456789abcdef","new_email":"john.doe@examplemail.com","old_email":"john@examplemail.com","i_understand_what_i_am_doing":true}'
Forced Phone Change
Method Objective
The method allows forcing a change of phone in the user's profile.
Request
Endpoint | Request Type | Content-Type |
---|---|---|
https://api.personaclick.com/profile/force_change_phone | POST | application/json |
Parameters
Name | Type | Requirement | Description |
---|---|---|---|
shop_id | string | required | Unique Store Key in PersonaClick. Located there: Account > Settings > Store Settings |
shop_secret | string | required | Store Secret Key in PersonaClick. Located there: Account > Settings > Store Settings |
old_phone | string | required | Current user email |
new_phone | string | required | New user email |
i_understand_what_i_am_doing | string | required | Any value means understanding and agreeing to comply with the request |
API Response Code
HTTP status code | Description |
---|---|
200 OK | The request was successful. |
400 Bad Request | See the "message" property of the API response for details. |
404 Not Found | The old email isn't found. |
API Response Data
The response is JSON type with the following properties:
Name | Type | Description |
---|---|---|
status | string | Current status. Can have one of two values:
|
message | string | The text of the error if it occurred |
Request Example
curl 'https://api.personaclick.com/profile/force_change_phone' \ -X 'POST' \ -H 'content-type: application/json' \ -d '{"shop_id":"0d42fd8b713d0752776ca589cc0056","shop_secret":"0123456789abcdef0123456789abcdef","new_phone":"440005551122","old_phone":"449995550000","i_understand_what_i_am_doing":true}'
Page Navigation
Related Pages
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
- No labels