UNPKG

tyntec-sdk

Version:

TypeScript SDK for Tyntec Conversations API V3

34 lines (33 loc) 1.59 kB
import { RequestHttp, TyntecConfig } from './types'; import { WhatsAppTemplateRequest, LocalizationRequest } from '@/types/whatsapp/'; export interface TemplateApi { /** * Lists all WhatsApp templates for an account * @param [idWhatsAppAccount] - The WhatsApp Account ID * @returns The response data from the API */ listTemplates: (idWhatsAppAccount?: string) => Promise<any>; /** * Gets a specific WhatsApp template by name * @param templateName - The template name * @param [idWhatsAppAccount] - The WhatsApp Account ID * @returns The response data from the API */ getTemplate: (templateName: string, idWhatsAppAccount?: string) => Promise<any>; /** * Creates a new WhatsApp template * @param template - The template payload (see API docs for structure) * @param [idWhatsAppAccount] - The WhatsApp Account ID * @returns The response data from the API */ createTemplate: (template: WhatsAppTemplateRequest, idWhatsAppAccount?: string) => Promise<any>; /** * Adds a localization to an existing WhatsApp template * @param templateName - The template name * @param localization - The localization payload (see API docs for structure) * @param [idWhatsAppAccount] - The WhatsApp Account ID * @returns The response data from the API */ addTemplateLocalization: (templateName: string, localization: LocalizationRequest, idWhatsAppAccount?: string) => Promise<any>; } export declare function createTemplateApi(requestHttp: RequestHttp, cfg: TyntecConfig): TemplateApi;