2way SMS using a Dlist ?

2way SMS using a Dlist ? SearchSearch
Author Message
Kenneth Gyld
New member
Username: Gyld

Post Number: 3
Registered: 03-2007
Posted on Tuesday, March 27, 2007 - 09:54 am:   

Hi!

I hope that I can get some help from all you readers of this message.

I am trying to set up just a simple sms list with NowSMS, and that is no problem.
Under “2-Way” I have configured a command that looks like this:

http://5.72.0.75:8800/?PhoneNumber=070123456+070234567&Text=@@SMS@@

When someone now sends an SMS to my gatewaynumber NowSMS will forward it to the phone numbers above.

But my problem comes when I wants to make a SMS list with fore example 20 receiving numbers.
I now really hope that you some how can use the Dlist option as receiving phone numbers.
Is there anyone out there that knows how to call a specific Dlist in the command line instead of entering all the numbers manually like above?

Fore example I would like to do something like this:
http://5.72.0.75:8800/?PhoneNumber=@@Dlist-test@@&Text=@@SMS@@

In my example above I am trying to call fore the Dlist with name “test”.
It does not work when you type like my example, but does anyone now how to do?



Many thanks!

/Kenneth
Kenneth Gyld
New member
Username: Gyld

Post Number: 4
Registered: 03-2007
Posted on Tuesday, March 27, 2007 - 12:58 pm:   

I must be the most stu----- man in the world…..

I have now solved the problem!

And if someone else wonder how to do it, here is the answer.
My Dlist in this example is named “Smsgroup”.

http://10.10.0.20:8800/?PhoneNumber= Smsgroup&Text=@@SMS@@

This was so simple that I didn’t test it at all at the beginning.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7050
Registered: 10-2002
Posted on Thursday, April 05, 2007 - 07:33 pm:   

Hi Kenneth,

I'm glad you were able to get this issue sorted.

You might have talked to one of my colleagues about this, as I remember him commenting to me that he was looking for information about distribution lists in the manual and was amazed that he couldn't find anything.

I then did my own search, and found that the only mention was that the "PhoneNumber" parameter can contain either a comma delimited list of phone numbers or a distribution list name.

I guess that's better than nothing ... but that sure is sparse information ...

So I thought I'd add post some additional information here for future reference.

You can include multiple recipients in a URL request by separating them in the "PhoneNumber" parameter with a "," (comma).

There is no limit on the number of recipients that can be specified in a URL request (NowSMS dynamically allocates more memory as required). However, the software that you are using to submit the HTTP request to NowSMS might impose a limit on the HTTP URL length.

You can also create distribution list files on the NowSMS server. These are simple text files that contain a list of phone numbers. You can create/modify these distribution lists via the NowSMS web interface. And you can send a message to a distribution list by specifying the distribution list name in the "PhoneNumber" parameter. (Or you can specify multiple distribution lists or a mix of phone numbers and distribution lists separating each entry with a ",".)

While the web interface includes functionality to upload distribution lists to the server, these files are just simple text files, so it is often easier to manipulate them external to NowSMS.

Basically, these distribution list files are stored under the DLISTS\username directory on the NowSMS server. (Or directly under the DLISTS directory if authentication is not enabled for the web interface.)

Each distribution list has a ".txt" file extension, and the format of the file is one phone number per line of text. Optionally, the phone number can be followed by a descriptive name (e.g., "phonenumber - Full Name")

I should also mention that there is an HTTP based interface that allows you maintain distribution lists from an external application.

This interface is accessed via the NowSMS web interface port, with a URI of "/DLists" followed by a series of "HTTP GET" parameters. (If user accounts are enabled, you can either supply the user account and password in the "User" and "Password" parameters of the request, or include an "Authorization:" header using HTTP Basic Authentication.)

The following parameters are supported:

DListAction=List, Delete or Add
DListName=Name of Distribution list
DListMemberAction=Add or Delete
DListMember=Phone number
DListMemberName=Full Name (always optional)

To create a distribution list, use:

DListAction=Add
DListName=Name of Distribution list

To delete a distribution list, use:

DListAction=Delete
DListName=Name of Distribution list

To return a list of all defined distribution lists, use:

DListAction=List

To return a list of all entries defined to a distribution list, use:

DListAction=List
DListName=Name of Distribution list

To add an entry to a distribution list, use:

DListName=Name of Distribution list
DListMemberAction=Add
DListMember=Phone number
DListMemberName=Full Name (optional)

