. شما فقط یکبار این پیام را دریافت می کنید و با هر بار کال کردن این متد، پیام های جدید (منهای آنهایی که قبلا دریافت کرده اید) را دریافت خواهید کرد، مگر اینکه متد  ResetReceiveرا فراخوانی کرده باشید تا بتوانید دوباره یک بازه مشخصی از پیام را از سرور نیک اس ام اس تحویل بگیرید.
توجه فرمایید با هر بار فراخوانی این متد فقط 100 پیام آخر را دریافت خواهید نمود.

{{:: 'controllers.documentation.chooseFramework' | translate }}
PM > Install-Package NikSms.Library.Net
PM > Install-Package NikSms.Library.NetCore
using NikSms.Library.Net.WebService; using NikSms.Library.Net.ViewModels; using NikSms.Library.Net.WebServiceV1; using System.Threading.Tasks; using System; namespace AwesomeApplication { public class NikSmsWebServiceClient { private readonly PublicServiceV1 service; public NikSmsWebServiceClient(string username, string password) { service = new PublicServiceV1(username, password); } public async Task<GetReceiveSmsModel[]> Receive(DateTime? startDate = null, DateTime? endDate = null) { var result = await service.Receive(startDate, endDate); switch (result.Status) { case LibOperationResultStatus.Success: return result.Data; case LibOperationResultStatus.InvalidModel: throw new Exception("Some required inputs are misssing..."); case LibOperationResultStatus.UnAuthorized: throw new Exception("Some thing is wrong with your account (call support!)"); case LibOperationResultStatus.Failed: throw new Exception("Ooops its our fault!"); default: throw new Exception("You sould not be here... :D"); } } } }
PM > Install-Package NikSms.Library.Net
PM > Install-Package NikSms.Library.NetCore
Imports NikSms.Library.Net.WebService Imports NikSms.Library.Net.ViewModels Imports NikSms.Library.Net.WebServiceV1 Imports System.Threading.Tasks Imports System Namespace AwesomeApplication Public Class NikSmsWebServiceClient Private ReadOnly service As PublicServiceV1 Public Sub New(ByVal username As String, ByVal password As String) service = New PublicServiceV1(username, password) End Sub Public async Task<GetReceiveSmsModel()> Receive(DateTime? startDate = Nothing, DateTime? endDate = Nothing) { Dim result As var = await service.Receive(startDate,endDate) Select Case result.Status Case LibOperationResultStatus.Success Return result.Data Case LibOperationResultStatus.UnAuthorized Throw New Exception("Some thing is wrong with your account (call supportNot )") Case LibOperationResultStatus.Failed Throw New Exception("Ooops its our faultNot ") Case Else Throw New Exception("You sould not be here... :D") End Select } End Class End Namespace
npm install --save niksms.library.javascript
import { ServiceV1, LibOperationResultStatus, GetReceiveSmsModel } from 'niksms'; export default class NikSmsWebServiceClient{ private service: ServiceV1 constructor(username: string, password: string){ this.service = new ServiceV1(username, password); } public async Receive(startDate: Date|null, endDate: Date|null): Promise<GetReceiveSmsModel[]> { const result = await this.service.Receive(startDate, endDate); 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"); } } }
{{:: 'controllers.documentation.titleTable' | translate }} {{:: 'controllers.documentation.mustDo' | translate }} {{:: 'controllers.documentation.typeTable' | translate }} ِ{{:: 'controllers.documentation.defualtValue' | translate }} ِ{{:: 'controllers.documentation.description' | translate }}
1 startDate خیر تاریخ null
2 endDate خیر تاریخ null
{{:: 'controllers.documentation.titleTable' | translate }} {{:: 'controllers.documentation.typeTable' | translate }} {{:: 'controllers.documentation.description' | translate }}
1
LibOperationResult<GetReceiveSmsModel[]>
لیست Object public class GetReceiveSmsModel { public string Message { get; set; } public long SenderNumber { get; set; } public string ReceiveNumber { get; set; } public int Id { get; set; } public DateTime ReceiveDate { get; set; } public bool IsRelayed { get; set; } }