همان قابلیت SendOne فقط از طریق خط بلک لیست ارسال میشود

{{:: '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 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<ServiceV1SingleSmsResult> SendOneBlackList( string number, string message, DateTime? sendOn = null, int? sendType = null, long? yourMessageId = null) { var result = await service.SendOneBlackList( number, message, sendOn, sendType, yourMessageId ); 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 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 Function SendOneBlackList(ByVal number As String, ByVal message As String, ByVal Optional sendOn As DateTime? = Nothing, ByVal Optional sendType As Integer? = Nothing, ByVal Optional yourMessageId As Long? = Nothing) As Task(Of ServiceV1SingleSmsResult) Dim result = Await service.SendOneBlackList(number, message, sendOn, sendType, yourMessageId) 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, ServiceV1SingleSmsResult, LibOperationResultStatus } from 'niksms'; export default class NikSmsWebServiceClient{ private service: ServiceV1 constructor(username: string, password: string){ this.service = new ServiceV1(username, password); } public async SendOneBlackList( number: string, message: string, sendOn: Date|null = null, sendType: number|null = null, yourMessageId: number|null = null ): Promise<ServiceV1SingleSmsResult> { const result = await this.service.SendOneBlackList( number, message, sendOn, sendType, yourMessageId ); 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 number بله عددی شماره گیرنده
2 message بله متن محتوای پیام
3 sendOn خیر تاریخ تاریخ ارسال
4 sendType خیر عددی نوع ارسال
5 yourMessageId خیر عددی
{{:: 'controllers.documentation.titleTable' | translate }} {{:: 'controllers.documentation.typeTable' | translate }} {{:: 'controllers.documentation.description' | translate }}
1
LibOperationResult<ServiceV1SingleSmsResult>
Object public class ServiceV1SingleSmsResult { public string Id { get; set; } public int NikId { get; set; } public WebServiceV1.SmsReturn Status { get; set; } }