BulkSMS WebService
1.Link gọi webservice http://125.235.4.202:8998/bulkapi?wsdl
hoặc
http://apismsbrand.viettel.vn:8998/bulkapi?wsdl
3.Khi CP gọi ws thì gồm có 4 thông tin sau dùng để authenticate: User: /Password: , Cpcode: .
Các thông tin này được Admin khai báo trên web cms
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:impl="http://impl.bulkSms.ws/">
<soapenv:Header/>
<soapenv:Body>
<impl:wsCpMt>
<!--Optional:-->
<User>smsbrand_ldldtphcm</User>
<!--Optional:-->
<Password>123456aA@</Password>
<!--Optional:-->
<CPCode>LDLDTPHCM</CPCode>
<!--Optional:-->
<RequestID>?</RequestID>
<!--Optional:-->
<UserID>?</UserID>
<!--Optional:-->
<ReceiverID>?</ReceiverID>
<!--Optional:-->
<ServiceID>LDLD TPHCM</ServiceID>
<!--Optional:-->
<CommandCode>?</CommandCode>
<!--Optional:-->
<Content>?</Content>
<!--Optional:-->
<ContentType>?</ContentType>
</impl:wsCpMt>
</soapenv:Body>
</soapenv:Envelope>
Parameters
Parameter |
Description |
Example value (string) |
User |
User do Viettel cung cấp |
Admin khai báo trên CMS |
Password |
Password do Viettel cung cấp |
|
CPCode |
Mã do 70xx cung cấp |
|
RequestID |
Mặc định là RequestID MO |
Từ MT thứ 2 trở đi RequestID = 4 |
UserID |
Số điện thoai gửi |
84976969454 |
ReceiverID |
Số điện thoai nhận. Chú ý số điện thoại phải có định dạng như bên |
84976969454 |
ServiceID |
= với các Mạng Vina, Mobi, Viettel |
Ví dụ muốn gửi = brandname ABC thì ServiceID = “ABC”. Alias phải được đăng kí trước với viettel |
CommandCode |
Mã lệnh BulkSMS cung cấp |
bulksms |
Content |
Nội dung gửi |
Nội dung cần gửi (không dấu, 1MT không quá 480 ký tự, không sử dụng ký tự &) |
ContentType |
Loại nội dung gửi 0: Tin nhắn nội dung không dấu. 1: Tin nhắn nội dung có dấu. |
0 |
Ví dụ một bản tin MT
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:impl="http://impl.bulkSms.ws/">
<soapenv:Header/>
<soapenv:Body>
<impl:wsCpMt>
<!--Optional:-->
<User>user duoc cap</User>
<!--Optional:-->
<Password>pass duoc cap</Password>
<!--Optional:-->
<CPCode>CPCODE duoc cap viet hoa</CPCode>
<!--Optional:-->
<RequestID>1</RequestID>
<!--Optional:-->
<UserID>84972218325- so dien thoai nhan tin </UserID>
<!--Optional:-->
<ReceiverID>84972218325so dien thoai nhan tin </ReceiverID>
<!--Optional:-->
<ServiceID>Đau so duoc cap vi du la 70xxx</ServiceID>
<!--Optional:-->
<CommandCode>bulksms</CommandCode>
<!--Optional:-->
<Content>Noi dung tin nhan</Content>
<!--Optional:-->
<ContentType>F</ContentType>
</impl:wsCpMt>
</soapenv:Body>
</soapenv:Envelope>
Kết quả nếu thành công:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:wsCpMtResponse xmlns:ns2="http://impl.bulkSms.ws/">
<return>
<message>Insert MT_QUEUE: OK</message>
<result>1</result>
</return>
</ns2:wsCpMtResponse>
</S:Body>
</S:Envelope>
Kết quả nếu sai password:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:wsCpMtResponse xmlns:ns2="http://impl.bulkSms.ws/">
<return>
<message>Authenticate: WRONG_INFORMATION_AUTHENTICATE</message>
<result>0</result>
</return>
</ns2:wsCpMtResponse>
</S:Body>
</S:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:impl="http://impl.bulkSms.ws/">
<soapenv:Header/>
<soapenv:Body>
<impl:checkBalance>
<!--Optional:-->
<User>?</User>
<!--Optional:-->
<Password>?</Password>
<!--Optional:-->
<CPCode>?</CPCode>
</impl:checkBalance>
</soapenv:Body>
</soapenv:Envelope>
Parameter |
Description |
Example value (string) |
User |
User do Viettel cung cấp |
Admin khai báo trên CMS |
Password |
Password do Viettel cung cấp |
|
CPCode |
Mã do 70xx cung cấp |
|
|
|
|
Ví dụ:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:impl="http://impl.bulkSms.ws/">
<soapenv:Header/>
<soapenv:Body>
<impl:checkBalance>
<!--Optional:-->
<User>user_xxxxx</User>
<!--Optional:-->
<Password>pass_xxxxx</Password>
<!--Optional:-->
<CPCode>CP_XXXX</CPCode>
</impl:checkBalance>
</soapenv:Body>
</soapenv:Envelope>
Kết quả thành công:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:checkBalanceResponse xmlns:ns2="http://impl.bulkSms.ws/">
<return>
<balance>214085</balance>
<errCode>0</errCode>
<errDesc>check balance success</errDesc>
</return>
</ns2:checkBalanceResponse>
</S:Body>
</S:Envelope>
Kết quả thất bại:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:checkBalanceResponse xmlns:ns2="http://impl.bulkSms.ws/">
<return>
<balance>0</balance>
<errCode>1</errCode>
<errDesc>Authenticate: IP_INVALID</errDesc>
</return>
</ns2:checkBalanceResponse>
</S:Body>
</S:Envelope>
//---CP khong phai CP tra truoc----------------------------------------------------------
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:checkBalanceResponse xmlns:ns2="http://impl.bulkSms.ws/">
<return>
<balance>0</balance>
<errCode>1</errCode>
<errDesc>check balance failure</errDesc>
</return>
</ns2:checkBalanceResponse>
</S:Body>
</S:Envelope>