Skip to content

Latest commit

 

History

History
557 lines (414 loc) · 17.8 KB

ConversationsApi.md

File metadata and controls

557 lines (414 loc) · 17.8 KB

ConversationsApi

All URIs are relative to https://api.brevo.com/v3

Method HTTP request Description
conversationsAgentOnlinePingPost POST /conversations/agentOnlinePing Sets agent’s status to online for 2-3 minutes
conversationsMessagesIdDelete DELETE /conversations/messages/{id} Delete a message sent by an agent
conversationsMessagesIdGet GET /conversations/messages/{id} Get a message
conversationsMessagesIdPut PUT /conversations/messages/{id} Update a message sent by an agent
conversationsMessagesPost POST /conversations/messages Send a message as an agent
conversationsPushedMessagesIdDelete DELETE /conversations/pushedMessages/{id} Delete an automated message
conversationsPushedMessagesIdGet GET /conversations/pushedMessages/{id} Get an automated message
conversationsPushedMessagesIdPut PUT /conversations/pushedMessages/{id} Update an automated message
conversationsPushedMessagesPost POST /conversations/pushedMessages Send an automated message to a visitor

conversationsAgentOnlinePingPost

conversationsAgentOnlinePingPost(body)

Sets agent’s status to online for 2-3 minutes

We recommend pinging this endpoint every minute for as long as the agent has to be considered online.

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.ConversationsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

ConversationsApi apiInstance = new ConversationsApi();
Body15 body = new Body15(); // Body15 | Agent fields.
try {
    apiInstance.conversationsAgentOnlinePingPost(body);
} catch (ApiException e) {
    System.err.println("Exception when calling ConversationsApi#conversationsAgentOnlinePingPost");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body Body15 Agent fields.

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

conversationsMessagesIdDelete

conversationsMessagesIdDelete(id)

Delete a message sent by an agent

Only agents’ messages can be deleted.

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.ConversationsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

ConversationsApi apiInstance = new ConversationsApi();
String id = "id_example"; // String | ID of the message
try {
    apiInstance.conversationsMessagesIdDelete(id);
} catch (ApiException e) {
    System.err.println("Exception when calling ConversationsApi#conversationsMessagesIdDelete");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String ID of the message

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

conversationsMessagesIdGet

ConversationsMessage conversationsMessagesIdGet(id)

Get a message

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.ConversationsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

ConversationsApi apiInstance = new ConversationsApi();
String id = "id_example"; // String | ID of the message
try {
    ConversationsMessage result = apiInstance.conversationsMessagesIdGet(id);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ConversationsApi#conversationsMessagesIdGet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String ID of the message

Return type

ConversationsMessage

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

conversationsMessagesIdPut

ConversationsMessage conversationsMessagesIdPut(id, body)

Update a message sent by an agent

Only agents’ messages can be edited.

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.ConversationsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

ConversationsApi apiInstance = new ConversationsApi();
String id = "id_example"; // String | ID of the message
Body12 body = new Body12(); // Body12 | 
try {
    ConversationsMessage result = apiInstance.conversationsMessagesIdPut(id, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ConversationsApi#conversationsMessagesIdPut");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String ID of the message
body Body12 [optional]

Return type

ConversationsMessage

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

conversationsMessagesPost

ConversationsMessage conversationsMessagesPost(body)

Send a message as an agent

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.ConversationsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

ConversationsApi apiInstance = new ConversationsApi();
Body11 body = new Body11(); // Body11 | Message fields.
try {
    ConversationsMessage result = apiInstance.conversationsMessagesPost(body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ConversationsApi#conversationsMessagesPost");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body Body11 Message fields.

Return type

ConversationsMessage

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

conversationsPushedMessagesIdDelete

conversationsPushedMessagesIdDelete(id)

Delete an automated message

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.ConversationsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

ConversationsApi apiInstance = new ConversationsApi();
String id = "id_example"; // String | ID of the message
try {
    apiInstance.conversationsPushedMessagesIdDelete(id);
} catch (ApiException e) {
    System.err.println("Exception when calling ConversationsApi#conversationsPushedMessagesIdDelete");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String ID of the message

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

conversationsPushedMessagesIdGet

ConversationsMessage conversationsPushedMessagesIdGet(id)

Get an automated message

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.ConversationsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

ConversationsApi apiInstance = new ConversationsApi();
String id = "id_example"; // String | ID of the message sent previously
try {
    ConversationsMessage result = apiInstance.conversationsPushedMessagesIdGet(id);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ConversationsApi#conversationsPushedMessagesIdGet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String ID of the message sent previously

Return type

ConversationsMessage

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

conversationsPushedMessagesIdPut

ConversationsMessage conversationsPushedMessagesIdPut(id, body)

Update an automated message

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.ConversationsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

ConversationsApi apiInstance = new ConversationsApi();
String id = "id_example"; // String | ID of the message
Body14 body = new Body14(); // Body14 | 
try {
    ConversationsMessage result = apiInstance.conversationsPushedMessagesIdPut(id, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ConversationsApi#conversationsPushedMessagesIdPut");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String ID of the message
body Body14

Return type

ConversationsMessage

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

conversationsPushedMessagesPost

ConversationsMessage conversationsPushedMessagesPost(body)

Send an automated message to a visitor

Example of automated messages: order status, announce new features in your web app, etc.

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.ConversationsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

ConversationsApi apiInstance = new ConversationsApi();
Body13 body = new Body13(); // Body13 | 
try {
    ConversationsMessage result = apiInstance.conversationsPushedMessagesPost(body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ConversationsApi#conversationsPushedMessagesPost");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body Body13

Return type

ConversationsMessage

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json