Skip to content

Latest commit

 

History

History
539 lines (396 loc) · 20.5 KB

ConversationsApi.md

File metadata and controls

539 lines (396 loc) · 20.5 KB

Brevo\Client\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

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');

$apiInstance = new Brevo\Client\Api\ConversationsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$body = new \Brevo\Client\Model\Body14(); // \Brevo\Client\Model\Body14 | Agent fields.

try {
    $apiInstance->conversationsAgentOnlinePingPost($body);
} catch (Exception $e) {
    echo 'Exception when calling ConversationsApi->conversationsAgentOnlinePingPost: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Brevo\Client\Model\Body14 Agent fields.

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

conversationsMessagesIdDelete

conversationsMessagesIdDelete($id)

Delete a message sent by an agent

Only agents’ messages can be deleted.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');

$apiInstance = new Brevo\Client\Api\ConversationsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | ID of the message

try {
    $apiInstance->conversationsMessagesIdDelete($id);
} catch (Exception $e) {
    echo 'Exception when calling ConversationsApi->conversationsMessagesIdDelete: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string ID of the message

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

conversationsMessagesIdGet

\Brevo\Client\Model\ConversationsMessage conversationsMessagesIdGet($id)

Get a message

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');

$apiInstance = new Brevo\Client\Api\ConversationsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | ID of the message

try {
    $result = $apiInstance->conversationsMessagesIdGet($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversationsApi->conversationsMessagesIdGet: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string ID of the message

Return type

\Brevo\Client\Model\ConversationsMessage

Authorization

api-key, partner-key

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

conversationsMessagesIdPut

\Brevo\Client\Model\ConversationsMessage conversationsMessagesIdPut($id, $body)

Update a message sent by an agent

Only agents’ messages can be edited.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');

$apiInstance = new Brevo\Client\Api\ConversationsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | ID of the message
$body = new \Brevo\Client\Model\Body11(); // \Brevo\Client\Model\Body11 | 

try {
    $result = $apiInstance->conversationsMessagesIdPut($id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversationsApi->conversationsMessagesIdPut: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string ID of the message
body \Brevo\Client\Model\Body11 [optional]

Return type

\Brevo\Client\Model\ConversationsMessage

Authorization

api-key, partner-key

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

conversationsMessagesPost

\Brevo\Client\Model\ConversationsMessage conversationsMessagesPost($body)

Send a message as an agent

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');

$apiInstance = new Brevo\Client\Api\ConversationsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$body = new \Brevo\Client\Model\Body10(); // \Brevo\Client\Model\Body10 | Message fields.

try {
    $result = $apiInstance->conversationsMessagesPost($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversationsApi->conversationsMessagesPost: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Brevo\Client\Model\Body10 Message fields.

Return type

\Brevo\Client\Model\ConversationsMessage

Authorization

api-key, partner-key

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

conversationsPushedMessagesIdDelete

conversationsPushedMessagesIdDelete($id)

Delete an automated message

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');

$apiInstance = new Brevo\Client\Api\ConversationsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | ID of the message

try {
    $apiInstance->conversationsPushedMessagesIdDelete($id);
} catch (Exception $e) {
    echo 'Exception when calling ConversationsApi->conversationsPushedMessagesIdDelete: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string ID of the message

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

conversationsPushedMessagesIdGet

\Brevo\Client\Model\ConversationsMessage conversationsPushedMessagesIdGet($id)

Get an automated message

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');

$apiInstance = new Brevo\Client\Api\ConversationsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | ID of the message sent previously

try {
    $result = $apiInstance->conversationsPushedMessagesIdGet($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversationsApi->conversationsPushedMessagesIdGet: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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

Return type

\Brevo\Client\Model\ConversationsMessage

Authorization

api-key, partner-key

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

conversationsPushedMessagesIdPut

\Brevo\Client\Model\ConversationsMessage conversationsPushedMessagesIdPut($id, $body)

Update an automated message

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');

$apiInstance = new Brevo\Client\Api\ConversationsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | ID of the message
$body = new \Brevo\Client\Model\Body13(); // \Brevo\Client\Model\Body13 | 

try {
    $result = $apiInstance->conversationsPushedMessagesIdPut($id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversationsApi->conversationsPushedMessagesIdPut: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string ID of the message
body \Brevo\Client\Model\Body13

Return type

\Brevo\Client\Model\ConversationsMessage

Authorization

api-key, partner-key

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

conversationsPushedMessagesPost

\Brevo\Client\Model\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

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');

$apiInstance = new Brevo\Client\Api\ConversationsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$body = new \Brevo\Client\Model\Body12(); // \Brevo\Client\Model\Body12 | 

try {
    $result = $apiInstance->conversationsPushedMessagesPost($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversationsApi->conversationsPushedMessagesPost: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Brevo\Client\Model\Body12

Return type

\Brevo\Client\Model\ConversationsMessage

Authorization

api-key, partner-key

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]