Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guide iconUser guide
Developer guide iconDeveloper guide
Admin guide iconAdmin guide
English
  • Русский
  • English
Login
    User documentationGetting StartedFAQAltcraft glossary
      Profiles and databasesarrow
    • Subscription resourcesManaging databasesSubscriber profileProfiles import and data updateCommon Errors When Importing ProfilesScheduled customer data importManaging Data TablesAutomatic data collectionBulk customers profiles updateDouble opt-in subscriptionSuppression listsProfile relationsProfile history exportProfile exportCreating a static segment based on import resultsHow to open a CSV fileMatchingTypes of fields in the databaseGlobal control groupsSubscription Manager
      Communication channelsarrow
      • Email channelarrow
      • Email: ISP interactions best practices
          First mailingarrow
        • Quick StartEmail
        Email: sending domain configurationEmail: setting up and using postmasters
        Push Channelarrow
        • Mobile Pusharrow
        • First Mobile Push MailingНастройка и подключение
            Провайдеры Mobile Pusharrow
          • Apple Push Notification ServiceYandex.AppMetricaFirebase Cloud MessagingHuawei Mobile ServicesRuStore
            Integrate your app with Altcraftarrow
          • Обработка и добавление подпискиРегистрация событийПровайдеры: структура push-сообщения
          Web Pusharrow
        • First Web Push MailingResource and Website Setup
            Web Push Providersarrow
          • Firebase Cloud messagingApple SafariMozilla Services
          Transferring Data to the PlatformWeb Push SDK MethodsPWA and Push Notifications
            Migration and Subscription Transferarrow
          • Migrating push subscriptions from third-party servicesHow to transfer push subscriptions configured for Safari?Migration from OneSignal
        SMS channelarrow
      • SMS
      WhatsAppViber*™
        Telegramarrow
      • Telegram BotTelegram Group
        Maxarrow
      • MAX BotMAX Group
      NotifyCommunication Channels WorkflowРуководство: SMS-рассылка через VK NotifyРуководство: SMS-рассылка через УТШРуководство: push-рассылка через сервис от "Согласие"
      Segmentationarrow
    • Static SegmentsDynamic SegmentsUpdatable Segments
        Segmentation Conditionsarrow
      • Segmentation by Profile dataSegmentation by Interactions with EntitiesSegmentation by Activity of the channelSegmentation by external dataSegmentation by external SQL tablesSegmentation by Profile structure
      Best Send Time (BST)Logical operators "AND" and "OR"Recommendations for working with segments
      Message templatesarrow
      • Working with message templatesarrow
      • Working in the editorEmail templateSMS templatePush templateMAX templateTelegram templateWhatsApp templateViber templateNotify template
        Visual editor for email-templatearrow
      • Visual editor interfaceAdding blocksElements and their settingsCustom blocksStyle managerLayer manager
      Template fragmentsImage galleryContent personalizationCreating tables based on array elementsBlock editor for email template
        Altcraft Variables and Functionsarrow
      • Logical expressions in messagesLoops in messagesMarket variables in templatesUsing the JSONPath functionality
        Dynamic content in messagesarrow
      • Dynamic HTML contentDynamic JSON contentContent from SQL database in templatesDynamic API content
      Importing and exporting a message templateImporting a template from a third-party serviceExporting a template from Pixcraft
      Mailingsarrow
    • Mailings calendarBroadcast mailingsRegular mailingTrigger mailingMultivariate testingMailing testingMailing schedulePlacement mailing
      Automation scenariosarrow
    • Managing scenariosNodes of the scenarioClassic marketing scenariosStep-by-step welcome scenario guideScenario for automatic notification of the managerAbandoned cart scenario
      Marketarrow
    • Market settings
        Productsarrow
      • How to create a product manuallyHow to import a product from a fileScheduled product importProduct and SKU SegmentsPreparing the YML file
      OrdersMarket variables in message templateGuide: how to send an order confirmation email
      Loyalty programsarrow
    • Loyalty programsLoyalty integration with external systemsCreating a loyalty program from scratchBasic loyalty program use casesOrder SegmentsPromotion codes
      Reports and analyticsarrow
    • Channel reportTraffic report
        Summary reportarrow
      • Summary report metrics
      Cohorts reportLifetime reportFunnels reportGoals reportAudience growth reportClick map reportLoyalty programs reportBounces reportUndeliveries reportReport on global control groups
      Integrationsarrow
      • Action hooksarrow
      • Altcraft Action HooksAction hooks event typesAction Hook Message StructureJSON batch request (HTTP POST action hook)Message to RabbitMQ brokerMessage to RabbitMQ exchangerMessage to Kafka brokerTest event
        Integration of third-party services using Albatoarrow
      • Connecting Altcraft to Albato Launching the welcome scenario using AlbatoTransmitting event dataSetting up a trigger mailingEvent registrationGoogle Sheets and Altcraft integration AmoCRM and Altcraft integration
      Facebook Ads Manager™Google Ads AudiencesMAXYandex.Audience™VK AdsStatic segment synchronizationYandex AppMetrica™Tilda™Lpgenerator™WhatsAppViber integrationIntegration scopeData Transmitted During SynchronizationNotify
      Weblayersarrow
      • Formsarrow
        • Create a formarrow
        • General settingsForm constructorAppearanceActions and form publicationConditional logic in forms and surveys
        Data analyticsBinding data channel and formsNPS testing
        Pixelsarrow
      • Goal customer actions and scoring
        Pop-upsarrow
      • Creating and publishing a pop-upSetting up a popup in the code editorManaging pop-ups manually via scriptPopup analyticsGuide: pop-up for push subscriptionsCase: Creating a pop-up with the "Wheel of Fortune" widgetBasic cases of placing a popup via the Tag Manager
        Tag Managerarrow
      • Configuring and installing Tag ManagerTrigger typesVariable typesLinking a pixel and the Tag manager
      Settingsarrow
    • Account settingsCustom linksVirtual sendersSending policiesAudit journalTags FAQ
        Users, groups and accessarrow
      • Two-Factor Authentication (2FA)
        Connectionsarrow
      • Connection to Facebook Ads ManagerConnection to Google AdsConnecting to Yandex.Audience™Connection to 360dialogConnection to EdnaConnection to Devino TelecomConnection to SMSTrafficConnection to VK Ads™Connection to MTS OmniChannelCustom Authentication ConnectionOAuth2 connectionBasic Authentication connectionToken Authentication connectionConnection to RapportoMAX connectionConnection to Notify
      Attribute settings
      API requests: where to startarrow
    • Import or update a profileTrigger mailing launchEngage profile in scenario
      Changelogarrow
    • v2026.2.77v2026.1.76v2025.4.75v2025.4.74v2025.3.73v2025.2.72v2025.1.71v2024.4.70v2024.3.69v2024.2.68.2v2024.1.68
    Documentation archiveEmail Marketer's Library
      Campaignsarrow
    • Working with CampaignsLocal control groups (LCG)Stratification Violation ErrorAudience expansionAudience building
  • Communication channels
  • Push Channel
  • Mobile Push
  • Integrate your app with Altcraft
  • Обработка и добавление подписки

