Skip to content

Latest commit

 

History

History
653 lines (485 loc) · 23.6 KB

DealsApi.md

File metadata and controls

653 lines (485 loc) · 23.6 KB

brevo_python.DealsApi

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

Method HTTP request Description
crm_attributes_deals_get GET /crm/attributes/deals Get deal attributes
crm_deals_get GET /crm/deals Get all deals
crm_deals_id_delete DELETE /crm/deals/{id} Delete a deal
crm_deals_id_get GET /crm/deals/{id} Get a deal
crm_deals_id_patch PATCH /crm/deals/{id} Update a deal
crm_deals_import_post POST /crm/deals/import Import deals(creation and updation)
crm_deals_link_unlink_id_patch PATCH /crm/deals/link-unlink/{id} Link and Unlink a deal with contacts and companies
crm_deals_post POST /crm/deals Create a deal
crm_pipeline_details_all_get GET /crm/pipeline/details/all Get all pipelines
crm_pipeline_details_get GET /crm/pipeline/details Get pipeline stages
crm_pipeline_details_pipeline_id_get GET /crm/pipeline/details/{pipelineID} Get a pipeline

crm_attributes_deals_get

DealAttributes crm_attributes_deals_get()

Get deal attributes

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.DealsApi(brevo_python.ApiClient(configuration))

try:
    # Get deal attributes
    api_response = api_instance.crm_attributes_deals_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DealsApi->crm_attributes_deals_get: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

DealAttributes

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]

crm_deals_get

DealsList crm_deals_get(filters_attributes_deal_name=filters_attributes_deal_name, filters_linked_companies_ids=filters_linked_companies_ids, filters_linked_contacts_ids=filters_linked_contacts_ids, offset=offset, limit=limit, sort=sort, sort_by=sort_by)

Get all deals

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.DealsApi(brevo_python.ApiClient(configuration))
filters_attributes_deal_name = 'filters_attributes_deal_name_example' # str | Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering. (optional)
filters_linked_companies_ids = 'filters_linked_companies_ids_example' # str | Filter by linked companies ids (optional)
filters_linked_contacts_ids = 'filters_linked_contacts_ids_example' # str | Filter by linked companies ids (optional)
offset = 789 # int | Index of the first document of the page (optional)
limit = 50 # int | Number of documents per page (optional) (default to 50)
sort = 'sort_example' # str | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
sort_by = 'sort_by_example' # str | The field used to sort field names. (optional)

try:
    # Get all deals
    api_response = api_instance.crm_deals_get(filters_attributes_deal_name=filters_attributes_deal_name, filters_linked_companies_ids=filters_linked_companies_ids, filters_linked_contacts_ids=filters_linked_contacts_ids, offset=offset, limit=limit, sort=sort, sort_by=sort_by)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DealsApi->crm_deals_get: %s\n" % e)

Parameters

Name Type Description Notes
filters_attributes_deal_name str Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering. [optional]
filters_linked_companies_ids str Filter by linked companies ids [optional]
filters_linked_contacts_ids str Filter by linked companies ids [optional]
offset int Index of the first document of the page [optional]
limit int Number of documents per page [optional] [default to 50]
sort str Sort the results in the ascending/descending order. Default order is descending by creation if `sort` is not passed [optional]
sort_by str The field used to sort field names. [optional]

Return type

DealsList

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]

crm_deals_id_delete

crm_deals_id_delete(id)

Delete a deal

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.DealsApi(brevo_python.ApiClient(configuration))
id = 'id_example' # str | 

try:
    # Delete a deal
    api_instance.crm_deals_id_delete(id)
except ApiException as e:
    print("Exception when calling DealsApi->crm_deals_id_delete: %s\n" % e)

Parameters

Name Type Description Notes
id str

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]

crm_deals_id_get

Deal crm_deals_id_get(id)

Get a deal

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.DealsApi(brevo_python.ApiClient(configuration))
id = 'id_example' # str | 

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

Parameters

Name Type Description Notes
id str

Return type

Deal

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]

crm_deals_id_patch

crm_deals_id_patch(id, body)

Update a deal

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.DealsApi(brevo_python.ApiClient(configuration))
id = 'id_example' # str | 
body = brevo_python.Body9() # Body9 | Updated deal details.

