Eventos


Os endpoints de eventos são responsáveis por receber diferentes tipos de eventos nos quais os contatos do RD Station fazem parte.

É possível enviar eventos padrões do RD Station como eventos de conversão, marcação de oportunidades e marcações de lost e venda. Além disso o RD Station suporta a possbilidade de recebimento de outros tipos de eventos, como por exemplo, eventos de chat e eventos de e-commerce entre outros.


Métodos disponíveis


Default Header


All events requests share the same headers, that should be as follow:
Request Headers
Content-Type application/json
Authorization Bearer ACCESS_TOKEN

Default Response


All events requests share the same responses structure:

Success | Code: 200

{
  "event_uuid": "5408c5a3-4711-4f2e-8d0b-13407a3e30f3"
}

Bad Request | Invalid Event Type | Code: 400

{
  "errors": [
    {
        "error_type": "INVALID_OPTION",
        "error_message": "Must be one of the valid options.",
        "validation_rules": {
            "valid_options": [
                "CONVERSION",
                "OPPORTUNITY",
                "OPPORTUNITY_LOST",
                "SALE",
                "ORDER_PLACED",
                "ORDER_PLACED_ITEM",
                /* ... */
            ]
        },
        "path": "$.body.event_type"
    }
  ]
}

Eventos Padrões


Os eventos padrões são definidos especificamente para as transições padrões de um Contato em um funil do RD Station. Como por exemplo, eventos conversão que transidem um Contato para o estágio de Lead e eventos de marcação de oportunidade, won e lost.

Evento de Conversão



The conversion event represents Contact’s conversions on forms, landing pages, popups and etc.
Request body parameters
Field Type Required Description
event_type String true The event type that diferentiates the event. For the conversion event it should be sent as "CONVERSION".
event_family String true The family of the event for processing purposes. It currently accepts only "CDP" as valid option.
conversion_identifier String true The name of the conversion event.
name String false Name of the contact.
email String true Email of the contact.
job_title String false Job title of the contact.
state String false State of the contact.
city String false City of the contact.
country String false Country of the contact.
personal_phone String false Phone of the contact.
mobile_phone String false Mobile phone of the contact.
twitter String false Twitter handler of the contact.
facebook String false Facebook of the contact.
linkedin String false Linkedin of the contact.
website String false Website of the contact.
cf_custom_field_api_identifier* String false Custom field and its value related to the contact.
company_name String false Company name of the contact.
company_site String false Company website of the contact.
company_address String false Company address of the contact.

*All custom fields available in RD Station Marketing account are valid on this payload, and should be sent with the payload key being the the fields api identifier (cf_api_identifier)

Request body example
{
  "event_type": "CONVERSION",
  "event_family":"CDP",
  "payload": {
    "conversion_identifier": "Name of the conversion event",
    "name": "Nome",
    "email": "email@email.com",
    "job_title": "job title value",
    "state": "state of the contact",
    "city": "city of the contact",
    "country": "country of the contact",
    "personal_phone": "phone of the contact",
    "mobile_phone": "mobile_phone of the contact",
    "twitter": "twitter handler of the contact",
    "facebook": "facebook name of the contact",
    "linkedin": "linkedin user name of the contact",
    "website": "website of the contact",
    "cf_custom_field_api_identifier*": "custom field value",
    "company_name": "company name",
    "company_site": "company website",
    "company_address": "company address"
  }
}

Evento de Marcação de Oportunidade



The opportunity event, marks a Contact as Opportunity in a specfic RD Station funnel.
Request body parameters
Field Type Required Description
event_type String true The event type that diferentiates the event. For the conversion event it should be sent as "OPPORTUNITY".
event_family String true The family of the event for processing purposes. It currently accepts only "CDP" as valid option.
funnel_name String true Name of the funnel to which the Contact should be marked as opportunity.
email String true Email of the contact.

Request body example
{
  "event_type": "OPPORTUNITY",
  "event_family":"CDP",
  "payload": {
    "email": "email@email.com",
    "funnel_name": "default"
  }
}

Evento de Marcação de Oportunidade Ganha



To mark a Contact as won on a specific funnel.
Request body parameters
Field Type Required Description
event_type String true The event type that diferentiates the event. For the conversion event it should be sent as "SALE".
event_family String true The family of the event for processing purposes. It currently accepts only "CDP" as valid option.
funnel_name String true Name of the funnel to which the Contact should be marked as won.
email String true Email of the contact.
value String false Value of the won opportunity.

Request body example
{
  "event_type": "SALE",
  "event_family":"CDP",
  "payload": {
    "email": "email@email.com",
    "funnel_name": "default",
    "value": 200
  }
}

Evento de Marcação de Oportunidade Perdida



