Journeys

class urbanairship.journeys.core.Journeys(airship: OAuthClient)

A class for entering and exiting audiences from a Sequence (Journey).

Please see the documentation at https://docs.airship.com/api/ua/#tag-journeys for details on Journeys usage.

Note

The /api/journeys/trigger and /api/journeys/exit endpoints only support OAuth2 authentication. This class must be instantiated with an urbanairship.OAuthClient; passing any other client raises a TypeError.

Parameters:

airship – [required] An urbanairship.OAuthClient instance.

trigger(audience: Dict[str, Any], triggering_id: str | List[str], entrance_id: str | None = None, global_attributes: Dict[str, Any] | None = None) → Dict

Enter an audience segment into a Sequence identified by triggering_id. If multiple Sequences share a triggering_id, the call enters audiences in all of them.

Parameters:
  • audience – [required] An audience selector determining the set of channels to enter into the Sequence. Use the selectors in urbanairship (e.g. ua.tag, ua.named_user, ua.and_, ua.or_) to build this value.

  • triggering_id – [required] The identifier of a Sequence’s configured API Entrance trigger. May be a single string (1-256 characters) or a list of 1 to 10 such strings.

  • entrance_id – [optional] A unique identifier for enrolling the same users in multiple concurrent, independent instances of a Sequence. Each call with a different entrance_id creates a new enrollment without overwriting earlier ones. 1-64 characters.

  • global_attributes – [optional] A dict of arbitrary keys and values used for personalization of triggered pushes. Top-level keys cannot start with the reserved prefix ua_.

Returns:

API response dict.

Raises:
exit(triggering_id: str | List[str], entrance_id: str | None = None) → Dict

Exit in-flight users from a Sequence identified by triggering_id. This is a potentially long-running, asynchronous operation.

Parameters:
  • triggering_id – [required] The identifier of a Sequence’s configured API Entrance trigger. May be a single string (1-256 characters) or a list of 1 to 10 such strings.

  • entrance_id – [optional] Identifies a specific entrance for exit. If provided, only users that entered with this entrance_id are exited. If omitted, only users that entered without an entrance_id are exited. 1-64 characters.

Returns:

API response dict.

Raises: