InteleServiceStack

<back to all web services

RestSmsRequest

namespace InteleServiceStack.ServiceModel

open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<DataContract(Namespace="http://schemas.datacontract.org/2004/07/PushSmsLib.Dto")>]
    [<AllowNullLiteral>]
    type RestSmsMessageResp() = 
        ///<summary>
        ///Result of sending message. 0 if success. See documentation for full list of codes
        ///</summary>
        [<DataMember(Name="StatusCode")>]
        [<ApiMember(DataType="integer", Description="Result of sending message. 0 if success. See documentation for full list of codes", IsRequired=true, Name="StatusCode", ParameterType="form")>]
        member val StatusCode:Int32 = new Int32() with get,set

        ///<summary>
        ///Describes the result of sending Sms text message
        ///</summary>
        [<DataMember(Name="StatusDescription")>]
        [<ApiMember(DataType="string", Description="Describes the result of sending Sms text message", IsRequired=true, Name="StatusDescription", ParameterType="form")>]
        member val StatusDescription:String = null with get,set

        ///<summary>
        ///Your unique message id from send request message item. Will be empty if you did not provide any id in the request item.
        ///</summary>
        [<DataMember(Name="MessageId")>]
        [<ApiMember(DataType="string", Description="Your unique message id from send request message item. Will be empty if you did not provide any id in the request item.", Name="MessageId", ParameterType="form")>]
        member val MessageId:String = null with get,set

        ///<summary>
        ///Unique transaction id from server
        ///</summary>
        [<DataMember(Name="TransactionId")>]
        [<ApiMember(DataType="string", Description="Unique transaction id from server", IsRequired=true, Name="TransactionId", ParameterType="form")>]
        member val TransactionId:String = null with get,set

        ///<summary>
        ///Key/Value attributes returned from server. E.g. subnumref and the server name that processed the message. Eg. subnumref=19331234567891,server=smsgw1
        ///</summary>
        [<DataMember(Name="ExtraInfo")>]
        [<ApiMember(DataType="string", Description="Key/Value attributes returned from server. E.g. subnumref and the server name that processed the message. Eg. subnumref=19331234567891,server=smsgw1", Name="ExtraInfo", ParameterType="form")>]
        member val ExtraInfo:Dictionary<String, String> = null with get,set

    [<DataContract(Namespace="http://schemas.datacontract.org/2004/07/PushSmsLib.Dto")>]
    [<AllowNullLiteral>]
    type RestSmsResponse() = 
        ///<summary>
        ///Overall status of processing the request. Each message will have it's own status. This value indicates if any other error occured or not
        ///</summary>
        [<DataMember(Name="ProcessResult")>]
        [<ApiMember(DataType="boolean", Description="Overall status of processing the request. Each message will have it's own status. This value indicates if any other error occured or not", IsRequired=true, Name="ProcessResult", ParameterType="form")>]
        member val ProcessResult:Boolean = new Boolean() with get,set

        ///<summary>
        ///Description of any error occured, if ProcessResult equals false
        ///</summary>
        [<DataMember(Name="ProcessResultDescription")>]
        [<ApiMember(DataType="string", Description="Description of any error occured, if ProcessResult equals false", Name="ProcessResultDescription", ParameterType="form")>]
        [<StringLength(2048)>]
        member val ProcessResultDescription:String = null with get,set

        ///<summary>
        ///Collection of messages sent or failed
        ///</summary>
        [<DataMember(Name="Messages")>]
        [<ApiMember(Description="Collection of messages sent or failed", Name="Description", ParameterType="form")>]
        member val Messages:RestSmsMessageResp[] = null with get,set

    [<DataContract(Namespace="http://schemas.datacontract.org/2004/07/PushSmsLib.Dto")>]
    [<AllowNullLiteral>]
    type RestSmsMessageReq() = 
        ///<summary>
        ///Gateway number. Default 99700999 for cross country delivery, non premium messages
        ///</summary>
        [<DataMember(Name="Gateway")>]
        [<ApiMember(DataType="integer", Description="Gateway number. Default 99700999 for cross country delivery, non premium messages", IsRequired=true, Name="Gateway", ParameterType="form")>]
        member val Gateway:Object = null with get,set

        ///<summary>
        ///Originator address. Defaults to gateway number if not set. Maximum 11 chars if using alphanumeric value. See documentation for full details.
        ///</summary>
        [<DataMember(Name="OriginatorAddress")>]
        [<ApiMember(DataType="string", Description="Originator address. Defaults to gateway number if not set. Maximum 11 chars if using alphanumeric value. See documentation for full details.", Name="OriginatorAddress", ParameterType="form")>]
        member val OriginatorAddress:Object = null with get,set

        ///<summary>
        ///Destination address.The recipient of the message. Must be a valid MSISDN
        ///</summary>
        [<DataMember(Name="DestinationAddress")>]
        [<ApiMember(DataType="integer", Description="Destination address.The recipient of the message. Must be a valid MSISDN", IsRequired=true, Name="DestinationAddress", ParameterType="form")>]
        member val DestinationAddress:Object = null with get,set

        ///<summary>
        ///Price to bill recipient. Premium messaging. Leave value to 0 if not using premium. Premium is only available on short number gateway number for each country available in documentation
        ///</summary>
        [<DataMember(Name="Price")>]
        [<ApiMember(DataType="integer", Description="Price to bill recipient. Premium messaging. Leave value to 0 if not using premium. Premium is only available on short number gateway number for each country available in documentation", IsRequired=true, Name="Price", ParameterType="form")>]
        member val Price:Object = null with get,set

        ///<summary>
        ///Message type according to documentation. Defaults to 00 if not set. If text length is above 160 chars, it defaults to value 11
        ///</summary>
        [<DataMember(Name="MessageType")>]
        [<ApiMember(DataType="string", Description="Message type according to documentation. Defaults to 00 if not set. If text length is above 160 chars, it defaults to value 11", Name="MessageType", ParameterType="form")>]
        member val MessageType:String = null with get,set

        ///<summary>
        ///Delivery expire timestamp (yyyymmddhhmmss) or relative value. See documentation and default value if not defined
        ///</summary>
        [<DataMember(Name="ValidationPeriod")>]
        [<ApiMember(DataType="string", Description="Delivery expire timestamp (yyyymmddhhmmss) or relative value. See documentation and default value if not defined", Name="ValidationPeriod", ParameterType="form")>]
        member val ValidationPeriod:Object = null with get,set

        ///<summary>
        ///Your unique message id to track delivery status and response from sending process
        ///</summary>
        [<DataMember(Name="MessageId")>]
        [<ApiMember(DataType="string", Description="Your unique message id to track delivery status and response from sending process", Name="MessageId", ParameterType="form")>]
        member val MessageId:String = null with get,set

        ///<summary>
        ///GSM User Data Header (HEX)
        ///</summary>
        [<DataMember(Name="UserDataHeader")>]
        [<ApiMember(DataType="string", Description="GSM User Data Header (HEX)", Name="UserDataHeader", ParameterType="form")>]
        member val UserDataHeader:String = null with get,set

        ///<summary>
        ///GSM User Data. Plain text or hex encoded. Depending on the used MessageType
        ///</summary>
        [<DataMember(Name="UserData")>]
        [<ApiMember(DataType="string", Description="GSM User Data. Plain text or hex encoded. Depending on the used MessageType", IsRequired=true, Name="UserData", ParameterType="form")>]
        member val UserData:String = null with get,set

        ///<summary>
        ///Parameter to categorize messages on payment bill from Intele
        ///</summary>
        [<DataMember(Name="Category")>]
        [<ApiMember(DataType="string", Description="Parameter to categorize messages on payment bill from Intele", Name="Category", ParameterType="form")>]
        member val Category:String = null with get,set

        ///<summary>
        ///Custom key/value attributes for the Sms Text Message. See documentation for further details
        ///</summary>
        [<DataMember(Name="CustomData")>]
        [<ApiMember(DataType="string", Description="Custom key/value attributes for the Sms Text Message. See documentation for further details", Name="CustomData", ParameterType="form")>]
        member val CustomData:Dictionary<String, Object> = null with get,set

        ///<summary>
        ///Url where Intele should send delivery report. See documentation for url formatting
        ///</summary>
        [<DataMember(Name="DeliveryReportUrl")>]
        [<ApiMember(DataType="string", Description="Url where Intele should send delivery report. See documentation for url formatting", Name="DeliveryReportUrl", ParameterType="form")>]
        member val DeliveryReportUrl:String = null with get,set

        ///<summary>
        ///For Premium messaging only. See documentation for further details
        ///</summary>
        [<DataMember(Name="ServiceCode")>]
        [<ApiMember(DataType="string", Description="For Premium messaging only. See documentation for further details", Name="ServiceCode", ParameterType="form")>]
        member val ServiceCode:String = null with get,set

        ///<summary>
        ///For Premium messaging only. See documentation for further details
        ///</summary>
        [<DataMember(Name="ServiceDescription")>]
        [<ApiMember(DataType="string", Description="For Premium messaging only. See documentation for further details", Name="ServiceDescription", ParameterType="form")>]
        member val ServiceDescription:String = null with get,set

    [<DataContract(Namespace="http://schemas.datacontract.org/2004/07/PushSmsLib.Dto")>]
    [<AllowNullLiteral>]
    type RestSmsRequest() = 
        ///<summary>
        ///API Username. Usually your customer id
        ///</summary>
        [<DataMember(Name="Username")>]
        [<ApiMember(DataType="string", Description="API Username. Usually your customer id", IsRequired=true, Name="Username", ParameterType="form")>]
        [<StringLength(128)>]
        member val Username:Object = null with get,set

        ///<summary>
        ///API Password
        ///</summary>
        [<DataMember(Name="Password")>]
        [<ApiMember(DataType="string", Description="API Password", IsRequired=true, Name="Password", ParameterType="form")>]
        [<StringLength(128)>]
        member val Password:String = null with get,set

        ///<summary>
        ///Collection of messages to send
        ///</summary>
        [<DataMember(Name="Messages")>]
        [<ApiMember(Description="Collection of messages to send", IsRequired=true, Name="Messages", ParameterType="form")>]
        member val Messages:RestSmsMessageReq[] = null with get,set

F# RestSmsRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /jsonl/reply/RestSmsRequest HTTP/1.1 
Host: smsgw.intele.no 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Username":{},"Password":"String","Messages":[{"Gateway":{},"OriginatorAddress":{},"DestinationAddress":{},"Price":{},"MessageType":"String","ValidationPeriod":{},"MessageId":"String","UserDataHeader":"String","UserData":"String","Category":"String","CustomData":{"String":{}},"DeliveryReportUrl":"String","ServiceCode":"String","ServiceDescription":"String"}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ProcessResult":false,"ProcessResultDescription":"String","Messages":[{"StatusCode":0,"StatusDescription":"String","MessageId":"String","TransactionId":"String","ExtraInfo":{"String":"String"}}]}