Affinity.CompaniesApi

All URIs are relative to https://api.affinity.co

Method HTTP request Description
getV2Companies GET /v2/companies Get all Companies
getV2CompaniesFields GET /v2/companies/fields Get metadata on Company Fields
getV2CompaniesId GET /v2/companies/{id} Get a single Company
getV2CompaniesIdListEntries GET /v2/companies/{id}/list-entries Get a Company's List Entries
getV2CompaniesIdLists GET /v2/companies/{id}/lists Get a Company's Lists

getV2Companies

CompanyPaged getV2Companies()

Paginate through Companies in Affinity. Returns basic information and non-list-specific field data on each Company. To retrieve field data, you must use either the fieldIds or the fieldTypes parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET /v2/companies/fields endpoint. When no fieldIds or fieldTypes are provided, Companies will be returned without any field data attached. To supply multiple fieldIds or fieldTypes parameters, generate a query string that looks like this: ?fieldIds=field-1234&fieldIds=affinity-data-location or ?fieldTypes=enriched&fieldTypes=global. Requires the "Export All Organizations directory" permission.

import { createConfiguration, CompaniesApi } from '@planet-a/affinity-node/v2';
import type { CompaniesApiGetV2CompaniesRequest } from '@planet-a/affinity-node/v2';

const configuration = createConfiguration();
const apiInstance = new CompaniesApi(configuration);

const request: CompaniesApiGetV2CompaniesRequest = {
// Cursor for the next or previous page (optional)
cursor: "cursor_example",
// Number of items to include in the page (optional)
limit: 100,
// Company IDs (optional)
ids: [
1,
],
// Field IDs for which to return field data (optional)
fieldIds: [
"fieldIds_example",
],
// Field Types for which to return field data (optional)
fieldTypes: [
"enriched",
],
};

const data = await apiInstance.getV2Companies(request);
console.log('API called successfully. Returned data:', data);
Name Type Description Notes
cursor [string] Cursor for the next or previous page (optional) defaults to undefined
limit [number] Number of items to include in the page (optional) defaults to 100
ids Array<number> Company IDs (optional) defaults to undefined
fieldIds Array<string> Field IDs for which to return field data (optional) defaults to undefined
fieldTypes Array<'enriched' | 'global' | 'relationship-intelligence'> Field Types for which to return field data (optional) defaults to undefined

CompanyPaged

bearerAuth

  • Content-Type: Not defined
  • Accept: application/json
Status code Description Response headers
200 Get all Companies * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
400 Bad Request * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
403 Forbidden * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
0 Errors * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getV2CompaniesFields

FieldMetadataPaged getV2CompaniesFields()

Returns metadata on non-list-specific Company Fields. Use the returned Field IDs to request field data from the GET /v2/companies and GET /v2/companies/{id} endpoints.

import { createConfiguration, CompaniesApi } from '@planet-a/affinity-node/v2';
import type { CompaniesApiGetV2CompaniesFieldsRequest } from '@planet-a/affinity-node/v2';

const configuration = createConfiguration();
const apiInstance = new CompaniesApi(configuration);

const request: CompaniesApiGetV2CompaniesFieldsRequest = {
// Cursor for the next or previous page (optional)
cursor: "cursor_example",
// Number of items to include in the page (optional)
limit: 100,
};

const data = await apiInstance.getV2CompaniesFields(request);
console.log('API called successfully. Returned data:', data);
Name Type Description Notes
cursor [string] Cursor for the next or previous page (optional) defaults to undefined
limit [number] Number of items to include in the page (optional) defaults to 100

FieldMetadataPaged

bearerAuth

  • Content-Type: Not defined
  • Accept: application/json
Status code Description Response headers
200 Get metadata on Company Fields * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
400 Bad Request * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
0 Errors * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getV2CompaniesId

Company getV2CompaniesId()

Returns basic information and non-list-specific field data on the requested Company. To retrieve field data, you must use either the fieldIds or the fieldTypes parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET /v2/companies/fields endpoint. When no fieldIds or fieldTypes are provided, Companies will be returned without any field data attached. To supply multiple fieldIds or fieldTypes parameters, generate a query string that looks like this: ?fieldIds=field-1234&fieldIds=affinity-data-location or ?fieldTypes=enriched&fieldTypes=global. Requires the "Export All Organizations directory" permission.

