smsaero-0.1.1: SMSAero API and HTTP client based on servant library.

Safe HaskellNone
LanguageHaskell2010

SMSAero.API

Synopsis

Documentation

data SmsAeroJson Source

Content type for SMSAero JSON answer (it has JSON body but "text/plain" Content-Type).

data RequiredQueryParam sym a Source

Like QueryParam, but always required.

Instances

(HasClient sub, KnownSymbol sym, ToText a) => HasClient ((:>) * * (RequiredQueryParam sym a) sub) 
type Client ((:>) * * (RequiredQueryParam sym a) sub) = a -> Client sub 

newtype Signature Source

SMSAero sender's signature. This is used for the "from" field.

Constructors

Signature 

Fields

getSignature :: Text
 

newtype MessageId Source

SMSAero sent message id.

Constructors

MessageId Integer 

data SMSAeroAuth Source

SMSAero authentication data.

Constructors

SMSAeroAuth 

Fields

authUser :: Text

Username.

authPassword :: Text

MD5 hash of a password.

newtype Phone Source

Phone number.

Constructors

Phone 

Fields

getPhone :: Integer
 

Instances

newtype SMSAeroDate Source

Date.

Constructors

SMSAeroDate 

data RequireAuth Source

SMSAero authentication credentials.

Instances

HasClient sub => HasClient ((:>) * * RequireAuth sub) 
type Client ((:>) * * RequireAuth sub) = SMSAeroAuth -> Client sub 

data AnswerJson Source

Implicit parameter that tells SMSAero to respond with JSON.

Instances

HasClient sub => HasClient ((:>) * * AnswerJson sub) 
type Client ((:>) * * AnswerJson sub) = Client sub 

type SmsAeroGet a = Get `[SmsAeroJson]` (SmsAeroResponse a) Source

Regular SMSAero GET API.

type SMSAeroAPI = RequireAuth :> (AnswerJson :> (("send" :> SendApi) :<|> (("status" :> StatusApi) :<|> (("balance" :> SmsAeroGet BalanceResponse) :<|> (("senders" :> SmsAeroGet SendersResponse) :<|> ("sign" :> SmsAeroGet SignResponse)))))) Source

SMSAero API.

type StatusApi = RequiredQueryParam "id" MessageId :> SmsAeroGet StatusResponse Source

SMSAero API to check message status.

data SmsAeroResponse a Source

Every SMSAero response is either rejected or provides some info.

Constructors

ResponseOK a

Some useful payload.

ResponseReject Text

Rejection reason.

data SendResponse Source

SMSAero response to a send request.

Constructors

SendAccepted MessageId

Message accepted.

SendNoCredits

No credits to send a message.

data StatusResponse Source

SMSAero response to a status request.

Constructors

StatusDeliverySuccess

Message is successfully delivered.

StatusDeliveryFailure

Message delivery has failed.

StatusSmscSubmit

Message submitted to SMSC.

StatusSmscReject

Message rejected by SMSC.

StatusQueue

Message queued.

StatusWaitStatus

Wait for message status.

newtype BalanceResponse Source

SMSAero response to a balance request. This is a number of available messages to send.

Constructors

BalanceResponse Double 

newtype SendersResponse Source

SMSAero response to a senders request. This is just a list of available signatures.

Constructors

SendersResponse [Signature] 

data SignResponse Source

SMSAero response to a sign request.

Constructors

SignApproved

Signature is approved.

SignRejected

Signature is rejected.

SignPending

Signature is pending.