猟亀朴沫 > Web SMS API

Web SMS API

Page 1
Web SMS API
This technical document is intended for developers who wish to use the cyta¨s web sms API for sending messages, and describes the various programming methods and commands used by developers when using this API. To use this API, you need to be a registered member of www.cyta.com.cy Once you have registered and been activated you will receive 10 free sms per day while the rest of the sms you sent will be charged to the mobile number you registered. Sample code is provided on the site.
1.1 Sending SMS 1.2 SMS API responses 1.3 Checking the delivery status
1.1 Sending SMS
To send a SMS make an authorized POST request to:
https://www.cyta.com.cy/cytamobilevodafone/dev/websmsapi/sendsms.aspx
including a <websms api> element in the request body formatted as XML
SMS sending using XML format
POST https://www.cyta.com.cy/cytamobilevodafone/dev/websmsapi/sendsms.aspx HTTP/1.1 Host: www.cyta.com.cy Content-Type: application/xml; charset="utf-8" Content-Length: 425 Connection: close <?xml version="1.0" encoding="UTF-8" ?> <websmsapi> <version>1.0</version> <username>SomeUser</username> <secretkey>b3ce8bca78e8422fa72dcd549f9b33aa</secretkey> <recipients> <count>3</count> <mobiles> <m>9xxxxxx1</m> <m>9xxxxxx2</m> <m>9xxxxxx3</m> </mobiles> </recipients> <message>ΓΕΙΑ ΣΑΣ ΑΠΟ ΤΟ cyta web sms API</message> <language>el</language> </websmsapi>
The <websms api> element structure
? username: cyta mobile account username ? secretkey: the secret key generated and displayed by the web sms api page. ? recipients 1. count: acts as a checksum between the client and cybee as far as the number of recipients is concerned. When the Recipient mobile numbers are parsed and counted by our engine, the count should match the <count> value set by your application. 2. mobiles: mobile numbers to receive the sms message in the format of 9xxxxxxx. There is a maximum of 500 mobile numbers. International mobile numbers are not allowed. ? message: Sms message text. Greek characters are capitalized when sent (GSM 7bit character set). ? language: permitted values EN/EL. This setting defines the language of the text our engine appends at the end of your message Ex. ^From: ̄ or ^Απ?: ̄

Page 2
Important Notes
XML XML elements are CASE SENSITIVE. Make sure to a use lower case for xml tags. The following characters are not valid in XML and should be replaced. Content Length Make sure that the Content-Length value is set to the exact number of characters included in your content. ? Accented and special characters might count as two characters. ? When determining Content Length you should also include the number of characters that are appended at the end of each message by our engine. The appended text includes the sender information and also due to regulation it provides instructions to the recipient how to stop receiving messages from cybee web sms. The appended text format depending on the language : Language=EN
{line feed}FROM:{space}[username]{space}[mobile number] {line feed}CALL{space}80001088{space}TO{space}STOP
Language=EL
{line feed}ΑΠΟ:{space}[username]{space}[mobile number] {line feed}CALL{space}80001088{space}TO{space}STOP
Ex Hello from cyta web sms api FROM: Some.User1 99610455 CALL 80001088 TO STOP ? {line feed} and {space} are counted as 1 character each Maximum Content-Length (hence message size) is limited to 612 characters (charged as 4 sms). The number of characters in a message determines the number of SMS messages that will be sent as shown by the table below: Message Length Number of SMS sent Less Than 160 ( < 160 ) 1 Between 161 and 305 ( >=161 and <=305 ) 2 Between 306 and 458 ( >=306 and <=458 ) 3 Between 459 and 612 ( >=459 and <=612 ) 4 Invalid Characters Replace With < &lt; > &gt; " &quot; ' &apos; & &amp;

Page 3
1.2 SMS sending response
A successful response consists of a 200 OK HTTP status with a header and body including an xml reply.
HTTP/1.1 200 OK Content-Length: 113 Content-Type: application/xml; charset=utf-8 Connection: close <?xml version="1.0" encoding="UTF-8" ?> <websmsapi><status>0</status><lot>DFGR5XVR38</lot></websmsapi>
The <lot> element uniquely identifies each lot of messages sent. The <Status> element is the web sms API response to your request. Status values are explained in the following Summary and Analytical Status tables.
Summary Status Table
Status Ranges
Description
0
Success
1-9
Send SMS Errors
10-19
Authentication Errors
20-39
Validation Errors
90-99
Exceptions Analytical Status Table
Status Description 0 Send Sms success 1 You are not allowed to use the service 2 The service is suspended 9 Generic send sms failure 10 User not found or Suspended cybee account/Invalid Secret Key 11 configuration settings not found for Username 12 Web Sms Api Suspended or Terms not accepted 13 Client IP does not match expected IP 19 Registered mobile number for username not found 20 missing field values or case (lower/upper) of elements 21 invalid username 22 invalid characters in Recipients 23 invalid characters in recipient count 24 invalid language 25 cybee recipients count and user entered count does not match 26 Recipients list is bigger than allowed 27 Invalid mobile number found 28 Message length is bigger than allowed 29 Unsupported Content Type 30 Missing HTTP Post request body 31 Max allowed sms messages per day threshold reached 39 Invalid Version 90 Exception 91 Exception processing URL Encoded request 92 Exception processing XML request 93 Invalid XML request data

Page 4
1.3 Checking the delivery status
To check the delivery status of a sent SMS you as a person need to log on cyta website and check the Sent
Messages report.

譜葎遍匈 | 紗秘辺茄 | 虻跨朴沫

All Rights Reserved Powered by 猟亀和墮利

Copyright © 2011
猟亀和墮利坪否栖徭利大泌嗤盃係萩才厘断選狼。tousu#anggang.com
卦指競何