import { createConfiguration, CompaniesApi } from '@planet-a/affinity-node/v2';
import type { CompaniesApiGetV2CompaniesIdRequest } from '@planet-a/affinity-node/v2';

const configuration = createConfiguration();
const apiInstance = new CompaniesApi(configuration);

const request: CompaniesApiGetV2CompaniesIdRequest = {
// Company ID
id: 1,
// Field IDs for which to return field data (optional)
fieldIds: [
"fieldIds_example",
],
// Field Types for which to return field data (optional)
fieldTypes: [
"enriched",
],
};

const data = await apiInstance.getV2CompaniesId(request);
console.log('API called successfully. Returned data:', data);
Name Type Description Notes
id [number] Company ID defaults to undefined
fieldIds Array<string> Field IDs for which to return field data (optional) defaults to undefined
fieldTypes Array<'enriched' | 'global' | 'relationship-intelligence'> Field Types for which to return field data (optional) defaults to undefined

Company

bearerAuth

  • Content-Type: Not defined
  • Accept: application/json
Status code Description Response headers
200 Get a single Company * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
400 Bad Request * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
403 Forbidden * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
404 Not Found * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
0 Errors * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getV2CompaniesIdListEntries

ListEntryPaged getV2CompaniesIdListEntries()

Paginate through the List Entries (AKA rows) for the given Company across all Lists. Each List Entry includes field data for the Company, including list-specific field data. Each List Entry also includes metadata about its creation, i.e., when it was added to the List and by whom. Requires the "Export data from Lists" permission.

import { createConfiguration, CompaniesApi } from '@planet-a/affinity-node/v2';
import type { CompaniesApiGetV2CompaniesIdListEntriesRequest } from '@planet-a/affinity-node/v2';

const configuration = createConfiguration();
const apiInstance = new CompaniesApi(configuration);

const request: CompaniesApiGetV2CompaniesIdListEntriesRequest = {
// Company ID
id: 1,
// Cursor for the next or previous page (optional)
cursor: "cursor_example",
// Number of items to include in the page (optional)
limit: 100,
};

const data = await apiInstance.getV2CompaniesIdListEntries(request);
console.log('API called successfully. Returned data:', data);
Name Type Description Notes
id [number] Company ID defaults to undefined
cursor [string] Cursor for the next or previous page (optional) defaults to undefined
limit [number] Number of items to include in the page (optional) defaults to 100

ListEntryPaged

bearerAuth

  • Content-Type: Not defined
  • Accept: application/json
Status code Description Response headers
200 Get a Company&#39;s List Entries * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
400 Bad Request * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
403 Forbidden * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
404 Not Found * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
0 Errors * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getV2CompaniesIdLists

ListPaged getV2CompaniesIdLists()

Returns metadata for all the Lists on which the given Company appears.

import { createConfiguration, CompaniesApi } from '@planet-a/affinity-node/v2';
import type { CompaniesApiGetV2CompaniesIdListsRequest } from '@planet-a/affinity-node/v2';

const configuration = createConfiguration();
const apiInstance = new CompaniesApi(configuration);

const request: CompaniesApiGetV2CompaniesIdListsRequest = {
// Company ID
id: 1,
// Cursor for the next or previous page (optional)
cursor: "cursor_example",
// Number of items to include in the page (optional)
limit: 100,
};

const data = await apiInstance.getV2CompaniesIdLists(request);
console.log('API called successfully. Returned data:', data);
Name Type Description Notes
id [number] Company ID defaults to undefined
cursor [string] Cursor for the next or previous page (optional) defaults to undefined
limit [number] Number of items to include in the page (optional) defaults to 100

ListPaged

bearerAuth

  • Content-Type: Not defined
  • Accept: application/json
Status code Description Response headers
200 Get a Company&#39;s Lists * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
400 Bad Request * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
404 Not Found * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -
0 Errors * X-Ratelimit-Limit-User -
* X-Ratelimit-Limit-User-Remaining -
* X-Ratelimit-Limit-User-Reset -
* X-Ratelimit-Limit-Org -
* X-Ratelimit-Limit-Org-Remaining -
* X-Ratelimit-Limit-Org-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]