Обработка и добавление подписки

При получении push токена приложение должно передать его в Altcraft Platform для формирования подписки. Для этого используется API запрос.

С помощью этого запроса можно:

  • Добавить новые подписки.
  • Поменять статус уже существующих подписок.

Режим поиска профиля можно задавать с помощью поля matching в запросе (см. спецификацию ниже). Если профиль не будет найден, то будет создан новый.

При этом, если в ресурсе указано несколько баз данных, то все они будут обрабатываться по отдельности. Запрос к такому ресурсу будет создавать и обновлять профили сразу в нескольких базах. Пример такого случая можно посмотреть ниже.

Если в ресурсе нет ни одной базы, то будет возвращена ошибка.

URL-адрес​

Метод: POST

https://<cookiesaver_host>/push_subscribe

Параметры запроса​

ПараметрТипПримерОбязательныйОписание
idstring"abcdefghijklmnqrstuvwxyz"НетИдентификатор профиля
resource_tokenstring"abcdefghijklmnqrstuvwxyz"ДаУникальный идентификатор ресурса
db_ids[ ] int[ 2,3 ]НетФильтр баз данных ресурса.
matchingstring"custom"НетРежим поиска подписчика.
Если поле не передано или пустое, то будет использован поиск профиля по id или, если id тоже не передано, по пуш подпискам.

