Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This part describes how to get and use the required identifiers.



Request

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

Parameters

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
didstringrequired if previously receivedUnique Device ID. See the API response below.
seancestringrequired if previously received within the current user sessionUnique ID of the current user session. See the API response below.
refererstringoptionallyRequest source URL
tznumberoptionallyThe time zone of the current user
streamstringoptionallyData stream code. Alphanumeric string (letters, numbers only). Max length: 16. The empty default value will mean "web". Can be "ios", "android" or any other string. Used to distinguish between mobile apps, websites, and other events sources.
testmodebooleanoptionallyAllows adding JS snippets that are in test mode status to the API response. See the API response below.

API Response Code

HTTP status code

Description
200 OK

Authentication was successful.

403 ForbiddenAuthentication failed.

API Response Data

NameTypeDescription
didstring

The unique ID of the current device.

Warning

When received, the device ID must be stored on your side or the user's device (in local storage or cookies) and must be used in the future for all requests that require it as a required parameter. Don't request a new Device ID if it has been requested before and is available.


seancestring

Unique ID of the current user session.

Warning

When received, the Session ID must be stored on your side or the user's device (in local storage or cookies) and must be used in all queries requiring it as a required parameter. You need to request a new Session ID every time the user starts a new session or if the ID has been lost for some reason.


snippetsObject Array

Array with JavaScript snippets. Located there: Account > Shared content > JS-snippets

Each object in the array contains properties:

  • code - javascript snippet code
  • name - snippet internal name
  • priority - snippet priority (the higher the value, the higher the priority)
auto_css_recommenderbooleanReserved for the JS SDK internal use
cmsstringReserved for the JS SDK internal use
currencystringReserved for the JS SDK internal use
email_collectorbooleanReserved for the JS SDK internal use
has_emailbooleanReserved for the JS SDK internal use
popupObjectReserved for the JS SDK internal use
recommendationsbooleanReserved for the JS SDK internal use
searchObjectReserved for the JS SDK internal use
viocebooleanReserved for the JS SDK internal use
web_push_settingsObjectReserved for the JS SDK internal use

Request Examples

For the first request for the Device ID and User Session ID.

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/init?shop_id=0d42fd8b713d0752776ca589cc0056'


To update a user's Session ID.

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/init?shop_id=0d42fd8b713d0752776ca589cc0056&did=7rjVGhMykT'


Full example when all IDs have already been received.

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/init?did=7rjVGhMykT&shop_id=0d42fd8b713d0752776ca589cc0056&referer=https%3A%2F%2Fmystore.com%2F&seance=R5eQXkrKCf&tz=3&testmode=true'


Table of Contents
maxLevel2
classpersonaclick-fixed-position