Class CompaniesClient

java.lang.Object
com.intercom.api.resources.companies.CompaniesClient

public class CompaniesClient extends Object
  • Field Details

  • Constructor Details

    • CompaniesClient

      public CompaniesClient(ClientOptions clientOptions)
  • Method Details

    • withRawResponse

      public RawCompaniesClient withRawResponse()
      Get responses with HTTP metadata like headers
    • retrieve

      public CompaniesRetrieveResponse retrieve()
      You can fetch a single company by passing in company_id or name.

      https://api.intercom.io/companies?name={name}

      https://api.intercom.io/companies?company_id={company_id}

      You can fetch all companies and filter by segment_id or tag_id as a query parameter.

      https://api.intercom.io/companies?tag_id={tag_id}

      https://api.intercom.io/companies?segment_id={segment_id}

    • retrieve

      You can fetch a single company by passing in company_id or name.

      https://api.intercom.io/companies?name={name}

      https://api.intercom.io/companies?company_id={company_id}

      You can fetch all companies and filter by segment_id or tag_id as a query parameter.

      https://api.intercom.io/companies?tag_id={tag_id}

      https://api.intercom.io/companies?segment_id={segment_id}

    • retrieve

      public CompaniesRetrieveResponse retrieve(RetrieveCompanyRequest request, RequestOptions requestOptions)
      You can fetch a single company by passing in company_id or name.

      https://api.intercom.io/companies?name={name}

      https://api.intercom.io/companies?company_id={company_id}

      You can fetch all companies and filter by segment_id or tag_id as a query parameter.

      https://api.intercom.io/companies?tag_id={tag_id}

      https://api.intercom.io/companies?segment_id={segment_id}

    • createOrUpdate

      public Company createOrUpdate()
      You can create or update a company.

      Companies will be only visible in Intercom when there is at least one associated user.

      Companies are looked up via company_id in a POST request, if not found via company_id, the new company will be created, if found, that company will be updated.

      {% admonition type="warning" name="Using company_id" %} You can set a unique company_id value when creating a company. However, it is not possible to update company_id. Be sure to set a unique value once upon creation of the company. {% /admonition %}

    • createOrUpdate

      public Company createOrUpdate(CreateOrUpdateCompanyRequest request)
      You can create or update a company.

      Companies will be only visible in Intercom when there is at least one associated user.

      Companies are looked up via company_id in a POST request, if not found via company_id, the new company will be created, if found, that company will be updated.

      {% admonition type="warning" name="Using company_id" %} You can set a unique company_id value when creating a company. However, it is not possible to update company_id. Be sure to set a unique value once upon creation of the company. {% /admonition %}

    • createOrUpdate

      public Company createOrUpdate(CreateOrUpdateCompanyRequest request, RequestOptions requestOptions)
      You can create or update a company.

      Companies will be only visible in Intercom when there is at least one associated user.

      Companies are looked up via company_id in a POST request, if not found via company_id, the new company will be created, if found, that company will be updated.

      {% admonition type="warning" name="Using company_id" %} You can set a unique company_id value when creating a company. However, it is not possible to update company_id. Be sure to set a unique value once upon creation of the company. {% /admonition %}

    • find

      public Company find(FindCompanyRequest request)
      You can fetch a single company.
    • find

      public Company find(FindCompanyRequest request, RequestOptions requestOptions)
      You can fetch a single company.
    • update

      public Company update(UpdateCompanyRequest request)
      You can update a single company using the Intercom provisioned id.

      {% admonition type="warning" name="Using company_id" %} When updating a company it is not possible to update company_id. This can only be set once upon creation of the company. {% /admonition %}

    • update

      public Company update(UpdateCompanyRequest request, RequestOptions requestOptions)
      You can update a single company using the Intercom provisioned id.

      {% admonition type="warning" name="Using company_id" %} When updating a company it is not possible to update company_id. This can only be set once upon creation of the company. {% /admonition %}

    • delete

      public DeletedCompanyObject delete(DeleteCompanyRequest request)
      You can delete a single company.
    • delete

      public DeletedCompanyObject delete(DeleteCompanyRequest request, RequestOptions requestOptions)
      You can delete a single company.
    • listAttachedContacts

      public CompanyAttachedContacts listAttachedContacts(ListAttachedContactsRequest request)
      You can fetch a list of all contacts that belong to a company.
    • listAttachedContacts

      public CompanyAttachedContacts listAttachedContacts(ListAttachedContactsRequest request, RequestOptions requestOptions)
      You can fetch a list of all contacts that belong to a company.
    • listAttachedSegments

      public CompanyAttachedSegments listAttachedSegments(ListSegmentsAttachedToCompanyRequest request)
      You can fetch a list of all segments that belong to a company.
    • listAttachedSegments

      public CompanyAttachedSegments listAttachedSegments(ListSegmentsAttachedToCompanyRequest request, RequestOptions requestOptions)
      You can fetch a list of all segments that belong to a company.
    • list

      public SyncPagingIterable<Company> list()
      You can list companies. The company list is sorted by the last_request_at field and by default is ordered descending, most recently requested first.

      Note that the API does not include companies who have no associated users in list responses.

      When using the Companies endpoint and the pages object to iterate through the returned companies, there is a limit of 10,000 Companies that can be returned. If you need to list or iterate on more than 10,000 Companies, please use the Scroll API. {% admonition type="warning" name="Pagination" %} You can use pagination to limit the number of results returned. The default is 20 results per page. See the pagination section for more details on how to use the starting_after param. {% /admonition %}

    • list

      You can list companies. The company list is sorted by the last_request_at field and by default is ordered descending, most recently requested first.

      Note that the API does not include companies who have no associated users in list responses.

      When using the Companies endpoint and the pages object to iterate through the returned companies, there is a limit of 10,000 Companies that can be returned. If you need to list or iterate on more than 10,000 Companies, please use the Scroll API. {% admonition type="warning" name="Pagination" %} You can use pagination to limit the number of results returned. The default is 20 results per page. See the pagination section for more details on how to use the starting_after param. {% /admonition %}

    • list

      public SyncPagingIterable<Company> list(ListCompaniesRequest request, RequestOptions requestOptions)
      You can list companies. The company list is sorted by the last_request_at field and by default is ordered descending, most recently requested first.

      Note that the API does not include companies who have no associated users in list responses.

      When using the Companies endpoint and the pages object to iterate through the returned companies, there is a limit of 10,000 Companies that can be returned. If you need to list or iterate on more than 10,000 Companies, please use the Scroll API. {% admonition type="warning" name="Pagination" %} You can use pagination to limit the number of results returned. The default is 20 results per page. See the pagination section for more details on how to use the starting_after param. {% /admonition %}

    • scroll

      public SyncPagingIterable<Company> scroll()
      The list all companies functionality does not work well for huge datasets, and can result in errors and performance problems when paging deeply. The Scroll API provides an efficient mechanism for iterating over all companies in a dataset.
      • Each app can only have 1 scroll open at a time. You'll get an error message if you try to have more than one open per app.
      • If the scroll isn't used for 1 minute, it expires and calls with that scroll param will fail
      • If the end of the scroll is reached, "companies" will be empty and the scroll parameter will expire

      {% admonition type="info" name="Scroll Parameter" %} You can get the first page of companies by simply sending a GET request to the scroll endpoint. For subsequent requests you will need to use the scroll parameter from the response. {% /admonition %} {% admonition type="danger" name="Scroll network timeouts" %} Since scroll is often used on large datasets network errors such as timeouts can be encountered. When this occurs you will see a HTTP 500 error with the following message: "Request failed due to an internal network error. Please restart the scroll operation." If this happens, you will need to restart your scroll query: It is not possible to continue from a specific point when using scroll. {% /admonition %}

    • scroll

      The list all companies functionality does not work well for huge datasets, and can result in errors and performance problems when paging deeply. The Scroll API provides an efficient mechanism for iterating over all companies in a dataset.
      • Each app can only have 1 scroll open at a time. You'll get an error message if you try to have more than one open per app.
      • If the scroll isn't used for 1 minute, it expires and calls with that scroll param will fail
      • If the end of the scroll is reached, "companies" will be empty and the scroll parameter will expire

      {% admonition type="info" name="Scroll Parameter" %} You can get the first page of companies by simply sending a GET request to the scroll endpoint. For subsequent requests you will need to use the scroll parameter from the response. {% /admonition %} {% admonition type="danger" name="Scroll network timeouts" %} Since scroll is often used on large datasets network errors such as timeouts can be encountered. When this occurs you will see a HTTP 500 error with the following message: "Request failed due to an internal network error. Please restart the scroll operation." If this happens, you will need to restart your scroll query: It is not possible to continue from a specific point when using scroll. {% /admonition %}

    • scroll

      public SyncPagingIterable<Company> scroll(ScrollCompaniesRequest request, RequestOptions requestOptions)
      The list all companies functionality does not work well for huge datasets, and can result in errors and performance problems when paging deeply. The Scroll API provides an efficient mechanism for iterating over all companies in a dataset.
      • Each app can only have 1 scroll open at a time. You'll get an error message if you try to have more than one open per app.
      • If the scroll isn't used for 1 minute, it expires and calls with that scroll param will fail
      • If the end of the scroll is reached, "companies" will be empty and the scroll parameter will expire

      {% admonition type="info" name="Scroll Parameter" %} You can get the first page of companies by simply sending a GET request to the scroll endpoint. For subsequent requests you will need to use the scroll parameter from the response. {% /admonition %} {% admonition type="danger" name="Scroll network timeouts" %} Since scroll is often used on large datasets network errors such as timeouts can be encountered. When this occurs you will see a HTTP 500 error with the following message: "Request failed due to an internal network error. Please restart the scroll operation." If this happens, you will need to restart your scroll query: It is not possible to continue from a specific point when using scroll. {% /admonition %}

    • attachContact

      public Company attachContact(AttachContactToCompanyRequest request)
      You can attach a company to a single contact.
    • attachContact

      public Company attachContact(AttachContactToCompanyRequest request, RequestOptions requestOptions)
      You can attach a company to a single contact.
    • detachContact

      public Company detachContact(DetachContactFromCompanyRequest request)
      You can detach a company from a single contact.
    • detachContact

      public Company detachContact(DetachContactFromCompanyRequest request, RequestOptions requestOptions)
      You can detach a company from a single contact.