intercom-client
Version:
Official Node bindings to the Intercom API
68 lines (67 loc) • 3.01 kB
TypeScript
/**
* This file was auto-generated by Fern from our API Definition.
*/
import * as environments from "../../../../environments";
import * as core from "../../../../core";
import * as Intercom from "../../../index";
export declare namespace PhoneCallRedirects {
interface Options {
environment?: core.Supplier<environments.IntercomEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
/** Override the Intercom-Version header */
version?: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "2.0" | "2.1" | "2.2" | "2.3" | "2.4" | "2.5" | "2.6" | "2.7" | "2.8" | "2.9" | "2.10" | "2.11" | "Unstable";
fetcher?: core.FetchFunction;
}
interface RequestOptions {
/** The maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
/** The number of times to retry the request. Defaults to 2. */
maxRetries?: number;
/** A hook to abort the request. */
abortSignal?: AbortSignal;
/** Additional headers to include in the request. */
headers?: Record<string, string>;
/** Override the Intercom-Version header */
version?: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "2.0" | "2.1" | "2.2" | "2.3" | "2.4" | "2.5" | "2.6" | "2.7" | "2.8" | "2.9" | "2.10" | "2.11" | "Unstable";
}
}
export declare class PhoneCallRedirects {
protected readonly _options: PhoneCallRedirects.Options;
constructor(_options?: PhoneCallRedirects.Options);
/**
* You can use the API to deflect phone calls to the Intercom Messenger.
* Calling this endpoint will send an SMS with a link to the Messenger to the phone number specified.
*
* If custom attributes are specified, they will be added to the user or lead's custom data attributes.
*
* @param {Intercom.CreatePhoneCallRedirectRequest} request
* @param {PhoneCallRedirects.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.BadRequestError}
* @throws {@link Intercom.UnauthorizedError}
* @throws {@link Intercom.UnprocessableEntityError}
*
* @example
* await client.phoneCallRedirects.create({
* phone: "+353832345678",
* custom_attributes: {
* "issue_type": "Billing",
* "priority": "High"
* }
* })
*
* @example
* await client.phoneCallRedirects.create({
* phone: "+40241100100",
* custom_attributes: {
* "issue_type": "Billing",
* "priority": "High"
* }
* })
*/
create(request: Intercom.CreatePhoneCallRedirectRequest, requestOptions?: PhoneCallRedirects.RequestOptions): core.HttpResponsePromise<Intercom.PhoneSwitch>;
private __create;
protected _getAuthorizationHeader(): Promise<string>;
}