Available Operations

availableTargets

List the available phone numbers

Example Usage

import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.channels.targets.availableTargets({});

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { channelsTargetsAvailableTargets } from "syllable-sdk/funcs/channelsTargetsAvailableTargets.js";

// Use `SyllableSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const syllableSDK = new SyllableSDKCore({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const res = await channelsTargetsAvailableTargets(syllableSDK, {});

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.AvailableTargetsRequestTRUEThe request object to use for the request.
optionsRequestOptionsFALSEUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitFALSEOptions 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.retriesRetryConfigFALSEEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ListResponseAvailableTarget>

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

list

Get Channel Targets

Example Usage

import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.channels.targets.list({});

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { channelsTargetsList } from "syllable-sdk/funcs/channelsTargetsList.js";

// Use `SyllableSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const syllableSDK = new SyllableSDKCore({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const res = await channelsTargetsList(syllableSDK, {});

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.ChannelTargetsListRequestTRUEThe request object to use for the request.
optionsRequestOptionsFALSEUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitFALSEOptions 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.retriesRetryConfigFALSEEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ListResponseChannelTarget>

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

create

Assign A Channel Target

Example Usage

import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.channels.targets.create({
    channelId: 134365,
    channelTargetCreateRequest: {
      channelId: 486589,
      agentId: 638424,
      target: "<value>",
      targetMode: "<value>",
      fallbackTarget: "<value>",
      isTest: true,
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { channelsTargetsCreate } from "syllable-sdk/funcs/channelsTargetsCreate.js";

// Use `SyllableSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const syllableSDK = new SyllableSDKCore({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const res = await channelsTargetsCreate(syllableSDK, {
    channelId: 134365,
    channelTargetCreateRequest: {
      channelId: 486589,
      agentId: 638424,
      target: "<value>",
      targetMode: "<value>",
      fallbackTarget: "<value>",
      isTest: true,
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.ChannelTargetsCreateRequestTRUEThe request object to use for the request.
optionsRequestOptionsFALSEUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitFALSEOptions 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.retriesRetryConfigFALSEEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ChannelTarget>

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

getById

Get A Channel Target

Example Usage

import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.channels.targets.getById({
    channelId: 931598,
    targetId: 505057,
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { channelsTargetsGetById } from "syllable-sdk/funcs/channelsTargetsGetById.js";

// Use `SyllableSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const syllableSDK = new SyllableSDKCore({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const res = await channelsTargetsGetById(syllableSDK, {
    channelId: 931598,
    targetId: 505057,
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.ChannelTargetsGetByIdRequestTRUEThe request object to use for the request.
optionsRequestOptionsFALSEUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitFALSEOptions 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.retriesRetryConfigFALSEEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ChannelTarget>

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

update

Update channel target by ID

Example Usage

import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.channels.targets.update({
    channelId: 627690,
    targetId: 488852,
    channelTargetUpdateRequest: {
      id: 857478,
      channelId: 597129,
      agentId: 344620,
      target: "<value>",
      targetMode: "<value>",
      fallbackTarget: "<value>",
      isTest: false,
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SyllableSDKCore } from "syllable-sdk/core.js";
import { channelsTargetsUpdate } from "syllable-sdk/funcs/channelsTargetsUpdate.js";

// Use `SyllableSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const syllableSDK = new SyllableSDKCore({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const res = await channelsTargetsUpdate(syllableSDK, {
    channelId: 627690,
    targetId: 488852,
    channelTargetUpdateRequest: {
      id: 857478,
      channelId: 597129,
      agentId: 344620,
      target: "<value>",
      targetMode: "<value>",
      fallbackTarget: "<value>",
      isTest: false,
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.ChannelTargetsUpdateRequestTRUEThe request object to use for the request.
optionsRequestOptionsFALSEUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitFALSEOptions 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.retriesRetryConfigFALSEEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ChannelTarget>

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*