Copyright | (c) Anton Gushcha, 2016 |
---|---|
License | MIT |
Maintainer | ncrashed@gmail.com |
Stability | experimental |
Portability | Portable |
Safe Haskell | None |
Language | Haskell2010 |
- type SMSCAPI = SendEndpoint
- data SendResponse
- = SendError {
- sendError :: !Text
- sendErrorCode :: !SendErrorCode
- sendErrorId :: !(Maybe Text)
- | SendSuccess {
- sendSuccId :: !(Maybe Word)
- sendSuccCnt :: !Word
- sendSuccCost :: !(Maybe Text)
- sendSuccBalance :: !(Maybe Text)
- sendSuccPhones :: !(Maybe [PhoneResp])
- = SendError {
- data PhoneResp = PhoneResp {
- phoneNumber :: !Text
- phoneMccmnc :: !Text
- phoneCost :: !Text
- phoneStatus :: !Text
- phoneError :: !Text
- data SendErrorCode
- type SendEndpoint = "sys" :> ("send.php" :> (QueryParam "login" Text :> (QueryParam "psw" Text :> (QueryParam "phones" Text :> (QueryParam "mes" Text :> (QueryParam "id" Text :> (QueryParam "sender" Text :> (QueryParam "translit" Text :> (QueryParam "tinyurl" Text :> (QueryParam "time" Text :> (QueryParam "tz" Text :> (QueryParam "period" Double :> (QueryParam "freq" Word :> (QueryParam "flash" Word :> (QueryParam "bin" Text :> (QueryParam "push" Word :> (QueryParam "hlr" Word :> (QueryParam "ping" Word :> (QueryParam "mms" Word :> (QueryParam "mail" Word :> (QueryParam "call" Word :> (QueryParam "voice" Text :> (QueryParam "param" Text :> (QueryParam "subj" Text :> (QueryParam "charset" Text :> (QueryParam "cost" Word :> (QueryParam "fmt" Word :> (QueryParam "list" Text :> (QueryParam "valid" Text :> (QueryParam "maxsms" Word :> (QueryParam "imgcode" Text :> (QueryParam "userip" Text :> (QueryParam "err" Word :> (QueryParam "op" Word :> (QueryParam "pp" Text :> (ReqBody `[OctetStream]` ByteString :> Post `[JSON]` SendResponse))))))))))))))))))))))))))))))))))))
API
type SMSCAPI = SendEndpoint Source
All supported API of smsc.ru service
Endpoints
data SendResponse Source
Response for SendEndpoint
SendError | Server returned error payload |
| |
SendSuccess | Server retunred success payload |
|
Additional info about phone number
PhoneResp | |
|
data SendErrorCode Source
Error type
type SendEndpoint = "sys" :> ("send.php" :> (QueryParam "login" Text :> (QueryParam "psw" Text :> (QueryParam "phones" Text :> (QueryParam "mes" Text :> (QueryParam "id" Text :> (QueryParam "sender" Text :> (QueryParam "translit" Text :> (QueryParam "tinyurl" Text :> (QueryParam "time" Text :> (QueryParam "tz" Text :> (QueryParam "period" Double :> (QueryParam "freq" Word :> (QueryParam "flash" Word :> (QueryParam "bin" Text :> (QueryParam "push" Word :> (QueryParam "hlr" Word :> (QueryParam "ping" Word :> (QueryParam "mms" Word :> (QueryParam "mail" Word :> (QueryParam "call" Word :> (QueryParam "voice" Text :> (QueryParam "param" Text :> (QueryParam "subj" Text :> (QueryParam "charset" Text :> (QueryParam "cost" Word :> (QueryParam "fmt" Word :> (QueryParam "list" Text :> (QueryParam "valid" Text :> (QueryParam "maxsms" Word :> (QueryParam "imgcode" Text :> (QueryParam "userip" Text :> (QueryParam "err" Word :> (QueryParam "op" Word :> (QueryParam "pp" Text :> (ReqBody `[OctetStream]` ByteString :> Post `[JSON]` SendResponse)))))))))))))))))))))))))))))))))))) Source
Endpoint for sending sms, this is low-level most general API that is used to build small helper functions.