Versions Compared
Version | Old Version 1 | New Version 2 |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Set App Push Token
Method Objective
The method allows changing the status of the current user's subscriptions to notification channels.
Syntax and parameters
language | js |
---|---|
theme | FadeToGrey |
assigning a new App Push token to the user.
Request
Endpoint | Request Type | Content-Type |
---|---|---|
https://api.personaclick.com/mobile_push_tokens | POST | application/x-www-form-urlencoded |
Parameters
Name | Type | Requirement | Description |
---|
shop_id |
string | required |
Request parameters
The current user's Phone.
Examples of use
language | js |
---|---|
theme | FadeToGrey |
Unique Store Key in PersonaClick. Located there: Account > Settings > Store Settings | |||
did | string | required | Unique Device ID. See "Initialization (REST API)" for information about getting and using Device ID. |
token | string | required | The token is to be assigned to the user. |
platform | string | required | Token platform. Available values:
|
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 | Unsuccessful authorization. |
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("subscription", "manage", {
email: "john.doe@examplestore.com",
email_bulk: true,
email_chain: false,
email_transactional: true,
}); |
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("subscription", "manage", {
phone: "+100000000000",
sms_bulk: false,
sms_chain: false,
sms_transactional: true
}); |
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("subscription", "manage", {
email_transactional: true,
sms_transactional: true
}); |
Push Token
Payloadscurl 'https://api.personaclick.com/mobile_push_tokens' \
-X 'POST' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'shop_id=0d42fd8b713d0752776ca589cc0056&did=7rjVGhMykT&platform=android&token=cCM2SRUF8pO9UaJOqX00wz:APuCScUxcUno1p1Gz6kcV4xux2dnVO1MfEkOen-6fdAlA9JqiTCClKM4Gc6KnUon1bGIbq7o2c03OH-b88vnZmBev7Ho7wAYs3_XOw93YUn5sxNOZ8sq75kjB9UHgoZbbVXrBrWwYhr5' |
Table of Contents | ||||
---|---|---|---|---|
|