Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Basic Details
Parameters used in all 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 | Store Secret Key in PersonaClick. Located there: Account > Settings > Store Settings |
string | required if "phone" property doesn't use | Email of the user to be added to the static segment. | |
phone | string | required if "email" property doesn't use | The 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.
Syntax and parametersRequest
codeRequest parameters
Endpoint |
---|
language | js |
---|---|
theme | FadeToGrey |
personaclick("segment", "add", params);
Request Type | Content-Type | |
---|---|---|
https://api.personaclick.com/segments/add | POST | application/x-www-form-urlencoded |
Parameters
Note |
---|
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. |
Name | Type | Description |
---|---|---|
segment_id | number/string |
Segment ID. It's available in the PersonaClick account: CRM > Segments. |
The current user's Phone.
Examples of use
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("segment", "add", {
"segment_id": 100500,
"email": "john.doe@examplestore.com",
"phone": "+10000000000"
});
|
language | js |
---|---|
theme | FadeToGrey |
API Response Code
HTTP status code | Description |
---|---|
200 OK | The request was successful. |
403 Forbidden | The request was unsuccessful. |
404 Not Found | There are no mandatory parameters in the query. |
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
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("segment", "add", {curl 'https://api.personaclick.com/segments/add' \ "segment_id": 100500, -H 'content-type: application/x-www-form-urlencoded' \ "phone": "+10000000000" }); | ||||
Code Block | ||||
| ||||
personaclick("segment", "add", {"segment_id": 100500});-d 'shop_id=0d42fd8b713d0752776ca589cc0056&shop_secret=0123456789abcdef0123456789abcdef&email=john.doe%40examplemail.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 | ||||
---|---|---|---|---|
| ||||
personaclick("segment", "remove", params); |
Name | Type | Requirement | Description |
---|---|---|---|
params | Object | required | Object with request parameters. |
Request parameters
Name | Type | Requirement | Description |
---|---|---|---|
segment_id | number/string | required | Segment ID. It's available in the PersonaClick account: CRM > Segments. |
string | optionally | The current user's Email. | |
phone | string | optionally | The current user's Phone. |
Examples of use
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("segment", "remove", { "segment_id": 100500, "email": "john.doe@examplestore.com", "phone": "+10000000000" }); |
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("segment", "remove", { "segment_id": 100500, "email": "john.doe@examplestore.com" }); |
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("segment", "remove", { "segment_id": 100500, "phone": "+10000000000" }); |
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("segment", "remove", {"segment_id": 100500}); |
Getting the segment list
Method Objective
The method allows getting a list of segments that include the current user.
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("segment", "get", callback); |
Name | Type | Requirement | Description |
---|---|---|---|
callback | Function | required | The callback function that takes the API response. The API response type is an object. |
API response
Type | Description |
---|---|
Object array | Object array, each will have the following properties:
|
Example of use
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("segment", "get", function(segments) { segments.forEach(function(segment) { console.log(segment.id); console.log(segment.type); }); }); |
Table of Contents | ||||
---|---|---|---|---|
|