To remove an entry from a distribution list, use:

DListName=Name of Distribution list
DListMemberAction=Delete
DListMember=Phone number
DListMemberName=Full Name (optional)

As an example, to add a member to an existing distribution list, issue the following URL request:

http://server:port/dlists?DListName=dlistName&DListMemberAction=Add&DListMember= 1234&DListMemberName=Me

The URL may also include &User=username&Password=password to specify an "SMS Users" account under which the distribution list is maintained.

Note that this interface was primarily designed for use of the web-based user interface.

The "DListAction=List" response will return an HTTP response of the "text/plain" content type with a list of items. However, all other actions will return an HTML (text/html) response that is expected in the user interface. A program that is issuing HTTP requests programmatically should ignore the HTML content in the response and should look at the HTTP response code (e.g., 200 OK) to determine whether or not the request succeeded.

-bn
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7154
Registered: 10-2002
Posted on Monday, June 11, 2007 - 04:17 pm:   

The earlier message in this thread was asking specifically about distribution lists. My response above contains a lot of good info about editing/managing distribution lists.

However, from time to time, we also get asked about the more general "address book" that is maintained for each user.

The "address book" is a text file named ADDRESS.LST, stored under the DLISTS\username directory on the NowSMS server. (Or directly under the DLISTS directory if authentication is not enabled for the web interface.)

This ADDRESS.LST file has the same text file format as I described above for the distribution list files. The format of the file is one phone number per line of text. Optionally, the phone number can be followed by a descriptive name (e.g., "phonenumber - Full Name")

It is safe to edit these files from an external application, just be sure to keep to the one phone number per line of text format, and don't include any blank lines.

Note that the web interface of NowSMS will also automatically include all distribution lists in the "address book" listing.

Similar to distribution list management, there is also an HTTP based interface that allows you to manage address books from a remote application.

I haven't found anywhere that we have documented this HTTP interface before. It exists because this is the interface that is used by the actual NowSMS web forms.

This interface is accessed via the NowSMS web interface port, with a URI of "/AddrBook" followed by a series of "HTTP GET" parameters. (If user accounts are enabled, you can either supply the user account and password in the "User" and "Password" parameters of the request, or include an "Authorization:" header using HTTP Basic Authentication.)

The following parameters are supported:

AddrBookMemberAction=Add or Delete
AddrBookMember=Phone number
AddrBookMemberName=Full Name (always optional)

To add an entry to the address book, use:

AddrBookMemberAction=Add
AddrBookMember=Phone number
AddrBookMemberName=Full Name (optional)

To remove an entry from the address book, use:

AddrBookMemberAction=Delete
AddrBookMember=Phone number
AddrBookMemberName=Full Name (optional)

As an example, to add a member to the address book, issue the following URL request:

http://server:port/AddrBook?AddrBookMemberAction=Add&AddrBookMember= 1234&AddrBookMemberName=Me

The URL may also include &User=username&Password=password to specify an "SMS Users" account under which the distribution list is maintained.

Note that this interface was primarily designed for use of the web-based user interface.

There is one additional parameter that is supported which is not used by the web interface:

AddrBookAction=List

The above parameter returns a list of all address book entries. The "AddrBookAction=List" response will return an HTTP response of the "text/plain" content type with a list of items. However, all other actions will return an HTML (text/html) response that is expected in the user interface. A program that is issuing HTTP requests programmatically should ignore the HTML content in the response and should look at the HTTP response code (e.g., 200 OK) to determine whether or not the request succeeded.

-bn
Marrakech
New member
Username: Walou

Post Number: 16
Registered: 11-2007
Posted on Friday, April 18, 2008 - 10:48 am:   

Hi Bryce, All,

I tray HTTP interface provision with a Require Authentification for web interface.

I'm connecting with the admin account (username=admin&password=admin) and tray to add a new sms user. Bellow the http url:

http://localhost:8800/provision?username=admin&password=admin&Type=SMS&AdminActi on=Add&Name=Testname&CreditsToAdd=1

What's wrong with ?

Thanks a lot of
Marrakech
New member
Username: Walou

Post Number: 20
Registered: 11-2007
Posted on Tuesday, April 22, 2008 - 12:05 pm:   

hi, it's fixed
nabil khoury
New member
Username: Nabil1980

Post Number: 1
Registered: 07-2008
Posted on Friday, July 04, 2008 - 12:17 am:   

