Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
maxLevel2classpersonaclick-fixed-position

Basic Details

Parameters used in all requests are described here.

Parameters

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredStore Secret Key in PersonaClick. Located there: Account > Settings > Store Settings
emailstringrequired if "phone" property doesn't useEmail of the user to be added to the static segment.
phonestringrequired if "email" property doesn't useThe phone number of the user to be added to the static segment.


Adding to a segment

Method Objective

The method allows adding the current user to a segment.

Request

EndpointRequest TypeContent-Type
https://api.personaclick.com/segments/addPOSTapplication/
x-www-form-urlencoded
json

Parameters

Note

Only parameters related to the profile update request request for the adding user to the segment are listed here. See "Basic Details" above for more information on required parameters and the API endpoint.


Name

Type

Description

segment_id

number/string

Segment ID. It's available in the PersonaClick account: CRM > Segments.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

403 ForbiddenThe request was unsuccessful.
404 Not FoundThere are no mandatory parameters in the
query
request.

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

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/segments/add' \
  -X 'POST' \
  -H 'content-type: application/x-www-form-urlencodedjson' \
  -d '{"shop_id=0d42fd8b713d0752776ca589cc0056&":"0d42fd8b713d0752776ca589cc0056","shop_secret=0123456789abcdef0123456789abcdef&email=john.doe%40examplemail.com&phone=4400114527199&segment_id=100500":"0123456789abcdef0123456789abcdef","email":"john.doe@examplemail.com","phone":"4400114527199","segment_id":100500}'


Removing from a segment

Method Objective

The method allows excluding the current user from a segment.

Syntax and parameters

Code Block
languagejs
themeFadeToGrey
personaclick("segment", "remove", params);
NameTypeRequirementDescriptionparamsObjectrequiredObject with request parameters.

Request parameters

NameTypeRequirementDescriptionsegment_idnumber/stringrequiredSegment ID. It's available in the PersonaClick account: CRM > Segments.emailstringoptionallyThe current user's Email.phonestringoptionally

The current user's Phone.

Examples of use

Request

EndpointRequest TypeContent-Type
https://api.personaclick.com/segments/removePOSTapplication/json

Parameters

Note

Only parameters related to the request for the removing user from the segment are listed here. See "Basic Details" above for more information on required parameters.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

403 ForbiddenThe request was unsuccessful.
404 Not FoundThere are no mandatory parameters in the request.

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

Code Block
languagejs
themeFadeToGrey
personaclick("segment", "remove", {curl 'https://api.personaclick.com/segments/remove' \
  -X  "segment_id": 100500,
    "email": "john.doe@examplestore.com",
    "phone": "+10000000000"
});
Code Block
languagejs
themeFadeToGrey
personaclick("segment", "remove", {
    "segment_id": 100500,
    "email": "john.doe@examplestore.com"
});
Code Block
languagejs
themeFadeToGrey
personaclick("segment", "remove", {
    "segment_id": 100500,
    "phone": "+10000000000"
});
Code Block
languagejs
themeFadeToGrey
personaclick("segment", "remove", {"segment_id": 100500});'POST' \
  -H 'content-type: application/json' \
  -d '{"shop_id":"0d42fd8b713d0752776ca589cc0056","shop_secret":"0123456789abcdef0123456789abcdef","email":"john.doe@examplemail.com","phone":"4400114527199","segment_id":100500}'



Getting the segment list

Method Objective

The method allows getting a list of segments that include the current user.

Request

Syntax and parameters

Code Block
languagejs
themeFadeToGrey
personaclick("segment", "get", callback);
NameTypeRequirementDescriptioncallbackFunctionrequiredThe callback function that takes the API response. The API response type is an object.

API response

Description
TypeEndpointRequest Type
https://api.personaclick.com/segments/getGET

Parameters

Note

See "Basic Details" above for more information on required parameters.


Name

Type

Description

segment_id

number/string

Segment ID. It's available in the PersonaClick account: CRM > Segments.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

403 ForbiddenThe request was unsuccessful.
404 Not FoundThere are no mandatory parameters in the request.

API Response Data

The response is JSON type with the following properties:

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.

(has no name)Object array

Object array , each will have with the following properties:

  • id (number) - the Segment segment ID.
  • type (string) - the Segment Type. It - segment type, can have one of the following values: dynamic, static, dynamicrfm.

Request Example

of use

Code Block
languagejs
themeFadeToGrey
personaclick("segment", "get", function(segments) {
    segments.forEach(function(segment) {
        console.log(segment.id);
        console.log(segment.type);
    });
});

Table of Contents
curl 'https://api.personaclick.com/segments/get?shop_id=0d42fd8b713d0752776ca589cc0056&shop_secret=0123456789abcdef0123456789abcdef&email=john.doe%40examplemail.com'



Column

Page Navigation

Table of Contents
maxLevel1
indent0px
stylenone




Related Pages

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
cqllabel = "segments"