POST | /sendsms |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using SMSGateway.ServiceModel.Types;
using SMSGateway.ServiceModel.Requests;
using SMSGateway.ServiceModel.Responses;
namespace SMSGateway.ServiceModel.Requests
{
public partial class SecurityRequestDto
{
public virtual string partner_id { get; set; }
public virtual string time { get; set; }
public virtual string hash { get; set; }
}
public partial class SmsBodyDto
{
public SmsBodyDto()
{
xtraparams = new Dictionary<string, string>{};
}
public virtual string service_id { get; set; }
public virtual string number { get; set; }
public virtual string carrier { get; set; }
public virtual string message { get; set; }
public virtual int encode { get; set; }
public virtual string url { get; set; }
public virtual int test { get; set; }
public virtual string mask { get; set; }
public virtual Dictionary<string, string> xtraparams { get; set; }
}
}
namespace SMSGateway.ServiceModel.Responses
{
public partial class ResponseSmsDto
{
public virtual ResultResponseDto result { get; set; }
}
public partial class ResultResponseDto
{
public virtual string code { get; set; }
public virtual string message { get; set; }
public virtual string id { get; set; }
}
}
namespace SMSGateway.ServiceModel.Types
{
public partial class SendSmsRequest
{
public virtual SecurityRequestDto security { get; set; }
public virtual SmsBodyDto notify { get; set; }
}
}
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"}}