Для push_subscribe метода это поле может принимать только следующие значения:
  • custom
  • profile_id
subscriptionsJSON array
SubscriptionObject
[{
"provider" : "android-firebase",
"subscription_id" : "%subscriptionid%"
}]
ДаПодписки на push, которые нужно добавить в профиль или обновить.
"subscription_id" — уникален для каждого устройства.

SubscriptionObject​

ПараметрТипПримерОбязательныйОписание
providerstring"android-firebase"ДаИдентификатор провайдера в Altcraft MP.
Возможны следующие значения:
  • android-firebase
  • ios-firebase
  • ios-apns
  • yandex-Appmetrica-device-id-ios
  • yandex-Appmetrica-device-id-android
  • yandex-Appmetrica-ios-ifa
  • yandex-Appmetrica-google-aid
  • yandex-Appmetrica-android-token
  • yandex-Appmetrica-ios-token
  • android-huawei
  • ios-huawei

Каждому типу токена в AppMetrica соответствует свой id провайдера.
subscription_idstring"abcdef-ghijklmn-qrstuvwxyz"ДаТокен push подписки
unsubscribeboolfalseНетФлаг отписки. Отменяет подписку, если true.

Возвращаемые параметры​

ПараметрТипОписание
dataJSON array
DataObject
Информация о созданных подписках.

В массиве может быть несколько объектов в следующих случаях:
  • В запросе было передано несколько SubscriptionObject
  • В ресурсе Altcraft MP используется несколько баз данных. В этом случае для каждой базы из ресурса добавится новый профиль с подписками.
errorintКод ошибки
error_textstringТекст ошибки

DataObject​

ПараметрТипОписание
subscription_idstring"abcdef-ghijklmn-qrstuvwxyz"Токен push подписки
unsubscribeboolfalseФлаг, была ли подписка добавлена или наоборот отменена
profile_idstring"5fb62e815ae47a4aa04dfadd"id профиля (переданный или вновь созданный), для которого добавлена подписка.
providerstring"android-firebase"Идентификатор провайдера в Altcraft MP.
Возможны следующие значения:
  • android-firebase
  • ios-firebase
  • ios-apns
  • yandex-Appmetrica-device-id-ios
  • yandex-Appmetrica-device-id-android
  • yandex-Appmetrica-ios-ifa
  • yandex-Appmetrica-google-aid
  • yandex-Appmetrica-android-token
  • yandex-Appmetrica-ios-token
  • android-huawei
  • ios-huawei

Каждому типу токена в AppMetrica соответствует свой id провайдера
db_idint2id базы данных в Altcraft MP, в которой находится профиль
resource_idint1id ресурса в Altcraft MP
subscription_hash_idstring"92807e89"Хеш подписки
statusstring"error"Статус операции
  • ok
  • error
descriptionstring"Duplicate push subscription"Описание ошибки

Импорт из файла​

Push-токены можно импортировать не только через API, но и из CSV-файла через интерфейс платформы. Такой способ удобен, если нужно массово добавить уже собранные токены без доработки мобильного приложения или серверной интеграции.

При импорте указывается провайдер push-уведомлений, например android-firebase, ios-apns или другой поддерживаемый провайдер. Загруженные токены будут добавлены как push-подписки к профилям.

Перед импортом подготовьте CSV-файл с данными для поиска профиля и токенами подписок. Профили могут сопоставляться по доступным идентификаторам, например по системному id профиля или дополнительному полю.

info

Перед импортом проверьте, что в ресурсе настроены нужные базы данных и выбран корректный провайдер подписки. Если токен передан с неверным провайдером, push-уведомления по такой подписке не будут отправляться корректно.

Примеры​

Запрос с матчингом по системному id профиля​

Запрос

{
"id": "59db33d269d426509e9c4bf9",
"resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
"subscriptions": [
{
"provider": "android-firebase",
"subscription_id": "%subscriptionid%"
}
]
}

Ответ

{
"data": [
{
"subscription_id": "%subscriptionid%",
"unsubscribe": false,
"profile_id": "59db33d269d426509e9c4bf9",
"provider": "android-firebase",
"db_id": 17,
"resource_id": 5,
"subscription_hash_id": "adsfdfdffdf",
"status": "ok",
"description": ""
}
],
"error": 0,
"error_text": "Successful operation"
}

