POST | /sendsms |
---|
import 'package:servicestack/servicestack.dart';
class ResultResponseDto implements IConvertible
{
String? code;
String? message;
String? id;
ResultResponseDto({this.code,this.message,this.id});
ResultResponseDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
code = json['code'];
message = json['message'];
id = json['id'];
return this;
}
Map<String, dynamic> toJson() => {
'code': code,
'message': message,
'id': id
};
getTypeName() => "ResultResponseDto";
TypeContext? context = _ctx;
}
class ResponseSmsDto implements IConvertible
{
ResultResponseDto? result;
ResponseSmsDto({this.result});
ResponseSmsDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
result = JsonConverters.fromJson(json['result'],'ResultResponseDto',context!);
return this;
}
Map<String, dynamic> toJson() => {
'result': JsonConverters.toJson(result,'ResultResponseDto',context!)
};
getTypeName() => "ResponseSmsDto";
TypeContext? context = _ctx;
}
class SecurityRequestDto implements IConvertible
{
String? partner_id;
String? time;
String? hash;
SecurityRequestDto({this.partner_id,this.time,this.hash});
SecurityRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
partner_id = json['partner_id'];
time = json['time'];
hash = json['hash'];
return this;
}
Map<String, dynamic> toJson() => {
'partner_id': partner_id,
'time': time,
'hash': hash
};
getTypeName() => "SecurityRequestDto";
TypeContext? context = _ctx;
}
class SmsBodyDto implements IConvertible
{
String? service_id;
String? number;
String? carrier;
String? message;
int? encode;
String? url;
int? test;
String? mask;
Map<String,String?>? xtraparams;
SmsBodyDto({this.service_id,this.number,this.carrier,this.message,this.encode,this.url,this.test,this.mask,this.xtraparams});
SmsBodyDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
service_id = json['service_id'];
number = json['number'];
carrier = json['carrier'];
message = json['message'];
encode = json['encode'];
url = json['url'];
test = json['test'];
mask = json['mask'];
xtraparams = JsonConverters.toStringMap(json['xtraparams']);
return this;
}
Map<String, dynamic> toJson() => {
'service_id': service_id,
'number': number,
'carrier': carrier,
'message': message,
'encode': encode,
'url': url,
'test': test,
'mask': mask,
'xtraparams': xtraparams
};
getTypeName() => "SmsBodyDto";
TypeContext? context = _ctx;
}
class SendSmsRequest implements IConvertible
{
SecurityRequestDto? security;
SmsBodyDto? notify;
SendSmsRequest({this.security,this.notify});
SendSmsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
security = JsonConverters.fromJson(json['security'],'SecurityRequestDto',context!);
notify = JsonConverters.fromJson(json['notify'],'SmsBodyDto',context!);
return this;
}
Map<String, dynamic> toJson() => {
'security': JsonConverters.toJson(security,'SecurityRequestDto',context!),
'notify': JsonConverters.toJson(notify,'SmsBodyDto',context!)
};
getTypeName() => "SendSmsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: '67.208.218.153', types: <String, TypeInfo> {
'ResultResponseDto': TypeInfo(TypeOf.Class, create:() => ResultResponseDto()),
'ResponseSmsDto': TypeInfo(TypeOf.Class, create:() => ResponseSmsDto()),
'SecurityRequestDto': TypeInfo(TypeOf.Class, create:() => SecurityRequestDto()),
'SmsBodyDto': TypeInfo(TypeOf.Class, create:() => SmsBodyDto()),
'SendSmsRequest': TypeInfo(TypeOf.Class, create:() => SendSmsRequest()),
});
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"}}