try:
    # Update a deal
    api_instance.crm_deals_id_patch(id, body)
except ApiException as e:
    print("Exception when calling DealsApi->crm_deals_id_patch: %s\n" % e)

Parameters

Name Type Description Notes
id str
body Body9 Updated deal details.

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]

crm_deals_import_post

InlineResponse2003 crm_deals_import_post(file, mapping)

Import deals(creation and updation)

Import deals from a CSV file with mapping options.

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.DealsApi(brevo_python.ApiClient(configuration))
file = '/path/to/file.txt' # file | The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) deal_id [brevo mongoID to update deals] (b) associated_contact (c) associated_company (f) any other attribute with internal name 
mapping = 'mapping_example' # str | The mapping options in JSON format.   json    {       \"link_entities\": true, // Determines whether to link related entities during the import process       \"unlink_entities\": false, //Determines whether to unlink related entities during the import process.       \"update_existing_records\": true, // Determines whether to update based on deal ID or treat every row as create       \"unset_empty_attributes\": false // Determines whether unset a specific attribute during update if values input is blank     } 

try:
    # Import deals(creation and updation)
    api_response = api_instance.crm_deals_import_post(file, mapping)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DealsApi->crm_deals_import_post: %s\n" % e)

Parameters

Name Type Description Notes
file file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) deal_id [brevo mongoID to update deals] (b) associated_contact (c) associated_company (f) any other attribute with internal name
mapping str The mapping options in JSON format. json { "link_entities": true, // Determines whether to link related entities during the import process "unlink_entities": false, //Determines whether to unlink related entities during the import process. "update_existing_records": true, // Determines whether to update based on deal ID or treat every row as create "unset_empty_attributes": false // Determines whether unset a specific attribute during update if values input is blank }

Return type

InlineResponse2003

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

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

crm_deals_link_unlink_id_patch

crm_deals_link_unlink_id_patch(id, body)

Link and Unlink a deal with contacts and companies

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.DealsApi(brevo_python.ApiClient(configuration))
id = 'id_example' # str | 
body = brevo_python.Body10() # Body10 | Linked / Unlinked contacts and companies ids.

try:
    # Link and Unlink a deal with contacts and companies
    api_instance.crm_deals_link_unlink_id_patch(id, body)
except ApiException as e:
    print("Exception when calling DealsApi->crm_deals_link_unlink_id_patch: %s\n" % e)

Parameters

Name Type Description Notes
id str
body Body10 Linked / Unlinked contacts and companies ids.

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]

crm_deals_post

InlineResponse2011 crm_deals_post(body)

Create a deal

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.DealsApi(brevo_python.ApiClient(configuration))
body = brevo_python.Body8() # Body8 | Deal create data.

try:
    # Create a deal
    api_response = api_instance.crm_deals_post(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DealsApi->crm_deals_post: %s\n" % e)

Parameters

Name Type Description Notes
body Body8 Deal create data.

Return type

InlineResponse2011

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]

crm_pipeline_details_all_get

Pipelines crm_pipeline_details_all_get()

Get all pipelines

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.DealsApi(brevo_python.ApiClient(configuration))

try:
    # Get all pipelines
    api_response = api_instance.crm_pipeline_details_all_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DealsApi->crm_pipeline_details_all_get: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

Pipelines

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]

crm_pipeline_details_get

Pipeline crm_pipeline_details_get()

Get pipeline stages

This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead.

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.DealsApi(brevo_python.ApiClient(configuration))

try:
    # Get pipeline stages
    api_response = api_instance.crm_pipeline_details_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DealsApi->crm_pipeline_details_get: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

Pipeline

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]

crm_pipeline_details_pipeline_id_get

Pipelines crm_pipeline_details_pipeline_id_get(pipeline_id)

Get a pipeline

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.DealsApi(brevo_python.ApiClient(configuration))
pipeline_id = 'pipeline_id_example' # str | 

try:
    # Get a pipeline
    api_response = api_instance.crm_pipeline_details_pipeline_id_get(pipeline_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DealsApi->crm_pipeline_details_pipeline_id_get: %s\n" % e)

Parameters

Name Type Description Notes
pipeline_id str

Return type

Pipelines

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]