در زیر نحوه استف��ده از متد GroupSMS  آورده شده است. برای اطلاع از عملکرد این متد و ورودی ها و خروجی های آن می توانید به بخش معرفی متدها GroupSMS رجوع کنید.

شما می توانید با استفاده از کلاس پیشنهادی زیر و متد SendGroup آن در برنامه خود عملیات ارسال پیام گروهی را انجام دهید.

{{:: 'controllers.documentation.chooseFramework' | translate }}
npm install --save niksms.library.javascript
import { ApiV1, LibOperationResultStatus } from 'niksms'; export default class NikSmsApiV1Client{ private service: ApiV1 constructor(username: string, password: string, culture: string = "fa"){ this.service = new ApiV1(username, password, culture); } public async SendGroup( senderNumber: string, numbers: string[], message: string, sendOn?: Date | null, sendType?: number | null, yourMessageIds?: string[] ): Promise<string> { const result = await this.service.GroupSms(senderNumber, numbers, message, sendOn, sendType, yourMessageIds); switch (result.Status) { case LibOperationResultStatus.Success: return result.Data; case LibOperationResultStatus.InvalidModel: throw new Error("Some required inputs are misssing..."); case LibOperationResultStatus.UnAuthorized: throw new Error("Some thing is wrong with your account (call support!)"); case LibOperationResultStatus.Failed: throw new Error("Ooops its our fault!"); default: throw new Error("You sould not be here... :D"); } } }