Class: TheCompaniesAPI::Client
- Inherits:
-
HttpClient
- Object
- HttpClient
- TheCompaniesAPI::Client
- Defined in:
- lib/thecompaniesapi/client.rb
Overview
The Companies API client with auto-generated methods
This class extends HttpClient with auto-generated methods from the OpenAPI specification.
Constant Summary
Constants inherited from HttpClient
HttpClient::DEFAULT_API_URL, HttpClient::DEFAULT_TIMEOUT
Instance Attribute Summary
Attributes inherited from HttpClient
#api_token, #api_url, #connection, #visitor_id
Instance Method Summary collapse
-
#ask_company(domain, data: {}, headers: {}) ⇒ Hash
Ask a question about a company by its domain.
-
#count_companies(params: {}, headers: {}) ⇒ Hash
Get the count of companies using a segmentation query.
-
#count_companies_post(data: {}, headers: {}) ⇒ Hash
Get the count of companies using a segmentation body.
-
#create_list(data: {}, headers: {}) ⇒ Hash
Create a new list.
-
#delete_list(list_id, params: {}, headers: {}) ⇒ Hash
Delete a list.
-
#delete_prompt(prompt_id, params: {}, headers: {}) ⇒ Hash
Delete a prompt.
-
#enrich_job_titles(params: {}, headers: {}) ⇒ Hash
Enrich job titles.
-
#export_companies_analytics(data: {}, headers: {}) ⇒ Hash
Export analytics data for search segmentations and lists.
-
#fetch_actions(params: {}, headers: {}) ⇒ Hash
Get and filter your actions.
-
#fetch_api_health(params: {}, headers: {}) ⇒ Hash
Get the health status of the API.
-
#fetch_companies_analytics(params: {}, headers: {}) ⇒ Hash
Fetch analytics data for search segmentations and lists.
-
#fetch_companies_in_list(list_id, params: {}, headers: {}) ⇒ Hash
Get companies in a list with a segmentation query.
-
#fetch_companies_in_list_post(list_id, data: {}, headers: {}) ⇒ Hash
Get companies in a list with a segmentation body.
-
#fetch_company(domain, params: {}, headers: {}) ⇒ Hash
Get a single company data by its domain.
-
#fetch_company_by_email(params: {}, headers: {}) ⇒ Hash
Get a company data by email.
-
#fetch_company_by_social(params: {}, headers: {}) ⇒ Hash
Get a company data by social media.
-
#fetch_company_context(domain, params: {}, headers: {}) ⇒ Hash
Get the full context of a company by its domain.
-
#fetch_company_email_patterns(domain, params: {}, headers: {}) ⇒ Hash
Get email patterns for a company by its domain.
-
#fetch_company_in_list(list_id, domain, params: {}, headers: {}) ⇒ Hash
Get a company in a list.
-
#fetch_lists(params: {}, headers: {}) ⇒ Hash
Get and filter your lists.
-
#fetch_open_api(params: {}, headers: {}) ⇒ Hash
Get the current OpenAPI specification.
-
#fetch_prompts(params: {}, headers: {}) ⇒ Hash
Fetch prompts history.
-
#fetch_team(team_id, params: {}, headers: {}) ⇒ Hash
Get team information.
-
#fetch_user(params: {}, headers: {}) ⇒ Hash
Get current user information.
-
#product_prompt(data: {}, headers: {}) ⇒ Hash
Query the product prompt.
-
#prompt_to_segmentation(data: {}, headers: {}) ⇒ Hash
Convert a query to a segmentation.
-
#request_action(data: {}, headers: {}) ⇒ Hash
Request or estimate a new action.
-
#retry_action(action_id, data: {}, headers: {}) ⇒ Hash
Ask for a retry of failed action.
-
#search_cities(params: {}, headers: {}) ⇒ Hash
Search cities.
-
#search_companies(params: {}, headers: {}) ⇒ Hash
Search companies using a segmentation query.
-
#search_companies_by_name(params: {}, headers: {}) ⇒ Hash
Search companies by name.
-
#search_companies_by_prompt(params: {}, headers: {}) ⇒ Hash
Search companies by prompt.
-
#search_companies_post(data: {}, headers: {}) ⇒ Hash
Search companies using a segmentation query.
-
#search_continents(params: {}, headers: {}) ⇒ Hash
Search continents.
-
#search_counties(params: {}, headers: {}) ⇒ Hash
Search counties.
-
#search_countries(params: {}, headers: {}) ⇒ Hash
Search countries.
-
#search_industries(params: {}, headers: {}) ⇒ Hash
Search industries.
-
#search_industries_similar(params: {}, headers: {}) ⇒ Hash
Get similar industries from one or many industries.
-
#search_similar_companies(params: {}, headers: {}) ⇒ Hash
Get similar companies from one or many domains.
-
#search_states(params: {}, headers: {}) ⇒ Hash
Search states.
-
#search_technologies(params: {}, headers: {}) ⇒ Hash
Search technologies.
-
#toggle_companies_in_list(list_id, data: {}, headers: {}) ⇒ Hash
Toggle one or more companies in a list.
-
#update_list(list_id, data: {}, headers: {}) ⇒ Hash
Update a list.
-
#update_team(team_id, data: {}, headers: {}) ⇒ Hash
Update a team.
Methods inherited from HttpClient
#delete, #get, #initialize, #patch, #post, #put
Constructor Details
This class inherits a constructor from TheCompaniesAPI::HttpClient
Instance Method Details
#ask_company(domain, data: {}, headers: {}) ⇒ Hash
Ask a question about a company by its domain.
248 249 250 251 252 |
# File 'lib/thecompaniesapi/client.rb', line 248 def ask_company(domain, data: {}, headers: {}) endpoint = "/v2/companies/#{domain}/ask" post(endpoint, body: data) end |
#count_companies(params: {}, headers: {}) ⇒ Hash
Get the count of companies using a segmentation query.
176 177 178 179 180 |
# File 'lib/thecompaniesapi/client.rb', line 176 def count_companies(params: {}, headers: {}) endpoint = '/v2/companies/count' get(endpoint, params: params) end |
#count_companies_post(data: {}, headers: {}) ⇒ Hash
Get the count of companies using a segmentation body.
190 191 192 193 194 |
# File 'lib/thecompaniesapi/client.rb', line 190 def count_companies_post(data: {}, headers: {}) endpoint = '/v2/companies/count' post(endpoint, body: data) end |
#create_list(data: {}, headers: {}) ⇒ Hash
Create a new list.
445 446 447 448 449 |
# File 'lib/thecompaniesapi/client.rb', line 445 def create_list(data: {}, headers: {}) endpoint = '/v2/lists' post(endpoint, body: data) end |
#delete_list(list_id, params: {}, headers: {}) ⇒ Hash
Delete a list.
475 476 477 478 479 |
# File 'lib/thecompaniesapi/client.rb', line 475 def delete_list(list_id, params: {}, headers: {}) endpoint = "/v2/lists/#{list_id}" delete(endpoint, params: params) end |
#delete_prompt(prompt_id, params: {}, headers: {}) ⇒ Hash
Delete a prompt.
609 610 611 612 613 |
# File 'lib/thecompaniesapi/client.rb', line 609 def delete_prompt(prompt_id, params: {}, headers: {}) endpoint = "/v2/prompts/#{prompt_id}" delete(endpoint, params: params) end |
#enrich_job_titles(params: {}, headers: {}) ⇒ Hash
Enrich job titles.
417 418 419 420 421 |
# File 'lib/thecompaniesapi/client.rb', line 417 def enrich_job_titles(params: {}, headers: {}) endpoint = '/v2/job-titles/enrich' get(endpoint, params: params) end |
#export_companies_analytics(data: {}, headers: {}) ⇒ Hash
Export analytics data for search segmentations and lists.
291 292 293 294 295 |
# File 'lib/thecompaniesapi/client.rb', line 291 def export_companies_analytics(data: {}, headers: {}) endpoint = '/v2/companies/analytics/export' post(endpoint, body: data) end |
#fetch_actions(params: {}, headers: {}) ⇒ Hash
Get and filter your actions.
48 49 50 51 52 |
# File 'lib/thecompaniesapi/client.rb', line 48 def fetch_actions(params: {}, headers: {}) endpoint = '/v2/actions' get(endpoint, params: params) end |
#fetch_api_health(params: {}, headers: {}) ⇒ Hash
Get the health status of the API.
20 21 22 23 24 |
# File 'lib/thecompaniesapi/client.rb', line 20 def fetch_api_health(params: {}, headers: {}) endpoint = '/' get(endpoint, params: params) end |
#fetch_companies_analytics(params: {}, headers: {}) ⇒ Hash
Fetch analytics data for search segmentations and lists.
277 278 279 280 281 |
# File 'lib/thecompaniesapi/client.rb', line 277 def fetch_companies_analytics(params: {}, headers: {}) endpoint = '/v2/companies/analytics' get(endpoint, params: params) end |
#fetch_companies_in_list(list_id, params: {}, headers: {}) ⇒ Hash
Get companies in a list with a segmentation query.
490 491 492 493 494 |
# File 'lib/thecompaniesapi/client.rb', line 490 def fetch_companies_in_list(list_id, params: {}, headers: {}) endpoint = "/v2/lists/#{list_id}/companies" get(endpoint, params: params) end |
#fetch_companies_in_list_post(list_id, data: {}, headers: {}) ⇒ Hash
Get companies in a list with a segmentation body.
505 506 507 508 509 |
# File 'lib/thecompaniesapi/client.rb', line 505 def fetch_companies_in_list_post(list_id, data: {}, headers: {}) endpoint = "/v2/lists/#{list_id}/companies" post(endpoint, body: data) end |
#fetch_company(domain, params: {}, headers: {}) ⇒ Hash
Get a single company data by its domain.
120 121 122 123 124 |
# File 'lib/thecompaniesapi/client.rb', line 120 def fetch_company(domain, params: {}, headers: {}) endpoint = "/v2/companies/#{domain}" get(endpoint, params: params) end |
#fetch_company_by_email(params: {}, headers: {}) ⇒ Hash
Get a company data by email.
204 205 206 207 208 |
# File 'lib/thecompaniesapi/client.rb', line 204 def fetch_company_by_email(params: {}, headers: {}) endpoint = '/v2/companies/by-email' get(endpoint, params: params) end |
#fetch_company_by_social(params: {}, headers: {}) ⇒ Hash
Get a company data by social media.
218 219 220 221 222 |
# File 'lib/thecompaniesapi/client.rb', line 218 def (params: {}, headers: {}) endpoint = '/v2/companies/by-social' get(endpoint, params: params) end |
#fetch_company_context(domain, params: {}, headers: {}) ⇒ Hash
Get the full context of a company by its domain.
263 264 265 266 267 |
# File 'lib/thecompaniesapi/client.rb', line 263 def fetch_company_context(domain, params: {}, headers: {}) endpoint = "/v2/companies/#{domain}/context" get(endpoint, params: params) end |
#fetch_company_email_patterns(domain, params: {}, headers: {}) ⇒ Hash
Get email patterns for a company by its domain.
233 234 235 236 237 |
# File 'lib/thecompaniesapi/client.rb', line 233 def fetch_company_email_patterns(domain, params: {}, headers: {}) endpoint = "/v2/companies/#{domain}/email-patterns" get(endpoint, params: params) end |
#fetch_company_in_list(list_id, domain, params: {}, headers: {}) ⇒ Hash
Get a company in a list.
521 522 523 524 525 |
# File 'lib/thecompaniesapi/client.rb', line 521 def fetch_company_in_list(list_id, domain, params: {}, headers: {}) endpoint = "/v2/lists/#{list_id}/companies/#{domain}" get(endpoint, params: params) end |
#fetch_lists(params: {}, headers: {}) ⇒ Hash
Get and filter your lists.
431 432 433 434 435 |
# File 'lib/thecompaniesapi/client.rb', line 431 def fetch_lists(params: {}, headers: {}) endpoint = '/v2/lists' get(endpoint, params: params) end |
#fetch_open_api(params: {}, headers: {}) ⇒ Hash
Get the current OpenAPI specification.
34 35 36 37 38 |
# File 'lib/thecompaniesapi/client.rb', line 34 def fetch_open_api(params: {}, headers: {}) endpoint = '/v2/openapi' get(endpoint, params: params) end |
#fetch_prompts(params: {}, headers: {}) ⇒ Hash
Fetch prompts history.
594 595 596 597 598 |
# File 'lib/thecompaniesapi/client.rb', line 594 def fetch_prompts(params: {}, headers: {}) endpoint = '/v2/prompts' get(endpoint, params: params) end |
#fetch_team(team_id, params: {}, headers: {}) ⇒ Hash
Get team information.
551 552 553 554 555 |
# File 'lib/thecompaniesapi/client.rb', line 551 def fetch_team(team_id, params: {}, headers: {}) endpoint = "/v2/teams/#{team_id}" get(endpoint, params: params) end |
#fetch_user(params: {}, headers: {}) ⇒ Hash
Get current user information.
580 581 582 583 584 |
# File 'lib/thecompaniesapi/client.rb', line 580 def fetch_user(params: {}, headers: {}) endpoint = '/v2/user' get(endpoint, params: params) end |
#product_prompt(data: {}, headers: {}) ⇒ Hash
Query the product prompt.
623 624 625 626 627 |
# File 'lib/thecompaniesapi/client.rb', line 623 def product_prompt(data: {}, headers: {}) endpoint = '/v2/prompts/product' post(endpoint, body: data) end |
#prompt_to_segmentation(data: {}, headers: {}) ⇒ Hash
Convert a query to a segmentation.
637 638 639 640 641 |
# File 'lib/thecompaniesapi/client.rb', line 637 def prompt_to_segmentation(data: {}, headers: {}) endpoint = '/v2/prompts/segmentation' post(endpoint, body: data) end |
#request_action(data: {}, headers: {}) ⇒ Hash
Request or estimate a new action.
62 63 64 65 66 |
# File 'lib/thecompaniesapi/client.rb', line 62 def request_action(data: {}, headers: {}) endpoint = '/v2/actions' post(endpoint, body: data) end |
#retry_action(action_id, data: {}, headers: {}) ⇒ Hash
Ask for a retry of failed action.
77 78 79 80 81 |
# File 'lib/thecompaniesapi/client.rb', line 77 def retry_action(action_id, data: {}, headers: {}) endpoint = "/v2/actions/#{action_id}/retry" post(endpoint, body: data) end |
#search_cities(params: {}, headers: {}) ⇒ Hash
Search cities.
347 348 349 350 351 |
# File 'lib/thecompaniesapi/client.rb', line 347 def search_cities(params: {}, headers: {}) endpoint = '/v2/locations/cities' get(endpoint, params: params) end |
#search_companies(params: {}, headers: {}) ⇒ Hash
Search companies using a segmentation query.
91 92 93 94 95 |
# File 'lib/thecompaniesapi/client.rb', line 91 def search_companies(params: {}, headers: {}) endpoint = '/v2/companies' get(endpoint, params: params) end |
#search_companies_by_name(params: {}, headers: {}) ⇒ Hash
Search companies by name.
134 135 136 137 138 |
# File 'lib/thecompaniesapi/client.rb', line 134 def search_companies_by_name(params: {}, headers: {}) endpoint = '/v2/companies/by-name' get(endpoint, params: params) end |
#search_companies_by_prompt(params: {}, headers: {}) ⇒ Hash
Search companies by prompt.
148 149 150 151 152 |
# File 'lib/thecompaniesapi/client.rb', line 148 def search_companies_by_prompt(params: {}, headers: {}) endpoint = '/v2/companies/by-prompt' get(endpoint, params: params) end |
#search_companies_post(data: {}, headers: {}) ⇒ Hash
Search companies using a segmentation query.
105 106 107 108 109 |
# File 'lib/thecompaniesapi/client.rb', line 105 def search_companies_post(data: {}, headers: {}) endpoint = '/v2/companies' post(endpoint, body: data) end |
#search_continents(params: {}, headers: {}) ⇒ Hash
Search continents.
403 404 405 406 407 |
# File 'lib/thecompaniesapi/client.rb', line 403 def search_continents(params: {}, headers: {}) endpoint = '/v2/locations/continents' get(endpoint, params: params) end |
#search_counties(params: {}, headers: {}) ⇒ Hash
Search counties.
361 362 363 364 365 |
# File 'lib/thecompaniesapi/client.rb', line 361 def search_counties(params: {}, headers: {}) endpoint = '/v2/locations/counties' get(endpoint, params: params) end |
#search_countries(params: {}, headers: {}) ⇒ Hash
Search countries.
375 376 377 378 379 |
# File 'lib/thecompaniesapi/client.rb', line 375 def search_countries(params: {}, headers: {}) endpoint = '/v2/locations/countries' get(endpoint, params: params) end |
#search_industries(params: {}, headers: {}) ⇒ Hash
Search industries.
305 306 307 308 309 |
# File 'lib/thecompaniesapi/client.rb', line 305 def search_industries(params: {}, headers: {}) endpoint = '/v2/industries' get(endpoint, params: params) end |
#search_industries_similar(params: {}, headers: {}) ⇒ Hash
Get similar industries from one or many industries.
319 320 321 322 323 |
# File 'lib/thecompaniesapi/client.rb', line 319 def search_industries_similar(params: {}, headers: {}) endpoint = '/v2/industries/similar' get(endpoint, params: params) end |
#search_similar_companies(params: {}, headers: {}) ⇒ Hash
Get similar companies from one or many domains.
162 163 164 165 166 |
# File 'lib/thecompaniesapi/client.rb', line 162 def search_similar_companies(params: {}, headers: {}) endpoint = '/v2/companies/similar' get(endpoint, params: params) end |
#search_states(params: {}, headers: {}) ⇒ Hash
Search states.
389 390 391 392 393 |
# File 'lib/thecompaniesapi/client.rb', line 389 def search_states(params: {}, headers: {}) endpoint = '/v2/locations/states' get(endpoint, params: params) end |
#search_technologies(params: {}, headers: {}) ⇒ Hash
Search technologies.
333 334 335 336 337 |
# File 'lib/thecompaniesapi/client.rb', line 333 def search_technologies(params: {}, headers: {}) endpoint = '/v2/technologies' get(endpoint, params: params) end |
#toggle_companies_in_list(list_id, data: {}, headers: {}) ⇒ Hash
Toggle one or more companies in a list.
536 537 538 539 540 |
# File 'lib/thecompaniesapi/client.rb', line 536 def toggle_companies_in_list(list_id, data: {}, headers: {}) endpoint = "/v2/lists/#{list_id}/companies/toggle" patch(endpoint, body: data) end |
#update_list(list_id, data: {}, headers: {}) ⇒ Hash
Update a list.
460 461 462 463 464 |
# File 'lib/thecompaniesapi/client.rb', line 460 def update_list(list_id, data: {}, headers: {}) endpoint = "/v2/lists/#{list_id}" patch(endpoint, body: data) end |
#update_team(team_id, data: {}, headers: {}) ⇒ Hash
Update a team.
566 567 568 569 570 |
# File 'lib/thecompaniesapi/client.rb', line 566 def update_team(team_id, data: {}, headers: {}) endpoint = "/v2/teams/#{team_id}" patch(endpoint, body: data) end |