Professional Documents
Culture Documents
LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
Contents
I. GII THIU H THNG API ........................................................................................................... 1
II. CC HM GI TIN CA H THNG ............................................................................................ 2
1. Hm ly s d .................................................................................................................................... 2
2. Hm gi tin bng giao thc HTTP GET ......................................................................................... 3
3. Hm gi tin nhn bng u s ngu nhin/c nh theo giao thc HTTP POST........................ 6
4. Hm gi tin nhn bng Brandname theo giao thc HTTP POST ................................................ 8
5. Hm kim tra trng thi tin nhn .................................................................................................. 10
6. Hm kim tra chi tit tng s trong tin nhn ............................................................................... 11
7. Hm np tin vo ti khon bng th in thoi .......................................................................... 13
8. Hm ly danh sch tin nhn theo khong thi gian ..................................................................... 14
III. CP NHT TRNG THI TIN NHN CHO I TC ............................................................... 15
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
C ch hot ng:
Trc khi s dng eSMS API vui lng ng k ti khon ti esms.vn ly APIKey v
Secretkey. (C ngay 50 SMS dng th)
esms.vn/blog/3-buoc-de-co-the-gui-tin-nhan-tu-website-ung-dung-cua-ban-bang-sms-api-cua-
esmsvn
C php:
http://api.esms.vn/MainService.svc/xml/GetBalance/{APIKey}/{SecrectKey}
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
Response tr v c dng:
<Balance>47385280</Balance>
<CodeResponse>100</CodeResponse>
<ErrorMessage i:nil="true"/>
</MemberModel>
Thng tin tr v
Trng ngha
Balance Tng s d trong ti khon
CodeResponse M kt qu ca request
ErrorMessage Li chi tit nu c
Bng CodeResponseTrng
M ngha
99 Li khng xc nh , th li sau
Hm gip gi tin nhn n nhiu s in thoi bng cch gi lnh HTTP GET
Url: http://api.esms.vn/MainService.svc/xml/SendMultipleSMS_v3
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
http://api.esms.vn/MainService.svc/xml/SendMultipleSMS_v3
?Phone={Phone}&Content={Content}&ApiKey={ApiKey}&SecretKey={SecretKey}&IsUni
code={IsUnicode}&Brandnamme={BrandnameCode}&SmsType={SmsType}&RequestID={
RequestID}
Thng tin kt qu
Trng ngha
SMSID ID ca tin nhn lu trn h thng esms.vn, qu khch lu li c
th truy xut cc thng tin chi tit v trng thi SMS v sau
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
CodeResult M kt qu ca request
ErrorMessage Chi tit li nu c
Bng CodeResponse
M ngha
99 Li khng xc nh , th li sau
Url mu:
http://api.esms.vn/MainService.svc/xml/SendMultipleSMS_v3?Phone=0933556925&Content=X
in+ch%c3%a0o+b%e1%ba%a1n+%3a+&ApiKey=XXX&SecretKey=YYY
Lu :
Ni dung tin nhn trnh sai lch khi truyn trn RestFull, ngh qu khch EncodeURL Ni dung
tin nhn trc khi gi
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
V d:
3. Hm gi tin nhn bng u s ngu nhin/c nh theo giao thc HTTP POST
Hm cho php bn gi tin nhn n 1 hoc nhiu s in thoi bng u s ngu nhin(tin
nhn ngi nhn s thy mc gi n l mt s in thoi dng 09xxxx) hoc bng u s c
nh 19001534(chi ph cao hn)
ng dn:
http://api.esms.vn/MainService.svc/xml/SendMultipleMessage_V2/
<RQST>
<APIKEY>yourapikey</APIKEY>
<SECRETKEY>yoursecretkey</SECRETKEY>
<ISFLASH>0</ISFLASH>"
<UNICODE>0<UNICODE>
<SMSTYPE>X<SMSTYPE>
<REQUESTID>X<REQUESTID>
<CONTENT>Welcome to esms.vn</CONTENT>
<CONTACTS>
<CUSTOMER>
<PHONE>.</PHONE>
</CUSTOMER>
<CUSTOMER>
<PHONE>.</PHONE>
</CUSTOMER>
</CONTACTS>
</RQST>
Tham s:
Tham s ngha
PHONE S in thoi cn gi
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
REQUESTID ID SMS ca i tc
Kt qu tr v c dng:
<SmsResultModel>
<CodeResult></CodeResult>
<ErrorMessage></ErrorMessage>
<SMSID></SMSID>
</SmsResultModel>
Thng tin kt qu
Trng ngha
SMSID ID ca tin nhn lu trn h thng esms.vn, qu khch lu li c
th truy xut cc thng tin chi tit v trng thi SMS v sau
CodeResult M kt qu ca request
ErrorMessage Chi tit li nu c
Bng CodeResponse
M ngha
100: Request thnh cng
99 Li khng xc nh , th li sau
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
ng dn:
http://api.esms.vn/MainService.svc/xml/SendMultipleSMSBrandname/
<RQST>
<APIKEY></APIKEY>
<SECRETKEY></SECRETKEY>
<CONTENT></CONTENT>
<SMSTYPE></SMSTYPE>
<BRANDNAME></BRANDNAME>
<CUSTOMER>
<PHONE></PHONE>
<CUSTOMER>
<CUSTOMER>
<PHONE></PHONE>
<CUSTOMER>
</CONTACTS>
</RQST>
Tham s:
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
Tham s ngha
PHONE S in thoi cn gi
Kt qu tr v c dng
<SmsResultModel>
<CodeResult></CodeResult>
<ErrorMessage></ErrorMessage>
<SMSID></SMSID>
</SmsResultModel>
Thng tin kt qu
Trng ngha
SMSID ID ca tin nhn lu trn h thng esms.vn, qu khch lu li c
th truy xut cc thng tin chi tit v trng thi SMS v sau
CodeResult M kt qu ca request
ErrorMessage Chi tit li nu c
Bng CodeResponse
M ngha
100: Request thnh cng
99 Li khng xc nh , th li sau
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
ng dn:
http://api.esms.vn/MainService.svc/xml/GetSmsStatus/
POST Data:
<RQST>
<APIKEY>YourAPIKey</APIKEY>
<SECRETKEY>YourSecretkey</SECRETKEY>
<SMSID>xxx</SMSID>
</RQST>
Tham s:
Tham s ngha
Kt qu tr v
<SmsStatus>
<CodeResult></CodeResult>
<ErrorMessage></ErrorMessage>
<StatusCode></StatusCode>
<SuccessCount></SuccessCount>
<FailedCount></FailedCount>
<TotalSent></TotalSent>
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
<TotalReceiver></TotalReceiver>
</SmsStatus>
Bng kt qu
M ngha
Url: http://api.esms.vn/MainService.svc/xml/GetSmsReceiverStatus/
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
<SmsReceiver>
<CodeResult></CodeResult>
<ErrorMessage></ErrorMessage>
<Receiver>
<Phone></Phone>
<SentResult></SentResult>
</Receiver>
<Receiver>
<Phone></Phone>
<SentResult></SentResult>
</Receiver>
</SmsReceiver>
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
Bng m ca CodeResult
STT M tr v ngha
1 100 Thnh cng
2 99 Li khng xc nh
3 105 SMS ID khng tn ti trong h thng
4 101 Api key / Secret key khng ng
Url: http://api.esms.vn/MainService.svc/xml/ChargeByMobileCard/
<MobileChargeResponse>
<CodeResponse></CodeResponse>
<ErrorMessage></ErrorMessage>
<AmountCharge></AmountCharge>
</MobileChargeResponse>
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
Bng m ca CodeResult
STT M tr v ngha
1 100 Thnh cng
2 99 Li khng xc nh
3 119 S seri khng tn ti
4 120 M th khng tn ti
5 121 M nh mng khng tn ti
6 122 Np tht bi (Nguyn nhn tr v trong ErrorMessage)
Url: http://api.esms.vn/MainService.svc/xml/GetSmsSentData/
Chui request c dng:
<RQST>
<APIKEY></APIKEY>
<SECRETKEY></SECRETKEY>
<FROM></FROM>
<TO></TO>
</RQST>
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
Thng tin kt qu
Trng ngha
SentTime Thi gian gi
Phone S in thoi
Content Ni dung
CodeResult M kt qu ca request
ErrorMessage Chi tit li nu c
Bng CodeResponse
M ngha
99 Li khng xc nh , th li sau
http://esms.vn
VIHAT Technology Co.LTD
168/75 D2, Binh Thanh, Ho Chi Minh City
Phone: 0902.435.340
Website: http://esms.vn
Ngoi vic c th ch ng gi API get trng thi tin nhn ly tnh trng gi tin ca tin
nhn, khch hng c th cu hnh nhn cc request cp nht trng thi tin vi bng tham
s nh sau:
Khch hng cung cp URL dng: http://yourdomain.com/URLNhanRequest
URL m eSMS.vn s request sang i tc:
yourdomain.com/URLNhanRequest?RequestId=XXX&SmsId=XXX&CustomerPhone=X
XX&SentStatus=XXX&ErrorInfo=XXX
Trong :
Trng ngha
RequestId L ID ca SMS ca pha i tc truyn ln khi gi tin nhn
(SMSID ca i tc)
SmsId L ID ca SMS m pha eSMS.vn pht sinh sau khi tin nhn
c to (SMSID ca eSMS.vn)
Lin h:
http://esms.vn