buena-typescript-sdk
Version:
Official TypeScript SDK for Buena.ai API - LinkedIn automation and lead management
358 lines (254 loc) • 26.6 kB
Markdown
Buena.ai API v2: The most powerful LinkedIn automation and lead management API for modern sales teams and developers.
* [healthCheck](
* [createApiKey](
* [listApiKeys](
* [listLeads](
* [createLead](
Check the API status and health
```typescript
import { SDK } from "openapi";
const sdk = new SDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await sdk.healthCheck();
console.log(result);
}
run();
```
The standalone function version of this method:
```typescript
import { SDKCore } from "openapi/core.js";
import { healthCheck } from "openapi/funcs/healthCheck.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await healthCheck(sdk);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("healthCheck failed:", res.error);
}
}
run();
```
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
**Promise\<[operations.HealthCheckResponse](../../models/operations/healthcheckresponse.md)\>**
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| errors.SDKDefaultError | 4XX, 5XX | \*/\* |
Create a new API key
```typescript
import { SDK } from "openapi";
const sdk = new SDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await sdk.createApiKey({});
console.log(result);
}
run();
```
The standalone function version of this method:
```typescript
import { SDKCore } from "openapi/core.js";
import { createApiKey } from "openapi/funcs/createApiKey.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await createApiKey(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("createApiKey failed:", res.error);
}
}
run();
```
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request` | [operations.CreateApiKeyRequest](../../models/operations/createapikeyrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
**Promise\<[models.ApiKey](../../models/apikey.md)\>**
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| errors.ErrorT | 400 | application/json |
| errors.SDKDefaultError | 4XX, 5XX | \*/\* |
List all API keys for the user
```typescript
import { SDK } from "openapi";
const sdk = new SDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await sdk.listApiKeys();
console.log(result);
}
run();
```
The standalone function version of this method:
```typescript
import { SDKCore } from "openapi/core.js";
import { listApiKeys } from "openapi/funcs/listApiKeys.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await listApiKeys(sdk);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("listApiKeys failed:", res.error);
}
}
run();
```
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
**Promise\<[models.ApiKey[]](../../models/.md)\>**
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| errors.SDKDefaultError | 4XX, 5XX | \*/\* |
Get a list of leads with optional filtering
```typescript
import { SDK } from "openapi";
const sdk = new SDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await sdk.listLeads({});
console.log(result);
}
run();
```
The standalone function version of this method:
```typescript
import { SDKCore } from "openapi/core.js";
import { listLeads } from "openapi/funcs/listLeads.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await listLeads(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("listLeads failed:", res.error);
}
}
run();
```
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request` | [operations.ListLeadsRequest](../../models/operations/listleadsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
**Promise\<[operations.ListLeadsResponse](../../models/operations/listleadsresponse.md)\>**
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| errors.SDKDefaultError | 4XX, 5XX | \*/\* |
Create a new lead
```typescript
import { SDK } from "openapi";
const sdk = new SDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await sdk.createLead({
firstName: "Janick",
lastName: "Fahey",
});
console.log(result);
}
run();
```
The standalone function version of this method:
```typescript
import { SDKCore } from "openapi/core.js";
import { createLead } from "openapi/funcs/createLead.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await createLead(sdk, {
firstName: "Janick",
lastName: "Fahey",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("createLead failed:", res.error);
}
}
run();
```
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request` | [models.CreateLeadRequest](../../models/createleadrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
**Promise\<[models.Lead](../../models/lead.md)\>**
| Error Type | Status Code | Content Type |
| ---------------------- | ---------------------- | ---------------------- |
| errors.SDKDefaultError | 4XX, 5XX | \*/\* |