Configurar evento de recuperação
curl --request PUT \
--url https://api.ararahq.com/v1/recovery/events/{eventType} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active": true,
"variableMapping": {}
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
templateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
active: true,
variableMapping: {}
})
};
fetch('https://api.ararahq.com/v1/recovery/events/{eventType}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ararahq.com/v1/recovery/events/{eventType}"
payload = {
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active": True,
"variableMapping": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ararahq.com/v1/recovery/events/{eventType}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'templateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'active' => true,
'variableMapping' => [
]
]),
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;
}{
"eventType": "<string>",
"active": true,
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateName": "<string>",
"lastTriggeredAt": "2023-11-07T05:31:56Z",
"templateStatus": "<string>",
"rejectionReason": "<string>"
}
Recuperação
Configurar evento de recuperação
Deixar ativa conta contra o limite de automações do plano
(PLAN_LIMIT_REACHED). Permissão: ADMIN.
PUT
/
v1
/
recovery
/
events
/
{eventType}
Configurar evento de recuperação
curl --request PUT \
--url https://api.ararahq.com/v1/recovery/events/{eventType} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active": true,
"variableMapping": {}
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
templateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
active: true,
variableMapping: {}
})
};
fetch('https://api.ararahq.com/v1/recovery/events/{eventType}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ararahq.com/v1/recovery/events/{eventType}"
payload = {
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active": True,
"variableMapping": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ararahq.com/v1/recovery/events/{eventType}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'templateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'active' => true,
'variableMapping' => [
]
]),
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;
}{
"eventType": "<string>",
"active": true,
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateName": "<string>",
"lastTriggeredAt": "2023-11-07T05:31:56Z",
"templateStatus": "<string>",
"rejectionReason": "<string>"
}
Authorizations
Chave de API da Arara (ara_live_...), enviada no header Authorization: Bearer ara_live_.... Crie e gerencie as chaves no painel: https://app.ararahq.com/dashboard/apikeys. O valor completo aparece uma única vez, na criação.
Path Parameters
Ex.: cart.abandoned, pix.created, payment.failed.
Body
application/json