test
jilali
New member
Username: Khaled

Post Number: 1
Registered: 12-2008
Posted on Wednesday, December 03, 2008 - 09:16 pm:   

rnbdgf,n,
Bipin Chandra
New member
Username: Xbipin

Post Number: 9
Registered: 05-2009
Posted on Sunday, May 31, 2009 - 12:11 pm:   

the problem i face is my own web frontend has features of billing, address book, distribution list etc and i don't want to link it with nowsms as i use nowsms for the purpose of sending sms only with just the admin account and nothing else so its basically used for the purpose of communicating to other smsc servers etc and sending sms only and i read the part that says u cant add a lot of phone numbers in the http psot or get so is there a way i can make my php script generate a text file with the numbers in it on each line and send it with the http post or get to nowsms and then nowsms takes the phone numbers from that file and the message from the http post and then does all the sms broadcast and then delete the text file? this way the php script wont timeout in sending sms to large lists with a for loop to submit each number to nowsms and the limitations of url length also is avoided, or a better thing could be a text file with the phone numbers, the message, any settings which is uploaded to nowsms and the nowsms does all the processing
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 878
Registered: 08-2008
Posted on Monday, June 01, 2009 - 01:51 pm:   

Hi Bipin,

You don't have to use NowSMS distribution lists.

You can put as many phone numbers into an HTTP submission as you want, just make them a comma delimited list (e.g., PhoneNumber=1234,5678,9012,3456,7890).

The only problem that you can run into doing this is that most software libraries have a limit on the length of an HTTP GET request that they can generate. NowSMS does not have a limit, but it is likely that whatever software library you are using will have a limit.

As an alternative, it is possible to use HTTP POST instead of HTTP GET. When you use HTTP POST, all of the HTTP GET variables are instead sent in the POST data, specifying "application/x-www-form-urlencoded" as the "Content-Type:" (standard web form POST format). Just put all of the variables (everything after the "?") in the post data instead of the URL, and remove the "?" off of the URL. This way you get around any length limitations that your scripting language might impose on HTTP GET URL length.

--
Des
NowSMS Support
Bipin Chandra
New member
Username: Xbipin

Post Number: 11
Registered: 05-2009
Posted on Wednesday, June 03, 2009 - 03:09 pm:   

i just a bit confused with the http headers so could u simply modify thescript given here to actually post the data instead of get

http://blog.nowsms.com/2008/10/nowsms-php-example-send-sms-text.html
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 893
Registered: 08-2008
Posted on Thursday, June 04, 2009 - 05:52 pm:   

It's more difficult to build an HTTP POST because HTTP rules require that you include a "Content-length:" header that specifies the length of the POST content.

So you need to build your query string and calculate its length to build a "Content-Length:" header.

(Alternatively, you could use HTTP 1.1 chunking, which is more flexible ... but far more complicated to explain.)

Here's an edit to that example script to use POST instead of GET.

http://www.nowsms.com/download/sendsmspost-php.txt

Basically, the code is very similar, I've just modified the logic to build the query string into a temporary variable. And instead of appending the query string to the URL, it goes into the content of the POST. "Content-Type:" and "Content-Length:" headers are also added.


$postData = "Phone=" . rawurlencode($phoneNoRecip) . "&Text=" . rawurlencode($msgText);

fwrite($fp, "POST / HTTP/1.0\n");
if ($username != "") {
$auth = $username . ":" . $password;
$auth = base64_encode($auth);
fwrite($fp, "Authorization: Basic " . $auth . "\n");
}
fwrite ($fp, "Content-Type: application/x-www-form-urlencoded\n");
fwrite ($fp, "Content-Length: " . strlen($postData) . "\n");
fwrite ($fp, "\n");
fwrite ($fp, $postData);


--
Des
NowSMS Support
Bipin Chandra
New member
Username: Xbipin

Post Number: 15
Registered: 05-2009
Posted on Sunday, June 07, 2009 - 08:12 am:   

can u help me locate a php script on ur site that actually does the post and then from the response gets the messageid? cant seem to be able to find it, bytheway, thanks for the code, the post works perfectly fine, i tweaked it a bit further
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 919
Registered: 08-2008
Posted on Monday, June 08, 2009 - 10:19 pm:   

Here's a link to a thread that shows some PHP that can be added to parse out the message id response:

http://support.nowsms.com/discus/messages/1/24868.html

--
Des
NowSMS Support