UNPKG

verimor-api-sdk

Version:
37 lines (36 loc) 1.44 kB
import { BaseApi } from './base-api'; import { SmsRequest } from '../models/sms-request'; import { SmsResponse } from '../models/sms-response'; import { ProxyConfig } from '../models/proxy-config'; /** * SmsApi class provides methods to interact with the SMS API. */ export declare class SmsApi extends BaseApi { /** * Creates an instance of SmsApi. * @param username - The API username. * @param password - The API password. * @param proxyConfig - Optional proxy configuration. */ constructor(username: string, password: string, proxyConfig?: ProxyConfig); /** * Sends SMS messages (single or multiple). * @param smsRequest - The SMS request payload. * @returns Promise resolving to SmsResponse. * @throws ErrorResponse if the API call fails. */ sendSms(smsRequest: SmsRequest): Promise<SmsResponse>; /** * Cancels a scheduled SMS campaign. * @param campaignId - The ID of the campaign to cancel. * @returns Promise resolving to a success message. * @throws ErrorResponse if the API call fails. */ cancelScheduledMessage(campaignId: number): Promise<string>; /** * Calculates the number of SMS credits required for the given message. * @param message - The message content. * @returns The number of SMS credits required. */ calculateSmsCredits(message: string): number; }