همان قابلیت SendP2P با این تفاوت که پیام در همان لحظه دریافت ارسال نمیشود بلکه به صف ارسال اضافه شده و در صورتی که آدرس فراخوانی به آن دهید، هر زمان که وضعیت ارساال مشخص شده آدرس شما را فراخوانی میکند

{{:: '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.WebServiceV1; using NikSms.Library.Net.ViewModels; using System.Threading.Tasks; using System; using System.Collections.Generic; namespace AwesomeApplication { public class NikSmsWebServiceClient { private readonly PublicServiceV1 service; public NikSmsWebServiceClient(string username, string password) { service = new PublicServiceV1(username, password); } public async Task<long> QueueP2P( string senderNumber, Dictionary<string,string> recepients, DateTime? sendOn = null, int? sendType = null, List<long> yourMessageIds = null, long? callBackId = null, string callBackUrl = null) { var result = await service.QueueP2P( senderNumber, recepients, sendOn, sendType, yourMessageIds, callBackId, callBackUrl ); 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"); } } public async Task<long> QueueP2P( string senderNumber, List<string> numbers, List<string> message, DateTime? sendOn = null, int? sendType = null, List<long> yourMessageIds = null, long? callBackId = null, string callBackUrl = null) { var result = await service.QueueP2P( senderNumber, numbers, message, sendOn, sendType, yourMessageIds, callBackId, callBackUrl ); 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.WebServiceV1 Imports NikSms.Library.Net.ViewModels Imports System.Threading.Tasks Imports System Imports System.Collections.Generic 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 Function QueueP2P(ByVal senderNumber As String, ByVal recepients As Dictionary(Of String, String), ByVal Optional sendOn As DateTime? = Nothing, ByVal Optional sendType As Integer? = Nothing, ByVal Optional yourMessageIds As List(Of Long) = Nothing, ByVal Optional callBackId As Long? = Nothing, ByVal Optional callBackUrl As String = Nothing) As Task(Of Long) Dim result = Await service.QueueP2P(senderNumber, recepients, sendOn, sendType, yourMessageIds, callBackId, callBackUrl) Select Case 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!") Case Else Throw New Exception("You sould not be here... :D") End Select End Function Public Async Function QueueP2P(ByVal senderNumber As String, ByVal numbers As List(Of String), ByVal message As List(Of String), ByVal Optional sendOn As DateTime? = Nothing, ByVal Optional sendType As Integer? = Nothing, ByVal Optional yourMessageIds As List(Of Long) = Nothing, ByVal Optional callBackId As Long? = Nothing, ByVal Optional callBackUrl As String = Nothing) As Task(Of Long) Dim result = Await service.QueueP2P(senderNumber, numbers, message, sendOn, sendType, yourMessageIds, callBackId, callBackUrl) Select Case 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!") Case Else Throw New Exception("You sould not be here... :D") End Select End Function End Class End Namespace
npm install --save niksms.library.javascript
import { ServiceV1, LibOperationResultStatus, StringDictionary } from 'niksms'; export default class NikSmsWebServiceClient{ private service: ServiceV1 constructor(username: string, password: string){ this.service = new ServiceV1(username, password); } public async QueueP2PAsDictionary( senderNumber: string, recepients: StringDictionary<string>, sendOn: Date|null = null, sendType: number|null = null, yourMessageIds: number[]|null = null ): Promise<number> { const result = await this.service.QueueP2PAsDictionary( senderNumber, recepients, 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"); } } public async QueueP2PAsList( senderNumber: string, numbers: string[], messages: string[], sendOn: Date|null = null, sendType: number|null = null, yourMessageIds: number[]|null = null ): Promise<number> { const result = await this.service.QueueP2PAsList( senderNumber, numbers, messages, 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"); } } }
{{:: 'controllers.documentation.titleTable' | translate }} {{:: 'controllers.documentation.mustDo' | translate }} {{:: 'controllers.documentation.typeTable' | translate }} ِ{{:: 'controllers.documentation.defualtValue' | translate }} ِ{{:: 'controllers.documentation.description' | translate }}
1 senderNumber بله متن
2 numbers بله لیست متنی
3 messages بله لیست متنی
4 sendOn خیر تاریخ
5 sendType خیر عددی
6 yourMessageIds خیر لیست عددی
7 callBackId خیر عددی
8 callBackUrl خیر متن
{{:: 'controllers.documentation.titleTable' | translate }} {{:: 'controllers.documentation.typeTable' | translate }} {{:: 'controllers.documentation.description' | translate }}
1
LibOperationResult<long>
عددی