Versions Compared

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

Code Block
languagejs
themeFadeToGrey
personaclick("subscription", "manage", params);

assigning a new App Push token to the user.

Request

EndpointRequest TypeContent-Type
https://api.personaclick.com/mobile_push_tokensPOSTapplication/x-www-form-urlencoded

Parameters

NameTypeRequirementDescription
params
shop_id
Object
stringrequired
Object with request parameters.

Request parameters

NameTypeRequirementDescriptionemailstringoptionallyThe current user's Email.phonestringoptionally

The current user's Phone.

email_bulkbooleanoptionallyIt changes the current user's subscription status to bulk email campaigns.email_chainbooleanoptionallyIt changes the current user's subscription status to triggered email campaigns.email_transactionalbooleanoptionallyIt changes the current user's subscription status for transactional email campaigns.sms_bulkbooleanoptionallyIt changes the current user's subscription status to bulk SMS campaigns.sms_chainbooleanoptionallyIt changes the current user's subscription status to triggered SMS campaigns.sms_transactionalbooleanoptionallyIt changes the current user's subscription status for transactional SMS campaigns.

Examples of use

Code Block
languagejs
themeFadeToGrey
personaclick("subscription", "manage", { email: "john.doe@examplestore.com", phone: "+100000000000", email_bulk: true, email_chain: true, email_transactional: true, sms_bulk: true, sms_chain: true, sms_transactional: true });
Unique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
didstringrequiredUnique Device ID. See "Initialization (REST API)" for information about getting and using Device ID.
tokenstringrequiredThe token is to be assigned to the user.
platformstringrequired

Token platform. Available values:

  • android
  • ios

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 ForbiddenUnsuccessful authorization.

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("subscription", "manage", {
    email: "john.doe@examplestore.com",
    email_bulk: true,
    email_chain: false,
    email_transactional: true,
});
Code Block
languagejs
themeFadeToGrey
personaclick("subscription", "manage", {
    phone: "+100000000000",
    sms_bulk: false,
    sms_chain: false,
    sms_transactional: true
});
Code Block
languagejs
themeFadeToGrey
personaclick("subscription", "manage", {
    email_transactional: true,
    sms_transactional: true
});

Push Token

Payloads
curl '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
maxLevel3
classpersonaclick-fixed-position