POST | /sendsms |
---|
import Foundation
import ServiceStack
public class SendSmsRequest : Codable
{
public var security:SecurityRequestDto
public var notify:SmsBodyDto
required public init(){}
}
public class SecurityRequestDto : Codable
{
public var partner_id:String
public var time:String
public var hash:String
required public init(){}
}
public class SmsBodyDto : Codable
{
public var service_id:String
public var number:String
public var carrier:String
public var message:String
public var encode:Int
public var url:String
public var test:Int
public var mask:String
public var xtraparams:[String:String] = [:]
required public init(){}
}
public class ResponseSmsDto : Codable
{
public var result:ResultResponseDto
required public init(){}
}
public class ResultResponseDto : Codable
{
public var code:String
public var message:String
public var id:String
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /sendsms HTTP/1.1
Host: 67.208.218.153
Accept: application/json
Content-Type: application/json
Content-Length: length
{"notify":{"carrier":"String","encode":0,"mask":"String","message":"String","number":"String","service_id":"String","test":0,"url":"String","xtraparams":[{"Key":"String","Value":"String"}]},"security":{"hash":"String","partner_id":"String","time":"String"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"result":{"code":"String","id":"String","message":"String"}}