To mark a Contact as Lost on a specific funnel.
Request body parameters
Field Type Required Description
event_type String true The event type that diferentiates the event. For the conversion event it should be sent as "OPPORTUNITY_LOST".
event_family String true The family of the event for processing purposes. It currently accepts only "CDP" as valid option.
funnel_name String true Name of the funnel to which the Contact should be marked as lost.
reason String false Reason for why the Contact was marked as lost.

Request body example
{
  "event_type": "OPPORTUNITY_LOST",
  "event_family":"CDP",
  "payload": {
    "email": "email@email.com",
    "funnel_name": "default",
    "reason":"Lost reason"
  }
}

Eventos de Ecommerce


Os eventos de ecommerce são responsáveis por descrever o comportamento de um contato no processo de compra de produtos em um ecommerce. Por meio desses eventos é possível indicar quando que um Contato fecha um pedido ou até mesmo abandona um carrinho, informando quais os produtos envolvidos no processo.

Evento de fechamento de pedido



To indicate when a Contact has placed an order through an ecommerce platform.
Request body parameters
Field Type Required Description
event_type String true The event type that diferentiates the event. For the conversion event it should be sent as "ORDER_PLACED".
event_family String true The family of the event for processing purposes. It currently accepts only "CDP" as valid option.
cf_order_id String true Order identifier
name String false Name of the contact.
email String true Email of the contact.
cf_order_total_items Integer false Total number of itens from the order.
cf_order_status String false Status of the order to when the event was triggered
cf_order_payment_method String false Method of payment. Available options: "Credit Card", "Debit Card", "Invoice", "Others"
cf_order_payment_amount String false Total value of the order
Request body example
{
  "event_type": "ORDER_PLACED",
  "event_family":"CDP",
  "payload": {
    "name": "Contact's Name",
    "email": "email@email.com",
    "cf_order_id": "identificador do pedido",
    "cf_order_total_items": 2,
    "cf_order_status": "pending_payment",
    "cf_order_payment_method": "Credit Card",
    "cf_order_payment_amount": 40.20,
  }
}

Evento de fechamento de pedido de um produto



To indicate which items were included when a Contact has placed an order through the ecommerce platform.
Request body parameters
Field Type Required Description
event_type String true The event type that diferentiates the event. For the conversion event it should be sent as "ORDER_PLACED_ITEM".
event_family String true The family of the event for processing purposes. It currently accepts only "CDP" as valid option.
cf_order_id String true Order identifier
name String false Name of the contact.
email String true Email of the contact.
cf_order_product_id String true Product Identifier
cf_order_product_sku String false Product SKU

Request body example
{
  "event_type": "ORDER_PLACED_ITEM",
  "event_family":"CDP",
  "payload": {
    "name": "Contact's Name",
    "email": "email@email.com",
    "cf_order_id": "Order Identifier",
    "cf_order_product_id": "Product 1",
    "cf_order_product_sku": "SKU 1"
  }
}

Evento de abandono de carrinho



To indicate when a Contact abandons a cart on a ecommerce platform.
Request body parameters
Field Type Required Description
event_type String true The event type that diferentiates the event. For the conversion event it should be sent as "CART_ABANDONED".
event_family String true The family of the event for processing purposes. It currently accepts only "CDP" as valid option.
cf_cart_id String true Cart identifier
name String false Name of the contact.
email String true Email of the contact.
cf_cart_total_items Integer false Total number of itens from the cart.
cf_cart_status String false Status of the cart to when the event was triggered

Request body example
{
  "event_type": "CART_ABANDONED",
  "event_family":"CDP",
  "payload": {
    "name": "Contact's Name",
    "email": "email@email.com",
    "cf_cart_id": "Cart identifier",
    "cf_cart_total_items": 2,
    "cf_cart_status": "in_progress"
  }
}


Evento de abandono de um item do carrinho



To indicate which items were included when a Contact has abandoned a cart through the ecommerce platform.
Request body parameters
Field Type Required Description
event_type String true The event type that diferentiates the event. For the conversion event it should be sent as "CART_ABANDONED_ITEM".
event_family String true The family of the event for processing purposes. It currently accepts only "CDP" as valid option.
cf_cart_id String true Cart identifier
name String false Name of the contact.
email String true Email of the contact.
cf_cart_product_id String true Identifier of the product that was left on the cart.
cf_cart_product_sku String false SKU of the product that was left on the cart

Request body example
{
  "event_type": "CART_ABANDONED_ITEM",
  "event_family":"CDP",
  "payload": {
    "name": "Contact's Name",
    "email": "email@email.com",
    "cf_cart_id": "Cart identifier",
    "cf_cart_product_id": "Product identifier",
    "cf_cart_product_sku": "Product SKU"
  }
}

Eventos de Chat


Os eventos de chat possibilitam avisar o RD Station sempre que um contato inicia ou termina uma conversa via chat. Assim sendo os apps integrados precisam apenas disparar as chamadas a API do RD Station no momento desejado.

Evento de início da conversa



