Skip to content

Latest commit

 

History

History
548 lines (409 loc) · 21.3 KB

File metadata and controls

548 lines (409 loc) · 21.3 KB

brevo_python.CompaniesApi

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

Method HTTP request Description
companies_get GET /companies Get all companies
companies_id_delete DELETE /companies/{id} Delete a company
companies_id_get GET /companies/{id} Get a company
companies_id_patch PATCH /companies/{id} Update a company
companies_import_post POST /companies/import Import companies(creation and updation)
companies_link_unlink_id_patch PATCH /companies/link-unlink/{id} Link and Unlink company with contacts and deals
companies_post POST /companies Create a company
crm_attributes_companies_get GET /crm/attributes/companies Get company attributes
crm_attributes_post POST /crm/attributes Create a deal/company attribute

companies_get

CompaniesList companies_get(filters=filters, linked_contacts_ids=linked_contacts_ids, linked_deals_ids=linked_deals_ids, modified_since=modified_since, created_since=created_since, page=page, limit=limit, sort=sort, sort_by=sort_by)

Get all 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.CompaniesApi(brevo_python.ApiClient(configuration))
filters = 'filters_example' # str | Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"5b1a17d914b73d35a76ca0c7\"} (optional)
linked_contacts_ids = 789 # int | Filter by linked contacts ids (optional)
linked_deals_ids = 'linked_deals_ids_example' # str | Filter by linked deals ids (optional)
modified_since = 'modified_since_example' # str | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
created_since = 'created_since_example' # str | Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
page = 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 companies
    api_response = api_instance.companies_get(filters=filters, linked_contacts_ids=linked_contacts_ids, linked_deals_ids=linked_deals_ids, modified_since=modified_since, created_since=created_since, page=page, limit=limit, sort=sort, sort_by=sort_by)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CompaniesApi->companies_get: %s\n" % e)

Parameters

Name Type Description Notes
filters str Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"5b1a17d914b73d35a76ca0c7"} [optional]
linked_contacts_ids int Filter by linked contacts ids [optional]
linked_deals_ids str Filter by linked deals ids [optional]
modified_since str Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. [optional]
created_since str Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. [optional]
page 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

CompaniesList

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]

companies_id_delete

companies_id_delete(id)

Delete a company

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

try:
    # Delete a company
    api_instance.companies_id_delete(id)
except ApiException as e:
    print("Exception when calling CompaniesApi->companies_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]

companies_id_get

Company companies_id_get(id)

Get a company

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

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

Parameters

Name Type Description Notes
id str

Return type

Company

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]

companies_id_patch

Company companies_id_patch(id, body)

Update a company

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.CompaniesApi(brevo_python.ApiClient(configuration))
id = 'id_example' # str | 
body = brevo_python.Body7() # Body7 | Updated company details.

try:
    # Update a company
    api_response = api_instance.companies_id_patch(id, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CompaniesApi->companies_id_patch: %s\n" % e)

Parameters

Name Type Description Notes
id str
body Body7 Updated company details.

Return type

Company

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]

companies_import_post

InlineResponse2004 companies_import_post(file, mapping)

Import companies(creation and updation)

Import companies 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.CompaniesApi(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) company_id [brevo mongoID to update deals] (b) associated_contact (c) associated_deal (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 company ID or treat every row as create       \"unset_empty_attributes\": false // Determines whether unset a specific attribute during update if values input is blank       \"use_company_identifier\": false // Determines whether to use company name as identifier     } 

try:
    # Import companies(creation and updation)
    api_response = api_instance.companies_import_post(file, mapping)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CompaniesApi->companies_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) company_id [brevo mongoID to update deals] (b) associated_contact (c) associated_deal (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 company ID or treat every row as create "unset_empty_attributes": false // Determines whether unset a specific attribute during update if values input is blank "use_company_identifier": false // Determines whether to use company name as identifier }

Return type

InlineResponse2004

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]

companies_link_unlink_id_patch

companies_link_unlink_id_patch(id, body)

Link and Unlink company with contacts and 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.CompaniesApi(brevo_python.ApiClient(configuration))
id = 'id_example' # str | 
body = brevo_python.Body8() # Body8 | Linked / Unlinked contacts and deals ids.

try:
    # Link and Unlink company with contacts and deals
    api_instance.companies_link_unlink_id_patch(id, body)
except ApiException as e:
    print("Exception when calling CompaniesApi->companies_link_unlink_id_patch: %s\n" % e)

Parameters

Name Type Description Notes
id str
body Body8 Linked / Unlinked contacts and deals 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]

companies_post

InlineResponse2002 companies_post(body)

Create a company

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.CompaniesApi(brevo_python.ApiClient(configuration))
body = brevo_python.Body6() # Body6 | Company create data.

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

Parameters

Name Type Description Notes
body Body6 Company create data.

Return type

InlineResponse2002

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_attributes_companies_get

CompanyAttributes crm_attributes_companies_get()

Get company 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.CompaniesApi(brevo_python.ApiClient(configuration))

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

Parameters

This endpoint does not need any parameter.

Return type

CompanyAttributes

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_attributes_post

InlineResponse2003 crm_attributes_post(body)

Create a deal/company attribute

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.CompaniesApi(brevo_python.ApiClient(configuration))
body = brevo_python.Body9() # Body9 | Attribute creation data for company

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

Parameters

Name Type Description Notes
body Body9 Attribute creation data for company

Return type

InlineResponse2003

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]