Vous êtes sur la page 1sur 9

mNatives API

Version 2.0

Version Number: 2.0

Table of Content
1.

Introduction............................................................................................................... 3

2.

Push Messaging Specification................................................................................. 3


2.1
Push Using URL [Get Method]......................................................................... 3
2.1.1 Push URL ...................................................................................................... 3
2.1.2 URL Parameters............................................................................................ 4
2.2
Push Using XML [POST Method]..................................................................... 5
2.2.1 Server/XML Details ....................................................................................... 5
2.2.2 XML Parameters ........................................................................................... 5
2.2.3 Sample........................................................................................................... 6
2.3
Credit Enquiry URL .......................................................................................... 8
2.4
Status Enquiry URL.......................................................................................... 8
2.5
Content Type Parameter Value........................................................................ 8
2.6
Error codes ....................................................................................................... 9

www.mnatives.com

Version Number: 2.0

1. Introduction
This document outlines the specification of mNatives with respect to PUSH messaging
system. The target audience of this document is internal customers, stakeholders, mNatives
existing and potential Customers.

2. Push Messaging Specification


mNatives platform provides API for pushing messages. Any sender name (CLI) in push
request has to be registered with us; otherwise the request will be rejected by the platform.

2.1

Push Using URL [Get Method]

Users can push message through URL using GET method. Choosing GET as the "method"
will append all of the data to the URL; hence it is restricted to only 1024 characters.

2.1.1 Push URL


mNatives provides following URLs that takes few parameters as a query string for pushing
the message.

a. URL Format for text messages


http://203.122.58.168/prepaidgetbroadcast/PrepaidGetBroadcast?userid=xxxxx&pwd=xxxx&
msgtype=s&ctype=1&sender=sender&pno=919810790590,919810549717&msgtxt=This+is
+a+test+msg+from+mNatives&alert=0
For every successful submission to mNative platform, platform generates a unique
transaction id and returns as a response in the same URL call.
Response id format: UserId-152818-592

b. URL Format for SI Push


http://203.122.58.168/prepaidgetbroadcast/PrepaidGetBroadcast?userid=xxxxx&pwd=xxxx&
ctype=10&pno=919810790590,919810549717&sender=mNatives&msgtxt=This+is+a+test+
msg+from+mNatives&siurl=http://yahoo.com&alert=0&msgtype=S
For every successful submission to mNative platform, platform generates a unique
transaction id and returns as a response in the same URL call.
Response id format: Userid-12450-7802

www.mnatives.com

Version Number: 2.0

c. URL Format for Flash Messages


http://203.122.58.168/prepaidgetbroadcast/PrepaidGetBroadcast?userid=userid&pwd=pass
word&msgtype=s&ctype=13&sender=sender&pno=919810790590,919810549717&msgtxt=
This+is+a+test+msg+from+mNatives&alert=1
For every successful submission to mNative platform, platform generates a unique
transaction id and returns as a response in the same URL call.
Response id format: Userid-22188-9386

2.1.2 URL Parameters


Following are the supported parameters.

Parameter Parameter
Name
Description

Parameter Value

Parameter Type

userid

Account User Id

User Id provided to the user


for authentication

pwd

Account password

Password provided

ctype

Content Type

1 by default for text messages


(Ref to sec. 2.3)

sender

Account Sender

Approved Sender Name

pno

End User Number

919810790590 (comma is the


delimiter for multiple mobile
numbers)

msgtxt

Message to be send

Test msg

msgid

Message Id

1111 (maximum length 15 and


must be unique)

alert

For pushing
promotional or Alert
messages

1 (For Pushing Alert Messages)

www.mnatives.com

msgtype

Message Type

0 (For Promotional messages)

S=SMS
siurl

URL to be pushed with


the WAP push

* M=Mandatory, O=Optional

www.mnatives.com

Version Number: 2.0

2.2

Push Using XML [POST Method]

Users can push message through xml using post method. Choosing POST as the "method",
the connection to the URL will be opened and XML chunk will be posted on the connection.
There is no restriction of the character length and is secure method.

2.2.1 Server/XML Details


Connection will be established from the following:
URL : 203.122.58.168/prepaidgetbroadcast/prepaidxmlapi
XML Chunk:

<?xml version=1.0?>
<push>
<userid>xxxx</userid>
<pwd>xxxx</pwd>
<ctype>xxx</ctype>
<sender>xxxx</sender>"
<multisms>
<detail msgid='xxx' msgtxt=xxxxxxx siurl='NA'>
<to id='xxxxx' pno='xxxxx' />
<to id='xxx' pno='xxxxxx' />
</detail>
</multisms>
<dlr>xxx</dlr>
<alert>xxx</alert>
</push>

