The FTP API is provided for clients who want to upload large batches of individual messages in an automated way, for instance via a script. It is limited to message submissions: you will not be able to get status reports or incoming messages via FTP. Nor is such functionality planned - you should be looking at the other APIs for such functionality.

Access to this API has to be specifically enabled for your account, or you will be unable to authenticate. Please contact Support to enable access.

Briefly, you will need to log in, upload a file in (the relatively standard) CSV (comma-separated value) format, and rename it. Note that you will have to FTP to port 7022 - firewall users will need to take extra steps in this regard. Most users will want to use passive mode. If you can log in, but don’t get a response to most commands, e.g. directory listings, try switching to passive mode.

CSV file format

If you are a programmer automating uploads, you should probably start by obtaining a CSV encoder for your programming language - look on Google. Otherwise, you should be using some application to generate the file. We do not recommend that you generate the file yourself without the aid of some such tool, as you could make mistakes in escaping characters. Nonetheless, for your information, here is a sample CSV file:

msisdn,sender,routing_group,message
"4477123123","John","2","I'm John, who likes to \"randomly quote things\"."
"4477123124",,,"Hi there"

The first line is a compulsory header line. Notice the escapes on the second like. Notice also how the third line specifies no values for sender and routing_group.

Only the msisdn and message columns are compulsory. The columns can be in any order.

Optional columns:

  • sender
  • routing_group
  • want_report: 0 or 1, default 1 (use to disable status report requests)

Server & authentication

Server: ftp1.bulksms.com or ftp2.bulksms.com Port: 7022 Username: Your system-ID will have been supplied by BulkSMS Support. It will be an integer (numeric), e.g. 2000012345, and not your BulkSMS.com username. Password: the password you normally use to log in.

Which server you need to connect to depends on your user account. This information will be provided when access to FTP is arranged.

Procedure

Log in, and upload your file with any filename that you want. However:

  • Your filename must not end in .ready! If it does, you risk having your partially uploaded file processed.
  • Your filename must be unique, so that there is no chance that you will upload a second file with the same name before we have a chance to process the first.
  • Filename length: max 150 characters.

Now rename your file to have the extension .ready, after which it will be processed (Excel users: rename your file to .excel.ready instead - Excel uses a slightly different format).

Your file will now have a timestamp appended (in the GMT+2 time zone), as well as the extention .process.

If fatal errors are encountered during processing (e.g. incorrect file format) or submission (e.g. you have insufficient credits), the file will have the extension .rejected appended, and the file will be filled with a textual description of the error encountered.

If no fatal errors are encountered, the file will have the extension .succeeded appended.

Note that the parsing of your file will be on a best-effort basis: we will try to find as many messages as we can in your file, strip out invalid characters, truncate messages which are too long, ignore or rewrite invalid sender ids and routing groups, etc. Therefore you would be well advised to validate your file properly before uploading.

A trap for the unwary: remember that many FTP clients (e.g. ncftp) cache directory listings to improve responsiveness for the average FTP user. So, if you log in, upload your file and rename it, and then request a directory listing immediately (or for that matter, your client may have automatically requested a listing by now), you may be creating a cached listing. Thereafter, you could carry on and on listing the directory, but may never be shown the renamed file which has just been created.