To indicate whenever a chat is initiate with a Contact.
Request body parameters
Field Type Required Description
event_type String true The event type that diferentiates the event. For the conversion event it should be sent as "CHAT_STARTED".
event_family String true The family of the event for processing purposes. It currently accepts only "CDP" as valid option.
chat_subject String true The subject of the chat.
name String false Name of the contact.
email String true Email of the contact.
job_title String false Job title of the contact.
personal_phone String false Phone of the contact.
mobile_phone String false Mobile phone of the contact.
twitter String false Twitter handler of the contact.
facebook String false Facebook of the contact.
linkedin String false Linkedin of the contact.
website String false Website of the contact.
cf_birthdate String false Bith date of the Contact
cf_gender String false Gender of the Contact.
chat_status String false Status of the chat.
chat_type String false Type of the chat.
company_site String false Company website of the contact.

Request body example
{
  "event_type": "CHAT_STARTED",
  "event_family":"CDP",
  "payload": {
    "name": "Nome do lead",
    "email": "Email do lead: email@email.com",
     "company_name": "Nome da empresa do lead",
     "company_site": "Site da empresa do lead",
     "job_title": "Cargo do lead",
     "personal_phone": "Telefone do lead",
     "mobile_phone": "Telefone celular do lead",
     "twitter": "Twitter do lead",
     "facebook": "Facebook do lead",
     "linkedin": "Linkedin do lead",
     "website": "Site do lead",
     "chat_subject": "Chat subject",
     "cf_birthdate": "Contact's birth date: ‘1980-06-10’",
     "cf_gender": "Sexo do lead",
     "cf_chat_status": "online",
     "cf_chat_type": "Tipo do chat: vendas, suporte, ..."
  }
}

Evento de término da conversa



To indicate whenever a chat is finished with a Contact.
Request body parameters
Field Type Required Description
event_type String true The event type that diferentiates the event. For the conversion event it should be sent as "CHAT_FINISHED".
event_family String true The family of the event for processing purposes. It currently accepts only "CDP" as valid option.
chat_subject String true The subject of the chat.
name String false Name of the contact.
email String true Email of the contact.
job_title String false Job title of the contact.
personal_phone String false Phone of the contact.
mobile_phone String false Mobile phone of the contact.
twitter String false Twitter handler of the contact.
facebook String false Facebook of the contact.
linkedin String false Linkedin of the contact.
website String false Website of the contact.
cf_birthdate String false Bith date of the Contact
cf_gender String false Gender of the Contact.
chat_status String false Status of the chat.
chat_type String false Type of the chat.
company_site String false Company website of the contact.

Request body example
{
  "event_type": "CHAT_FINISHED",
  "event_family":"CDP",
  "payload": {
    "name": "Nome do lead",
    "email": "Email do lead: email@email.com",
     "company_name": "Nome da empresa do lead",
     "company_site": "Site da empresa do lead",
     "job_title": "Cargo do lead",
     "personal_phone": "Telefone do lead",
     "mobile_phone": "Telefone celular do lead",
     "twitter": "Twitter do lead",
     "facebook": "Facebook do lead",
     "linkedin": "Linkedin do lead",
     "website": "Site do lead",
     "chat_subject": "Chat subject",
     "cf_birthdate": "Contact's birth date: ‘1980-06-10’",
     "cf_gender": "Sexo do lead",
     "cf_chat_status": "online",
     "cf_chat_type": "Tipo do chat: vendas, suporte, ...",
     "cf_chat_transcript_message": "Transcript of the chat"
  }
}

Grupo de eventos


O endpoint de grupo de eventos permite o RD Station a receber mais de um evento ao mesmo tempo. Isso permite que eventos de pedido fechado e quais os itens foram inclusos no pedido sejam enviados por meio de apenas uma chamada a API.

Grupo de eventos



Allows RD Station to receive a batch of events all at once. It is specially dedicated to receive order placed and order placed items events agrouped or cart abandoned and cart abandoned items events agrouped as well.
Request body parameters
Field Type Required Description
event_type String true The event type as defined by one of the events above
event_family String true The family of the event for processing purposes. It currently accepts only "CDP" as valid option.
payload Object true Payload object containing the attributes of the related event_type as defined above.

Request body example
[
  {
    "event_type" : "#type",
    "event_family" : "CDP",
    "payload": {
      /* ... */
    }
  },
  {
    "event_type" : "#type",
    "event_family" : "CDP",
    "payload": {
      /* ... */
    }
  },
  {
    "event_type" : "#type",
    "event_family" : "CDP",
    "payload":
    {
      /* ... */
    }
  },
  /* ... */
]

Request response example

Success | Code: 200


{
    "event_batch_uuid": "UUID of the batch",
    "events":[
	     { "event_uuid":"Event UUID" },
	     { "event_uuid":"Event UUID" },
	     { "event_uuid":"Event UUID" },
       /* ... */
     ]
}
The event uuid array is organized according to the the order of the array sent in the request payload.