2.2.2 XML Parameters


Following are the supported parameters.

Parameter Name

Parameter Description

Parameter Value

Parameter Type

userid

Account User Id

User Id provided to the


user for authentication

pwd

Account password

Password provided

www.mnatives.com

Version Number: 2.0

ctype

Content Type

1 by default for text


messages (Ref to sec.
2.3)

sender

Account Sender

Approved Sender
Name

id

Unique id for mobile


numbers given in detail
tag. This will be unique for
all xml chunks.

msgid

Message Id

1111 (maximum length M


15 and must be unique)

siurl

URL to be pushed with the


WAP push. It is mandatory
for WAP messages else
should be NA.

www.mnatives.com

NA

alert

For pushing promotional


or Alert messages

1 (For Pushing Alert


Messages)

pno

End User Number

919810790590

dlr

For delivery report

1 (For receiving a
delivery report)

Test msg

msgtxt

Message to be send

0 (For Promotional
messages)

0 (if delivery report


not required)

* M=Mandatory, O=Optional

2.2.3 Sample
package com.aclwireless.getbroadcast.test;
import java.net.URL;
import java.net.URLConnection;
import java.io.OutputStream;
import java.io.InputStream;
www.mnatives.com

Version Number: 2.0

public class Test {


public Test() {
}
public void doTask() {
String smsSchema="<?xml version=\"1.0\"?><push>" +
"<userid>aclreseller</userid><pwd>aclreseller123</pwd>" +
"<ctype>1</ctype>" +
"<sender>9335226728</sender>" +
"<intflag>1</intflag>" +
"<multisms>" +
"<detail msgid='d3566we' msgtxt='XML test msg' siurl='NA'>" +
"<to id='208454572ddf' pno='919810214363' />" +
"</detail>" +
"<detail msgid='d2' msgtxt='this is a XML test sms2' siurl='NA'>" +
"<to id='162' pno='919810214363' />" +
"</detail>" +
" </multisms>" +
"<dlr>1</dlr><alert>0</alert></push>";
System.out.println(" XML REQUEST :::: " +smsSchema);
try {
URL url = new URL("http://203.122.58.168/prepaidgetbroadcast/prepaidxmlapi");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
OutputStream ostream = conn.getOutputStream();
ostream.write(smsSchema.getBytes());
InputStream instream = conn.getInputStream();
int i;
char c;
while ( (i = instream.read()) != -1) {
c = (char) i;
System.out.print(c);
}
}
www.mnatives.com

Version Number: 2.0

catch (Exception ex) {


ex.printStackTrace();
}
}
public static void main(String[] args) {
Test request = new Test();
request.doTask();
}
}

2.3

Credit Enquiry URL

http://203.122.58.168:8000/servlet/com.aclwireless.enterprise.prepaidcbs.listeners.GetCredits?use
rid=userid&pwd=password
For every successful submission to mNative platform, platform returns the number of
available credits.
Format: 1001 (i.e. available credits information)

2.4

Status Enquiry URL

http://203.122.58.168:8060/servlet/com.aclwireless.enterprise.prepaiddlr.listeners.GetInfo?userid=
userid&password=password&msisdn=919810790590&appresponse=response id&date=20100829
* appresponse = Response id which has been retrieved at time of push message.
* date = Date on which the message is pushed in (yyyymmdd) format
For every successful submission to mNative platform, platform returns the delivery Status.
Format: Delivered (the status is displayed depending on the status received from the
platform)

2.5

Content Type Parameter Value

Supported Content Types are:


Content description
Plain 7-Bit Text
For Unicode
Plain SI Message
Flash Message

Content Type Value


1
3
10
13

www.mnatives.com

Version Number: 2.0

2.6

Error codes

In case of failure, mNative will not return response id but return the error code.
Error Codes
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-100
-101
-102
-103
-104
-105
-333

Error Description

RESERVED
MISSING USERID
MISSING PASSWORD
MISSING CONTENTID
MISSING SENDER
MISSING MOBILENUMBER
MISSING MESSAGETEXT
RESERVED
MISSING SIURL
AUTHENTICATION FAILED
RESERVED
MESSAGEID REPETED
CONTENT NOT ALLOWDED
RESERVED
MALFORMED XML DATA RECEIVED
INVALID DNDFLAG VALUE
RESERVED
INVALID CLI
RESERVED
RESERVED
MOBILE NUMBER IN DND
RESERVED
CREDIT NOT AVAILABLE
CREDIT NOT SUFFICIENT
RESERVED
RESERVED
APP INTERNAL ERROR
PRICE NOT FOUND
PARAMETER MISSING (for credit availability &
message Status enquiry)

www.mnatives.com

Vous aimerez peut-être aussi