Skip to content

Latest commit

 

History

History
438 lines (330 loc) · 13.9 KB

CompaniesApi.md

File metadata and controls

438 lines (330 loc) · 13.9 KB

CompaniesApi

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

Method HTTP request Description
companiesAttributesGet GET /companies/attributes Get company attributes
companiesGet GET /companies Get all companies
companiesIdDelete DELETE /companies/{id} Delete a company
companiesIdGet GET /companies/{id} Get a company
companiesIdPatch PATCH /companies/{id} Update a company
companiesLinkUnlinkIdPatch PATCH /companies/link-unlink/{id} Link and Unlink company with contacts and deals
companiesPost POST /companies Create a company

companiesAttributesGet

CompanyAttributes companiesAttributesGet()

Get company attributes

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.CompaniesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

CompaniesApi apiInstance = new CompaniesApi();
try {
    CompanyAttributes result = apiInstance.companiesAttributesGet();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CompaniesApi#companiesAttributesGet");
    e.printStackTrace();
}

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

companiesGet

CompaniesList companiesGet(filters, linkedContactsIds, linkedDealsIds, page, limit, sort, sortBy)

Get all companies

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.CompaniesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

CompaniesApi apiInstance = new CompaniesApi();
String filters = "filters_example"; // String | Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"5b1a17d914b73d35a76ca0c7\"}
Long linkedContactsIds = 789L; // Long | Filter by linked contacts ids
String linkedDealsIds = "linkedDealsIds_example"; // String | Filter by linked deals ids
Long page = 789L; // Long | Index of the first document of the page
Long limit = 50L; // Long | Number of documents per page
String sort = "sort_example"; // String | Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
String sortBy = "sortBy_example"; // String | The field used to sort field names.
try {
    CompaniesList result = apiInstance.companiesGet(filters, linkedContactsIds, linkedDealsIds, page, limit, sort, sortBy);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CompaniesApi#companiesGet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
filters String Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"5b1a17d914b73d35a76ca0c7"} [optional]
linkedContactsIds Long Filter by linked contacts ids [optional]
linkedDealsIds String Filter by linked deals ids [optional]
page Long Index of the first document of the page [optional]
limit Long Number of documents per page [optional] [default to 50]
sort String Sort the results in the ascending/descending order. Default order is descending by creation if `sort` is not passed [optional] [enum: asc, desc]
sortBy String 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

companiesIdDelete

companiesIdDelete(id)

Delete a company

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.CompaniesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

CompaniesApi apiInstance = new CompaniesApi();
String id = "id_example"; // String | 
try {
    apiInstance.companiesIdDelete(id);
} catch (ApiException e) {
    System.err.println("Exception when calling CompaniesApi#companiesIdDelete");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

companiesIdGet

Company companiesIdGet(id)

Get a company

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.CompaniesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

CompaniesApi apiInstance = new CompaniesApi();
String id = "id_example"; // String | 
try {
    Company result = apiInstance.companiesIdGet(id);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CompaniesApi#companiesIdGet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String

Return type

Company

Authorization

api-key, partner-key

HTTP request headers

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

companiesIdPatch

Company companiesIdPatch(id, body)

Update a company

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.CompaniesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

CompaniesApi apiInstance = new CompaniesApi();
String id = "id_example"; // String | 
Body4 body = new Body4(); // Body4 | Updated company details.
try {
    Company result = apiInstance.companiesIdPatch(id, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CompaniesApi#companiesIdPatch");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String
body Body4 Updated company details.

Return type

Company

Authorization

api-key, partner-key

HTTP request headers

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

companiesLinkUnlinkIdPatch

companiesLinkUnlinkIdPatch(id, body)

Link and Unlink company with contacts and deals

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.CompaniesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

CompaniesApi apiInstance = new CompaniesApi();
String id = "id_example"; // String | 
Body5 body = new Body5(); // Body5 | Linked / Unlinked contacts and deals ids.
try {
    apiInstance.companiesLinkUnlinkIdPatch(id, body);
} catch (ApiException e) {
    System.err.println("Exception when calling CompaniesApi#companiesLinkUnlinkIdPatch");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String
body Body5 Linked / Unlinked contacts and deals ids.

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

companiesPost

InlineResponse2002 companiesPost(body)

Create a company

Example

// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.CompaniesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

CompaniesApi apiInstance = new CompaniesApi();
Body3 body = new Body3(); // Body3 | Company create data.
try {
    InlineResponse2002 result = apiInstance.companiesPost(body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CompaniesApi#companiesPost");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body Body3 Company create data.

Return type

InlineResponse2002

Authorization

api-key, partner-key

HTTP request headers

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