You can get all companies you’ve interacted with in your workspace using the companies
query. This endpoint supports Pagination.
For this query you need the following permissions:
import { PlainClient } from '@team-plain/typescript-sdk';
const client = new PlainClient({ apiKey: 'plainApiKey_xxx' });
const res = await client.getCompanies({
first: 25,
});
if (res.error) {
console.error(res.error);
} else {
console.log(res.data);
}
import { PlainClient } from '@team-plain/typescript-sdk';
const client = new PlainClient({ apiKey: 'plainApiKey_xxx' });
const res = await client.getCompanies({
first: 25,
});
if (res.error) {
console.error(res.error);
} else {
console.log(res.data);
}
query getCompanies($cursor: String!) {
companies(after: $cursor, first: 50) {
edges {
node {
id
name
logoUrl
domainName
}
}
pageInfo {
hasPreviousPage
hasNextPage
startCursor
endCursor
}
}
}
{
"cursor": "eyJjb21wYW5pZXMubmFtZSI6IuyYpOuIhOydtCIsImNvbXBhbmllcy5pZCI6ImNvXzAxSFJSTVJQRVJaQ0s0MkhUUEQ0SlE1N05CIn0"
}