Skip to content

Latest commit

 

History

History
539 lines (396 loc) · 18.3 KB

ConversationsApi.md

File metadata and controls

539 lines (396 loc) · 18.3 KB

brevo_python.ConversationsApi

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

Method HTTP request Description
conversations_agent_online_ping_post POST /conversations/agentOnlinePing Sets agent’s status to online for 2-3 minutes
conversations_messages_id_delete DELETE /conversations/messages/{id} Delete a message sent by an agent
conversations_messages_id_get GET /conversations/messages/{id} Get a message
conversations_messages_id_put PUT /conversations/messages/{id} Update a message sent by an agent
conversations_messages_post POST /conversations/messages Send a message as an agent
conversations_pushed_messages_id_delete DELETE /conversations/pushedMessages/{id} Delete an automated message
conversations_pushed_messages_id_get GET /conversations/pushedMessages/{id} Get an automated message
conversations_pushed_messages_id_put PUT /conversations/pushedMessages/{id} Update an automated message
conversations_pushed_messages_post POST /conversations/pushedMessages Send an automated message to a visitor

conversations_agent_online_ping_post

conversations_agent_online_ping_post(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

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ConversationsApi(brevo_python.ApiClient(configuration))
body = brevo_python.Body17() # Body17 | Agent fields.

try:
    # Sets agent’s status to online for 2-3 minutes
    api_instance.conversations_agent_online_ping_post(body)
except ApiException as e:
    print("Exception when calling ConversationsApi->conversations_agent_online_ping_post: %s\n" % e)

Parameters

Name Type Description Notes
body Body17 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]

conversations_messages_id_delete

conversations_messages_id_delete(id)

Delete a message sent by an agent

Only agents’ messages can be deleted.

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ConversationsApi(brevo_python.ApiClient(configuration))
id = 'id_example' # str | ID of the message

try:
    # Delete a message sent by an agent
    api_instance.conversations_messages_id_delete(id)
except ApiException as e:
    print("Exception when calling ConversationsApi->conversations_messages_id_delete: %s\n" % e)

Parameters

Name Type Description Notes
id str 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]

conversations_messages_id_get

ConversationsMessage conversations_messages_id_get(id)

Get a message

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ConversationsApi(brevo_python.ApiClient(configuration))
id = 'id_example' # str | ID of the message

try:
    # Get a message
    api_response = api_instance.conversations_messages_id_get(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConversationsApi->conversations_messages_id_get: %s\n" % e)

Parameters

Name Type Description Notes
id str ID of the message

Return type

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]

conversations_messages_id_put

ConversationsMessage conversations_messages_id_put(id, body=body)

Update a message sent by an agent

Only agents’ messages can be edited.

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ConversationsApi(brevo_python.ApiClient(configuration))
id = 'id_example' # str | ID of the message
body = brevo_python.Body14() # Body14 |  (optional)

try:
    # Update a message sent by an agent
    api_response = api_instance.conversations_messages_id_put(id, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConversationsApi->conversations_messages_id_put: %s\n" % e)

Parameters

Name Type Description Notes
id str ID of the message
body Body14 [optional]

Return type

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]

conversations_messages_post

ConversationsMessage conversations_messages_post(body)

Send a message as an agent

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ConversationsApi(brevo_python.ApiClient(configuration))
body = brevo_python.Body13() # Body13 | Message fields.

try:
    # Send a message as an agent
    api_response = api_instance.conversations_messages_post(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConversationsApi->conversations_messages_post: %s\n" % e)

Parameters

Name Type Description Notes
body Body13 Message fields.

Return type

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]

conversations_pushed_messages_id_delete

conversations_pushed_messages_id_delete(id)

Delete an automated message

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ConversationsApi(brevo_python.ApiClient(configuration))
id = 'id_example' # str | ID of the message

try:
    # Delete an automated message
    api_instance.conversations_pushed_messages_id_delete(id)
except ApiException as e:
    print("Exception when calling ConversationsApi->conversations_pushed_messages_id_delete: %s\n" % e)

Parameters

Name Type Description Notes
id str 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]

conversations_pushed_messages_id_get

ConversationsMessage conversations_pushed_messages_id_get(id)

Get an automated message

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ConversationsApi(brevo_python.ApiClient(configuration))
id = 'id_example' # str | ID of the message sent previously

try:
    # Get an automated message
    api_response = api_instance.conversations_pushed_messages_id_get(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConversationsApi->conversations_pushed_messages_id_get: %s\n" % e)

Parameters

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

Return type

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]

conversations_pushed_messages_id_put

ConversationsMessage conversations_pushed_messages_id_put(id, body)

Update an automated message

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ConversationsApi(brevo_python.ApiClient(configuration))
id = 'id_example' # str | ID of the message
body = brevo_python.Body16() # Body16 | 

try:
    # Update an automated message
    api_response = api_instance.conversations_pushed_messages_id_put(id, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConversationsApi->conversations_pushed_messages_id_put: %s\n" % e)

Parameters

Name Type Description Notes
id str ID of the message
body Body16

Return type

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]

conversations_pushed_messages_post

ConversationsMessage conversations_pushed_messages_post(body)

Send an automated message to a visitor

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

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ConversationsApi(brevo_python.ApiClient(configuration))
body = brevo_python.Body15() # Body15 | 

try:
    # Send an automated message to a visitor
    api_response = api_instance.conversations_pushed_messages_post(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConversationsApi->conversations_pushed_messages_post: %s\n" % e)

Parameters

Name Type Description Notes
body Body15

Return type

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]