Lista de Contactos — Email de Opt-in¶
Entidade email de opt-in para uma lista de contactos.
Endpoint¶
Todos os verbos: /contact_list/<list>/optin_email
GET /contact_list/<list>/optin_email¶
Payload: Sem payload.
Devolve: O email de opt-in.
Example:
curl -u "username:api_key" -H "Accept: application/json" \
https://app.duo.pt/contact_list/{list_id}/optin_email
Response:
{
"success": true,
"data": {
"email": {
"envelope_from_domain": null,
"header_from_name": "Test Sender",
"header_from": "sender@yourdomain.com",
"subject": "Please confirm",
"message": "<html><body>Click to confirm</body></html>",
"attachment": null,
"memoizedAttachment": null,
"list": 1,
"block_editor_type": null,
"block_editor_content": null
}
}
}
POST /contact_list/<list>/optin_email¶
Nota
O payload deve ser enviado como multipart/form-data para acomodar o parâmetro attachment.
| Parâmetro | Tipo | Descrição |
|---|---|---|
header_from_name |
string | Nome do remetente legível por humanos |
header_from |
string | Email do remetente (o domínio deve estar activo como domínio de envio) |
subject |
string | Assunto da mensagem |
message |
string | HTML da mensagem |
block_editor_content |
string (opcional) | JSON para conteúdo do editor de blocos (apenas Froala) |
attachment |
ficheiro (opcional) | Ficheiro de anexo |
Devolve: A lista de contactos e o novo email de opt-in.
Example:
curl -u "username:api_key" -H "Accept: application/json" \
-F "header_from_name=My Brand" \
-F "header_from=noreply@yourdomain.com" \
-F "subject=Please+confirm+your+subscription" \
-F "message=<html><body><a href='{{optin_url}}'>Confirm</a></body></html>" \
https://app.duo.pt/contact_list/{list_id}/optin_email
Response:
{
"success": true,
"data": {
"contact_list": {
"id": 1,
"owner": 1,
"name": "Example...",
"default_email_out": null,
"unsubscribe_message": "You have been unsubscribed.",
"email_out_custom_fields": null,
"double_optin": false,
"optout_allowed": false,
"optout_category": null,
"optin_email": null,
"optin_sms": null,
"shared_with_children": false,
"read_shared_with_children": false,
"segments": null
},
"email": {
"envelope_from_domain": null,
"header_from_name": "Test Sender",
"header_from": "sender@yourdomain.com",
"subject": "Please confirm",
"message": "<html><body>Click to confirm</body></html>",
"attachment": null,
"memoizedAttachment": null,
"list": 1
}
}
}
PUT /contact_list/<list>/optin_email¶
Mesmo payload que o POST.
Devolve: A lista de contactos e o email de opt-in editado.
Example:
curl -u "username:api_key" -H "Accept: application/json" -X PUT \
-F "header_from_name=My Brand" \
-F "header_from=noreply@yourdomain.com" \
-F "subject=Updated+confirmation+subject" \
-F "message=<html><body><a href='{{optin_url}}'>Confirm</a></body></html>" \
https://app.duo.pt/contact_list/{list_id}/optin_email
Response:
{
"success": true,
"data": {
"contact_list": {
"id": 1,
"owner": 1,
"name": "Example...",
"default_email_out": null,
"unsubscribe_message": "You have been unsubscribed.",
"email_out_custom_fields": null,
"double_optin": false,
"optout_allowed": false,
"optout_category": null,
"optin_email": null,
"optin_sms": null,
"shared_with_children": false,
"read_shared_with_children": false,
"segments": null
},
"email": {
"envelope_from_domain": null,
"header_from_name": "Test Sender",
"header_from": "sender@yourdomain.com",
"subject": "Please confirm",
"message": "<html><body>Click to confirm</body></html>",
"attachment": null,
"memoizedAttachment": null,
"list": 1,
"block_editor_type": null,
"block_editor_content": null
}
}
}