Class CompaniesApi

java.lang.Object
software.xdev.brevo.client.BaseApi
software.xdev.brevo.api.CompaniesApi

public class CompaniesApi extends BaseApi
  • Constructor Details

    • CompaniesApi

      public CompaniesApi()
    • CompaniesApi

      public CompaniesApi(ApiClient apiClient)
  • Method Details

    • companiesGet

      public CompaniesList companiesGet(@Nullable String filters, @Nullable Long linkedContactsIds, @Nullable String linkedDealsIds, @Nullable String modifiedSince, @Nullable String createdSince, @Nullable Long page, @Nullable Long limit, @Nullable String sort, @Nullable String sortBy) throws ApiException
      Get all Companies
      Parameters:
      filters - Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"6299dcf3874a14eacbc65c46\"} (optional)
      linkedContactsIds - Filter by linked contacts ids (optional)
      linkedDealsIds - Filter by linked Deals ids (optional)
      modifiedSince - 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)
      createdSince - 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 - Index of the first document of the page (optional)
      limit - Number of documents per page (optional)
      sort - Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
      sortBy - The field used to sort field names. (optional)
      Returns:
      CompaniesList
      Throws:
      ApiException - if fails to make API call
    • companiesGet

      public CompaniesList companiesGet(@Nullable String filters, @Nullable Long linkedContactsIds, @Nullable String linkedDealsIds, @Nullable String modifiedSince, @Nullable String createdSince, @Nullable Long page, @Nullable Long limit, @Nullable String sort, @Nullable String sortBy, Map<String,String> additionalHeaders) throws ApiException
      Get all Companies
      Parameters:
      filters - Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"6299dcf3874a14eacbc65c46\"} (optional)
      linkedContactsIds - Filter by linked contacts ids (optional)
      linkedDealsIds - Filter by linked Deals ids (optional)
      modifiedSince - 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)
      createdSince - 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 - Index of the first document of the page (optional)
      limit - Number of documents per page (optional)
      sort - Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed (optional)
      sortBy - The field used to sort field names. (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CompaniesList
      Throws:
      ApiException - if fails to make API call
    • companiesIdDelete

      public void companiesIdDelete(@Nonnull String id) throws ApiException
      Delete a company
      Parameters:
      id - Company ID to delete (required)
      Throws:
      ApiException - if fails to make API call
    • companiesIdDelete

      public void companiesIdDelete(@Nonnull String id, Map<String,String> additionalHeaders) throws ApiException
      Delete a company
      Parameters:
      id - Company ID to delete (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • companiesIdGet

      public Company companiesIdGet(@Nonnull String id) throws ApiException
      Get a company
      Parameters:
      id - Get Company Details (required)
      Returns:
      Company
      Throws:
      ApiException - if fails to make API call
    • companiesIdGet

      public Company companiesIdGet(@Nonnull String id, Map<String,String> additionalHeaders) throws ApiException
      Get a company
      Parameters:
      id - Get Company Details (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Company
      Throws:
      ApiException - if fails to make API call
    • companiesIdPatch

      public Company companiesIdPatch(@Nonnull String id, @Nonnull CompaniesIdPatchRequest companiesIdPatchRequest) throws ApiException
      Update a company
      Parameters:
      id - (required)
      companiesIdPatchRequest - Updated company details. (required)
      Returns:
      Company
      Throws:
      ApiException - if fails to make API call
    • companiesIdPatch

      public Company companiesIdPatch(@Nonnull String id, @Nonnull CompaniesIdPatchRequest companiesIdPatchRequest, Map<String,String> additionalHeaders) throws ApiException
      Update a company
      Parameters:
      id - (required)
      companiesIdPatchRequest - Updated company details. (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Company
      Throws:
      ApiException - if fails to make API call
    • companiesImportPost

      public CompaniesImportPost200Response companiesImportPost(@Nullable File _file, @Nullable Object mapping) throws ApiException
      Import companies(creation and updation) Import companies from a CSV file with mapping options.
      Parameters:
      _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 (optional)
      mapping - The mapping options in JSON format. Here is an example of the JSON structure: ```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 to unset a specific attribute during update if the values input is blank } ``` (optional)
      Returns:
      CompaniesImportPost200Response
      Throws:
      ApiException - if fails to make API call
    • companiesImportPost

      public CompaniesImportPost200Response companiesImportPost(@Nullable File _file, @Nullable Object mapping, Map<String,String> additionalHeaders) throws ApiException
      Import companies(creation and updation) Import companies from a CSV file with mapping options.
      Parameters:
      _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 (optional)
      mapping - The mapping options in JSON format. Here is an example of the JSON structure: ```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 to unset a specific attribute during update if the values input is blank } ``` (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CompaniesImportPost200Response
      Throws:
      ApiException - if fails to make API call
    • companiesLinkUnlinkIdPatch

      public void companiesLinkUnlinkIdPatch(@Nonnull String id, @Nonnull CompaniesLinkUnlinkIdPatchRequest companiesLinkUnlinkIdPatchRequest) throws ApiException
      Link and Unlink company with contact and deal
      Parameters:
      id - (required)
      companiesLinkUnlinkIdPatchRequest - Linked / Unlinked contacts and deals ids. (required)
      Throws:
      ApiException - if fails to make API call
    • companiesLinkUnlinkIdPatch

      public void companiesLinkUnlinkIdPatch(@Nonnull String id, @Nonnull CompaniesLinkUnlinkIdPatchRequest companiesLinkUnlinkIdPatchRequest, Map<String,String> additionalHeaders) throws ApiException
      Link and Unlink company with contact and deal
      Parameters:
      id - (required)
      companiesLinkUnlinkIdPatchRequest - Linked / Unlinked contacts and deals ids. (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • companiesPost

      public CompaniesPost200Response companiesPost(@Nonnull CompaniesPostRequest companiesPostRequest) throws ApiException
      Create a company
      Parameters:
      companiesPostRequest - Company create data. (required)
      Returns:
      CompaniesPost200Response
      Throws:
      ApiException - if fails to make API call
    • companiesPost

      public CompaniesPost200Response companiesPost(@Nonnull CompaniesPostRequest companiesPostRequest, Map<String,String> additionalHeaders) throws ApiException
      Create a company
      Parameters:
      companiesPostRequest - Company create data. (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CompaniesPost200Response
      Throws:
      ApiException - if fails to make API call
    • crmAttributesCompaniesGet

      public List<CompanyAttributesInner> crmAttributesCompaniesGet() throws ApiException
      Get company attributes
      Returns:
      List<CompanyAttributesInner>
      Throws:
      ApiException - if fails to make API call
    • crmAttributesCompaniesGet

      public List<CompanyAttributesInner> crmAttributesCompaniesGet(Map<String,String> additionalHeaders) throws ApiException
      Get company attributes
      Parameters:
      additionalHeaders - additionalHeaders for this call
      Returns:
      List<CompanyAttributesInner>
      Throws:
      ApiException - if fails to make API call
    • crmAttributesPost

      public CrmAttributesPost200Response crmAttributesPost(@Nonnull CrmAttributesPostRequest crmAttributesPostRequest) throws ApiException
      Create a company/deal attribute
      Parameters:
      crmAttributesPostRequest - Attribute creation data for a company/deal. (required)
      Returns:
      CrmAttributesPost200Response
      Throws:
      ApiException - if fails to make API call
    • crmAttributesPost

      public CrmAttributesPost200Response crmAttributesPost(@Nonnull CrmAttributesPostRequest crmAttributesPostRequest, Map<String,String> additionalHeaders) throws ApiException
      Create a company/deal attribute
      Parameters:
      crmAttributesPostRequest - Attribute creation data for a company/deal. (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      CrmAttributesPost200Response
      Throws:
      ApiException - if fails to make API call
    • invokeAPI

      public <T> T invokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String,String> additionalHeaders) throws ApiException
      Description copied from class: BaseApi
      Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
      Specified by:
      invokeAPI in class BaseApi
      Parameters:
      url - The URL for the request, either full URL or only the path.
      method - The HTTP method for the request.
      request - The request object.
      returnType - The return type.
      additionalHeaders - Additional headers for the request.
      Returns:
      The API response in the specified type.
      Throws:
      ApiException - if fails to make API call.