Запрос с матчингом по дополнительному полю профиля​

Запрос

{
"resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
"matching": "custom",
"field_name": "CustomNumber1",
"field_value": 123,
"subscriptions": [
{
"provider": "android-firebase",
"subscription_id": "%subscriptionid%"
}
]
}

Ответ

{
"data": [
{
"subscription_id": "%subscriptionid%",
"unsubscribe": false,
"profile_id": "59db33d269d426509e9c4bfс",
"provider": "android-firebase",
"db_id": 17,
"resource_id": 5,
"subscription_hash_id": "adsfdfdffdf",
"status": "ok",
"description": ""
}
],
"error": 0,
"error_text": "Successful operation"
}

Запрос с матчингом по push-подпискам​

Запрос

{
"resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
"subscriptions": [
{
"provider": "android-firebase",
"subscription_id": "%subscriptionid%"
}
]
}

Ответ

{
"data": [
{
"subscription_id": "%subscriptionid%",
"unsubscribe": false,
"profile_id": "59db33d269d426509e9c4bfa",
"provider": "android-firebase",
"db_id": 17,
"resource_id": 5,
"subscription_hash_id": "adsfdfdffdf",
"status": "ok",
"description": ""
}
],
"error": 0,
"error_text": "Successful operation"
}

Запрос к ресурсу с несколькими базами данных​

Запрос

{
"resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
"matching": "custom",
"field_name": "CustomNumber1",
"field_value": 12345,
"subscriptions": [
{
"provider": "android-firebase",
"subscription_id": "%subscriptionid%"
}
]
}

Ответ

{
"error": 200,
"error_text": "Successful operation",
"data": [
{
"db_id": 34,
"description": "",
"profile_id": "6156ed18eb7fec10a206e916",
"provider": "android-firebase",
"resource_id": 22,
"status": "ok",
"subscription_hash_id": "340ca49c",
"subscription_id": "%subscriptionid%",
"unsubscribe": false
},
{
"db_id": 2,
"description": "matching error: unknown field",
"resource_id": 22,
"status": "error"
}
]
}

Запрос с матчингом по дополнительному полю профиля в определенной базе​

Запрос

{
"resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
"db_ids": [1],
"matching": "custom",
"field_name": "CustomNumber1",
"field_value": 123,
"subscriptions": [
{
"provider": "android-firebase",
"subscription_id": "%subscriptionid%"
}
]
}

Ответ

{
"error": 0,
"error_text": "Successful operation",
"data": [
{
"db_id": 1,
"description": "",
"profile_id": "637f1a284fda7c5c08be62f",
"provider": "android-firebase",
"resource_id": 31,
"status": "ok",
"subscription_hash_id": "f8af057de",
"subscription_id": "%subscriptionid%",
"unsubscribe": false
}
]
}

Запрос не обновил и не добавил ни одной подписки профиля​

Запрос

{
"resource_token": "3LXP2FRcRxJ-7b14db88ec937f14",
"matching": "custom",
"field_name": "CustomNumber1",
"field_value": 12345,
"subscriptions": [
{
"provider": "android-firebase",
"subscription_id": "%subscriptionid%"
}
]
}

Ответ

{
"error": 200,
"error_text": "Successful operation",
"data": [
{
"db_id": 34,
"description": "",
"profile_id": "6156ed18eb7fec10a206e916",
"resource_id": 22,
"status": "ok"
}
]
}
Last updated on Jun 2, 2026
Previous
Integrate your app with Altcraft
Next
Регистрация событий
  • URL-адрес
  • Параметры запроса
    • SubscriptionObject
  • Возвращаемые параметры
    • DataObject
  • Импорт из файла
  • Примеры
    • Запрос с матчингом по системному id профиля
    • Запрос с матчингом по дополнительному полю профиля
    • Запрос с матчингом по push-подпискам
    • Запрос к ресурсу с несколькими базами данных
    • Запрос с матчингом по дополнительному полю профиля в определенной базе
    • Запрос не обновил и не добавил ни одной подписки профиля
© 2015 - 2026 Altcraft, LLC. All rights reserved.