Erstellen und aktualisieren
Diese Endpunkte erstellen und bearbeiten die Journey-Definition: ihren Titel, ihre Einstellungen und die Punkte auf dem Canvas. Sie starten die Journey nicht. Verwenden Sie dafür Lifecycle.
Beide akzeptieren und geben das Journey-Objekt zurück.
Erstellen
Anchor link toPOST https://journey.pushwoosh.com/api/v3/journeygateway
Erstellt eine neue Journey im Status STATUS_DRAFT.
Anforderung
Anchor link to| Feld | Erforderlich | Typ | Beschreibung |
|---|---|---|---|
title | Ja | string | Name der Journey. |
params | Ja | JourneyParams | Journey-weite Konfiguration. params.application_code ist erforderlich. |
points | Nein | array of Point | Journey-Elemente auf dem Canvas und ihre Verbindungen. |
comments | Nein | array of JourneyComment | Canvas-Kommentare. |
Anforderungsbeispiel
Anchor link tocurl -X POST https://journey.pushwoosh.com/api/v3/journeygateway \ -H "Authorization: Api YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "Welcome series", "params": { "application_code": "XXXXX-XXXXX" }, "points": [], "comments": [] }'Antwort
Anchor link toGibt das neue Journey-Objekt zurück. Lesen Sie die UUID der Journey aus info.uuid und verwenden Sie sie für nachfolgende Aktualisierungs- und Lifecycle-Aufrufe.
Antwortbeispiel
Anchor link to{ "info": { "uuid": "11111111-2222-3333-4444-555555555555", "title": "Welcome series", "status": "STATUS_DRAFT", "params": { "application_code": "XXXXX-XXXXX" } }, "points": [], "comments": []}Vollständiges Journey-Beispiel
Anchor link toEin vollständiger Create-Body für einen kleinen Willkommens-Flow. Der Graph ist:
Start nach Segment ──default──▶ Push senden ──default──▶ 1 Tag warten ──default──▶ Boolescher Splitter ──output1──▶ E-Mail senden ──default──▶ Beenden └──default───────────────────────────▶ BeendenDie Punkte sind durch die info.next_point_uuid jedes Ausgangs miteinander verbunden. Beachten Sie die Ausgangsschlüssel: Jeder Punkt verwendet default, außer dem booleschen Splitter, der output1 für den Zweig mit erfüllter Bedingung hinzufügt (default ist sein Fallback). Der Endpunkt hat keine Ausgänge.
{ "title": "Welcome series", "params": { "application_code": "XXXXX-XXXXX", "user_id_track_change_policy": "TRACK" }, "points": [ { "uuid": "11111111-1111-1111-1111-111111111111", "title": "New signups", "point_type": "POINT_TYPE_START_BY_SEGMENT", "position": { "x": 80, "y": 200 }, "outputs": [ { "identity": { "key": "default", "order": 0 }, "info": { "title": "", "next_point_uuid": "22222222-2222-2222-2222-222222222222" } } ], "point_data": { "start_by_segment": { "application_code": "XXXXX-XXXXX", "filter_code": "AAAAA-BBBBB" } } }, { "uuid": "22222222-2222-2222-2222-222222222222", "title": "Welcome push", "point_type": "POINT_TYPE_SEND_PUSH", "position": { "x": 340, "y": 200 }, "outputs": [ { "identity": { "key": "default", "order": 0 }, "info": { "title": "", "next_point_uuid": "33333333-3333-3333-3333-333333333333" } } ], "point_data": { "send_push": { "application_code": "XXXXX-XXXXX", "title": "Welcome!", "content": "Thanks for joining — here's how to get started." } } }, { "uuid": "33333333-3333-3333-3333-333333333333", "title": "Wait 1 day", "point_type": "POINT_TYPE_WAIT", "position": { "x": 600, "y": 200 }, "outputs": [ { "identity": { "key": "default", "order": 0 }, "info": { "title": "", "next_point_uuid": "44444444-4444-4444-4444-444444444444" } } ], "point_data": { "delay": { "sec": 86400 } } }, { "uuid": "44444444-4444-4444-4444-444444444444", "title": "Opened the push?", "point_type": "POINT_TYPE_BOOLEAN_SPLITTER", "position": { "x": 860, "y": 200 }, "outputs": [ { "identity": { "key": "output1", "order": 1 }, "info": { "title": "Matched", "next_point_uuid": "55555555-5555-5555-5555-555555555555" } }, { "identity": { "key": "default", "order": 0 }, "info": { "title": "Everyone else", "next_point_uuid": "66666666-6666-6666-6666-666666666666" } } ], "point_data": { "boolean_splitter": { "application_code": "XXXXX-XXXXX", "split_strategy": "SPLIT_FILTER", "load_policy": "ALL", "filter_code": "CCCCC-DDDDD" } } }, { "uuid": "55555555-5555-5555-5555-555555555555", "title": "Follow-up email", "point_type": "POINT_TYPE_SEND_EMAIL", "position": { "x": 1120, "y": 120 }, "outputs": [ { "identity": { "key": "default", "order": 0 }, "info": { "title": "", "next_point_uuid": "66666666-6666-6666-6666-666666666666" } } ], "point_data": { "send_email": { "application_code": "XXXXX-XXXXX", "preset_code": "12345-67890" } } }, { "uuid": "66666666-6666-6666-6666-666666666666", "title": "Exit", "point_type": "POINT_TYPE_EXIT", "position": { "x": 1380, "y": 200 }, "outputs": [], "point_data": { "terminator": {} } } ], "comments": []}Aktualisieren
Anchor link toPUT https://journey.pushwoosh.com/api/v3/journeygateway/{uuid}
Ersetzt die Definition einer bestehenden Journey. Senden Sie die vollständige Definition. Die von Ihnen übermittelten Punkte und Kommentare ersetzen die aktuellen.
Pfadparameter
Anchor link to| Name | Typ | Beschreibung |
|---|---|---|
uuid | string | Journey-ID, die aktualisiert werden soll. |
Anforderung
Anchor link to| Feld | Typ | Beschreibung |
|---|---|---|
title | string | Neuer Journey-Name. |
params | JourneyParams | Neue Journey-weite Konfiguration. |
points | array of Point | Neuer vollständiger Satz von Punkten. |
comments | array of JourneyComment | Neuer vollständiger Satz von Kommentaren. |
autosave | bool | Wenn true, wird die Änderung als automatisches Speichern des Editors behandelt. Standard ist false. |
Anforderungsbeispiel
Anchor link tocurl -X PUT https://journey.pushwoosh.com/api/v3/journeygateway/11111111-2222-3333-4444-555555555555 \ -H "Authorization: Api YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "Welcome series v2", "params": { "application_code": "XXXXX-XXXXX" }, "points": [], "comments": [] }'Antwort
Anchor link toGibt das aktualisierte Journey-Objekt zurück.
Aktualisieren und fortsetzen
Anchor link toPOST https://journey.pushwoosh.com/api/v3/journeygateway/{uuid}/resume
Wendet Änderungen auf eine Journey an und setzt sie in einem einzigen Aufruf fort. Dies entspricht einer Aktualisierung, gefolgt von einem Lifecycle-Start. Der Anforderungsbody entspricht dem von Aktualisieren. Verwenden Sie dies, wenn Sie eine pausierte Journey bearbeiten, die Sie wieder in den Status STATUS_RUNNING versetzen möchten.
Umbenennen
Anchor link toPOST https://journey.pushwoosh.com/api/v3/journeygateway/{uuid}/rename
Ändert nur den Titel der Journey, ohne ihre Punkte oder Einstellungen zu berühren.
| Feld | Erforderlich | Typ | Beschreibung |
|---|---|---|---|
title | Ja | string | Neuer Journey-Name. |
Anforderungsbeispiel
Anchor link tocurl -X POST https://journey.pushwoosh.com/api/v3/journeygateway/11111111-2222-3333-4444-555555555555/rename \ -H "Authorization: Api YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "Welcome series (Q3)" }'