Emitir uno de tus propios eventos
curl --request POST \
--url https://clientapi.woku.app/v1/journey-events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event": "crm.deal.won",
"subjectKey": "cliente-123",
"authHeader": "<string>",
"contact": {
"email": "cliente@example.com",
"phone": "56911111111"
},
"trackers": [
{
"name": "campaign",
"value": "black-friday"
}
],
"metadata": {}
}
'import requests
url = "https://clientapi.woku.app/v1/journey-events"
payload = {
"event": "crm.deal.won",
"subjectKey": "cliente-123",
"authHeader": "<string>",
"contact": {
"email": "cliente@example.com",
"phone": "56911111111"
},
"trackers": [
{
"name": "campaign",
"value": "black-friday"
}
],
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event: 'crm.deal.won',
subjectKey: 'cliente-123',
authHeader: '<string>',
contact: {email: 'cliente@example.com', phone: '56911111111'},
trackers: [{name: 'campaign', value: 'black-friday'}],
metadata: {}
})
};
fetch('https://clientapi.woku.app/v1/journey-events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://clientapi.woku.app/v1/journey-events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'event' => 'crm.deal.won',
'subjectKey' => 'cliente-123',
'authHeader' => '<string>',
'contact' => [
'email' => 'cliente@example.com',
'phone' => '56911111111'
],
'trackers' => [
[
'name' => 'campaign',
'value' => 'black-friday'
]
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://clientapi.woku.app/v1/journey-events"
payload := strings.NewReader("{\n \"event\": \"crm.deal.won\",\n \"subjectKey\": \"cliente-123\",\n \"authHeader\": \"<string>\",\n \"contact\": {\n \"email\": \"cliente@example.com\",\n \"phone\": \"56911111111\"\n },\n \"trackers\": [\n {\n \"name\": \"campaign\",\n \"value\": \"black-friday\"\n }\n ],\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://clientapi.woku.app/v1/journey-events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"crm.deal.won\",\n \"subjectKey\": \"cliente-123\",\n \"authHeader\": \"<string>\",\n \"contact\": {\n \"email\": \"cliente@example.com\",\n \"phone\": \"56911111111\"\n },\n \"trackers\": [\n {\n \"name\": \"campaign\",\n \"value\": \"black-friday\"\n }\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://clientapi.woku.app/v1/journey-events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event\": \"crm.deal.won\",\n \"subjectKey\": \"cliente-123\",\n \"authHeader\": \"<string>\",\n \"contact\": {\n \"email\": \"cliente@example.com\",\n \"phone\": \"56911111111\"\n },\n \"trackers\": [\n {\n \"name\": \"campaign\",\n \"value\": \"black-friday\"\n }\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"journeys": 123
}{
"statusCode": 400,
"message": [
"email must be a valid email",
"password must be at least 8 characters"
],
"error": "Bad Request"
}v1 - journeys
Emitir uno de tus propios eventos
Reaccionan los viajes elegibles cuyos momentos escuchan ese nombre. Los viajes v2 que empiezan con una inscripción manual requieren una evaluación abierta para ese sujeto. Los nombres que comienzan con journey. están reservados.
POST
/
v1
/
journey-events
Emitir uno de tus propios eventos
curl --request POST \
--url https://clientapi.woku.app/v1/journey-events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event": "crm.deal.won",
"subjectKey": "cliente-123",
"authHeader": "<string>",
"contact": {
"email": "cliente@example.com",
"phone": "56911111111"
},
"trackers": [
{
"name": "campaign",
"value": "black-friday"
}
],
"metadata": {}
}
'import requests
url = "https://clientapi.woku.app/v1/journey-events"
payload = {
"event": "crm.deal.won",
"subjectKey": "cliente-123",
"authHeader": "<string>",
"contact": {
"email": "cliente@example.com",
"phone": "56911111111"
},
"trackers": [
{
"name": "campaign",
"value": "black-friday"
}
],
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event: 'crm.deal.won',
subjectKey: 'cliente-123',
authHeader: '<string>',
contact: {email: 'cliente@example.com', phone: '56911111111'},
trackers: [{name: 'campaign', value: 'black-friday'}],
metadata: {}
})
};
fetch('https://clientapi.woku.app/v1/journey-events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://clientapi.woku.app/v1/journey-events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'event' => 'crm.deal.won',
'subjectKey' => 'cliente-123',
'authHeader' => '<string>',
'contact' => [
'email' => 'cliente@example.com',
'phone' => '56911111111'
],
'trackers' => [
[
'name' => 'campaign',
'value' => 'black-friday'
]
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://clientapi.woku.app/v1/journey-events"
payload := strings.NewReader("{\n \"event\": \"crm.deal.won\",\n \"subjectKey\": \"cliente-123\",\n \"authHeader\": \"<string>\",\n \"contact\": {\n \"email\": \"cliente@example.com\",\n \"phone\": \"56911111111\"\n },\n \"trackers\": [\n {\n \"name\": \"campaign\",\n \"value\": \"black-friday\"\n }\n ],\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://clientapi.woku.app/v1/journey-events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"crm.deal.won\",\n \"subjectKey\": \"cliente-123\",\n \"authHeader\": \"<string>\",\n \"contact\": {\n \"email\": \"cliente@example.com\",\n \"phone\": \"56911111111\"\n },\n \"trackers\": [\n {\n \"name\": \"campaign\",\n \"value\": \"black-friday\"\n }\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://clientapi.woku.app/v1/journey-events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event\": \"crm.deal.won\",\n \"subjectKey\": \"cliente-123\",\n \"authHeader\": \"<string>\",\n \"contact\": {\n \"email\": \"cliente@example.com\",\n \"phone\": \"56911111111\"\n },\n \"trackers\": [\n {\n \"name\": \"campaign\",\n \"value\": \"black-friday\"\n }\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"journeys": 123
}{
"statusCode": 400,
"message": [
"email must be a valid email",
"password must be at least 8 characters"
],
"error": "Bad Request"
}Autorizaciones
Clave API secreta de la empresa.
Encabezados
Clave generada por el cliente para reintentar con seguridad. Un reintento con la misma clave y operación devuelve el resultado original. No reutilices la clave con datos nuevos: se reproduce el cuerpo original. Una operación diferente devuelve 422.
Cuerpo
application/json
Ejemplo:
"crm.deal.won"
Ejemplo:
"cliente-123"
Clave de API legacy en el cuerpo. Prefiere Authorization: Bearer. La consume la autenticación y nunca se envía a los comandos del viaje.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Respuesta
Cuántos viajes lo recibieron