Email subscription permission from activities

All people added via the API are considered to be "opted in" for email subscription permission. They will appear with

Subscribed via API

on their profile.

A person’s email subscription permissions are modifiable, such as setting them as "opted out" or providing their subscribed/unsubscribed reason.

Below is an example of email subscription permissions being enabled with the message:

Subscribed via internal API

json

{ "bol::p": true, "str::s-ctx": "Subscribed via internal API" }

Below is an example of a person’s email subscription permissions that starts off as:

Unsubscribed via internal api

json

{ "bol::p": false, "str::u-ctx": "Unsubscribed via internal api" }

The default email subscription permission, if you do not provide these fields are:

json

{ "bol::p": true, "str::s-ctx": "Subscribed via API" }

Below is a cURL example with a full request to create a new activity containing an email subscription permission.

shell

curl --location --request POST 'https://api.ap3api.com/v1/activities/create' --header 'X-Api-Key: PUT-YOUR-REAL-KEY-HERE' --header 'Content-Type: application/json' --data-raw '{ "activities": [ { "activity_id":"act:cm:logged-in", "fields": { "str::first": "Chris", "str::last": "Smith", "str::email": "chris.smith@example.com", "bol::p": false, "str::u-ctx": "Unsubscribed via internal api" }, "attributes": { "str:cm:payment-plan": "Free plan", "bol:cm:account-owner": true, "str:cm:web-browser": "Netscape Navigator" } } ]}'

NOTE: Ortto customers who have their instance region set to Australia or Europe will need to use specific service endpoints relative to the region:

  • Australia: https://api.au.ap3api.com/
  • Europe: https://api.eu.ap3api.com/

For example: https://api.eu.ap3api.com/v1/<entity/endpoint>

All other Ortto users will use the default service endpoint (https://api.ap3api.com/).