Skip to main content

React Native Journey Service

Functions

syncJourneys

JourneyService.syncJourneys(): Promise

Synchronizes journey list with the Orchestrator.

Parameters:

  • None

getJourneys

JourneyService.getJourneys(tags, statuses): Promise

Fetches journeys from local storage with optional filters.

Parameters:

  • tags: [String] — Optional journey tags.
  • statuses: [String] — Optional journey statuses ("sent", "completed", "notStarted").

getJourney

JourneyService.getJourney(name): Promise

Returns a journey by name.

Parameters:

  • name: String — Journey name.

runJourney

JourneyService.runJourney(name, data): Promise

Executes journey UI and returns the output JSON.

Parameters:

  • name: String — Journey name.
  • data: [String: Any] — Input payload.

getJourneyExecutionRecords

JourneyService.getJourneyExecutionRecords(name): Promise

Returns all execution records for a journey.

Parameters:

  • name: String — Journey name.

getJourneyExecutionRecord

JourneyService.getJourneyExecutionRecord(name): Promise

Returns the latest execution record for a journey.

Parameters:

  • name: String — Journey name.

getJourneyStatus

JourneyService.getJourneyStatus(name): Promise

Returns the current journey status.

Parameters:

  • name: String — Journey name.

Classes

Journey

{
id: string;
name: string;
flow: JourneyFlow;
metadata: JourneyMetadata;
tags?: string[] | null;
zpdRequest?: JourneyZPDRequest | null;
createdAt: number;
updatedAt?: number | null;
publishedAt?: number | null;
}

JourneyMetadata

{
title: string;
description?: string | null;
imageUrl?: string | null;
}

JourneyFlow

{
xml: string;
data?: JourneyFlowData[] | null;
}

JourneyFlowData

{
type: string;
name: string;
source: string;
origin?: string | null;
}

JourneyZPDRequest

{
requested?: JourneyFlowData[] | null;
}

JourneyFlowDataType

"MEDATA" | "INPUT" | "CALCULATED" | "ANSWER"

JourneyStatus

"NOT_STARTED" | "COMPLETED" | "SENT"

JourneyStatusFilter

JourneyStatus[]

JourneyContext

{
values: { [key: string]: any };
}

JourneyExecutionRecord

{
id: string;
status: string;
journeyContext?: JourneyContext | null;
date: number;
}

JourneyZPD

{
data: SharedData[];
}

SharedData

{
type: string;
name: string;
source: string;
origin?: string | null;
value: string;
}