User Profile (REST API)

Basic Details

Parameters used in both requests are described here.

Parameters

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequired if "did" isn't usedStore Secret Key in PersonaClick. Located there: Account > Settings > Store Settings
didstringrequired if "shop_secret" isn't usedUnique Device ID. See "Initialization (REST API)" for information about getting and using Device ID.
seancestringrequiredUnique ID of the current user session. See "Initialization (REST API)" for information about getting and using User Session ID.
segmentstringoptionallyCan 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.
refererstringoptionallyRequest 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

EndpointRequest TypeContent-Type
https://api.personaclick.com/profile/setPOSTapplication/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

TypeRequirement

Description

email  

stringoptionally

User Email.

first_namestringoptionallyUser First Name.
genderstringoptionallyUser Gender (m – male, f – female).
idnumber/stringoptionallyStore side user ID.
last_namestringoptionallyUser Surname.
phonestringoptionallyUser Phone.

Additional request parameters

Name

TypeRequirement

Description

agenumberoptionally

User age (in years).

autoObject arrayoptionally

Vehicle data. Available properties:

  • brand - Vehicle Brand. Type: string. 
  • model - Vehicle Model. Type: string.
  • vds - Vehicle's VDS/VIN. Type: string.

See the example below.

birthdaystringoptionally

User birthday in the format YYYYY-MM-DD.

bought_somethingbooleanoptionallyThe user has or hasn't ever bought something in the store.
fb_idstringoptionallyFacebook User ID.
kidsObject arrayoptionally

Children's data. Available properties:

  • gender - Child's age. Type: string ("m" – male, "f" – female).
  • birthday - Child's birthday in the format YYYY-MM-DD. Type: string.

See the example below.

locationstringoptionally

The user's current location from the list of locations in the product feed.

loyalty_bonusesnumberoptionallyThe current number of store bonuses at the user.
loyalty_bonuses_to_next_levelnumberoptionallyThe number of store bonuses necessary for the user to reach the next loyalty level.
loyalty_card_locationstringoptionallyThe location (from the list of locations in the product feed) where the user last used the loyalty card.
loyalty_idstringoptionallyThe Loyalty Program user ID (loyalty card).
loyalty_statusstringoptionallyThe user's current status in the loyalty program.
telegram_idstringoptionallyTelegram User ID.
vk_idstringoptionallyVKontakte User ID.

Custom Properties

NameTypeRequirementDescription
A custom property can have any name except the reserved onesstringoptionally

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 RequestSee the "message" property of the API response for details.
403 ForbiddenSee the "message" property of the API response for details.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

The text of the error if it occurred

payloadObjectReserved 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

EndpointRequest Type
https://api.personaclick.com/profileGET

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:

NameTypeRequirementDescription
emailstringrequiredUser Email
phonestringrequired

Phone Number

loyalty_idstringrequiredUser Loyalty Card ID

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad RequestSee the "message" property of the API response for details.
403 ForbiddenSee 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:

NameTypeDescription
statusstring

Available only in case of an error. Contains the "error" value in this case.

messagestring

Available only in case of an error. Contains a description of the error.

additional_emailsarrayThe array of additional user email addresses.
additional_phonesarrayThe array of additional user phone numbers.
additional_loyalty_idsarrayThe array of additional user loyalty cards.
has_emailbooleanIt shows whether the profile has an email or not.
genderstring

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_genderstringThe calculated value of gender is based on the user's interaction with the products.
custom_propertiesObjectIt contains non-empty custom profile properties created there: Account > Settings > Profile Property
ordersObject array

Each element contains the following properties:

  • id - the Order ID was sent in the "purchase" event of the tracking of user actions
  • status - Order Status
  • value - Order Price
  • items - Object array with the products of the order, where each object has the following properties:
    • id - Product ID
    • name - Product Name (or null)
    • price - Producr Price
    • quantity - Product Quantity
tagsArrayTags 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

EndpointRequest Type
https://api.personaclick.com/orders/last_for_userGET

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 RequestSee the "message" property of the API response for details.
404 Not FoundThe store isn't found.

API Response Data

Each array entry contains an object with the following product properties.

Name

Type

Description

barcodestringProduct barcode, if it was imported in the product catalog
brandstringProduct vendor
categoriesObject arrayObject 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_idsString arrayArray of IDs of the product category hierarchy
currencystringProduct currency (type: string, matches the currency of the PersonaClick account, or the user value set in the settings of the PersonaClick account)
descriptionstringProduct description
discountnumberThe percentage difference between the old price and current price
discount_formattedstringThe percentage difference between the old price and current price that is formatted as a string with the "%" symbol
fashion_colorsObject arrayObject 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_sizesarrayOriginal product sizes
fashion_sizesarrayNormalised product sizes (see XML)
group_idstring

Product group ID

idstringProduct ID
image_urlstringURL of the original product image
image_url_handlestringRelative URL of the original product image
image_url_resizedObjectObject 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_newbooleanNew arrival product (type: boolean). See the parameter in the product catalog import (XML, HTTP API)
leftoversstringRough number of the products left in stock. Available values are: 
"one" - one product
"few" - 2-10 products
"lot" - over 10 products
modelstringModel and product name
namestringProduct name
oldpricenumberInteger old price of the product
oldprice_formattedstringFormatted integer old price of the product, including currency
oldprice_fullnumberOld price of the product
oldprice_full_formattedstringFormatted old price of the product, including currency
paramsObject 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).
pricenumberInteger current price of the product
price_formattedstringFormatted integer current price of the product, including currency
price_fullnumberCurrent price of the product
price_full_formattedstringFormatted current price of the product, including currency
ratingnumberProduct rating
stock_quantitynumberThe available quantity of products
urlstringProduct page URL 
url_handlestringRelative 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

EndpointRequest Type
https://api.personaclick.com/notificationsGET

Parameters

Name

TypeRequirement

Description

shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredStore Secret Key in PersonaClick. Located there: Account > Settings > Store Settings

date_from

stringrequired

Start date of the message history period. Format: YYYY-MM-DD

didstringany 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.

emailstringUser's email address to select a profile
phonestringUser's phone number to select a profile
loyalty_idstringUser's loyalty card to select a profile
external_idstringUser's internal store ID to select a profile
typestringrequiredComma-separated message types from available:
  • bulk
  • chain
  • transactional
channelstringrequiredComma-separated message channels from available:
  • web_push
  • mobile_push
pagenumberoptionallyPage number (first page - 1, by default - 1).
limitnumberoptionallyThe 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 RequestBad request. See the "message" property of the API response for details.
404 Not FoundThe 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

payloadObjectThis contains a "messages" Object Array, where each object has the following properties:
  • "body" – message body (type: string)
  • "campaign_id" – campaign ID (type: number)
  • "code" – message code (type: string)
  • "date" – Date the message was sent in the format: YYYY-MM-DD (type: string)
  • "event" – Extended mobile push payload details (type: Object). Contains the string properties "type" (extended data type) and "uri" (extended data ID). Available values:
    • type: "web", uri: ANY_LINK
    • type: "category", uri: CATEGORY_ID
    • type: "product", uri: PRODUCT_ID
    • type: "custom", uri: CUSTOM_JSON
  • "icon" – Link to the icon in the message (type: string)
  • "picture" – Link to picture in the message (type: string)
  • "sent_at" – Date/time of message sending in the format: YYYY-MM-DDThh:mm:ss.000Z (type: string)
  • "subject" – Message header (type: string)
  • "type" – Message Type. One of the following values: "bulk", "trigger", "transactional" (type: string)
  • "url" – Link from the message (type: string)
  • "statistics" – Message Statistics (type: Object). Contains the following boolean properties: "clicked", "complained", "hard_bounced", "opened", "purchased", "soft_bounced", "unsubscribed"
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestringThe 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

EndpointRequest TypeContent-Type
https://api.personaclick.com/profile/force_change_emailPOSTapplication/json

Parameters

Name

TypeRequirement

Description

shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredStore Secret Key in PersonaClick. Located there: Account > Settings > Store Settings

old_email

stringrequired

Current user email

new_emailstringrequiredNew user email
i_understand_what_i_am_doingstringrequiredAny 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 RequestSee the "message" property of the API response for details.
404 Not FoundThe old email isn't found.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

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

EndpointRequest TypeContent-Type
https://api.personaclick.com/profile/force_change_phonePOSTapplication/json

Parameters

Name

TypeRequirement

Description

shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredStore Secret Key in PersonaClick. Located there: Account > Settings > Store Settings

old_phone

stringrequired

Current user email

new_phonestringrequiredNew user email
i_understand_what_i_am_doingstringrequiredAny 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 RequestSee the "message" property of the API response for details.
404 Not FoundThe old email isn't found.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

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}'

Copyright 2018-2024 PersonaClick