Legacy FTP API¶
This API is deprecated and customers are currently being migrated away from it.
For this API you need a set of credentials. These are different from the OAuth API the Rest API uses. You will find them in the dashboard, under Settings.
We made this API upon request by our valued customers, but we strongly encourage all customers to use the REST API. You can also batch many SMSes together in one REST call.
Access to this API is controlled by our support staff, so if you require access please contact our live support and help us understand your use case so we can provide you with the best solution.
We have two active ftp servers,
b.ftp.gatewayapi.com. Both see the same files, if you cannot connect to one, try the other server. Ideally have your solution automatically failover if one is temporary unavailable.
- After uploading your file, you send the file by adding
.readyto the end of the file. That is you rename the file. If the file is in excel format, add
- The moment you rename the file, we start sending it and
.readyis changed to a timestamped (
.processing. Beware that most FTP clients cache the file listing, so you might need to click refresh in your FTP client to see this change.
- If the file could not be processed, it will be renamed to
.rejected. The cause of the failure will be added to the bottom of the file.
- When the file is processed and queued for delivery it will be renamed to
If processing fails due to internal errors, the file batch will be retried up to 5 times, with 30 minutes between each attempt.
The first row in the CSV must ALWAYS be a list of column names. We understand the following column names, which must match exactly.
|msisdn||MSISDN aka the full mobile phone number of the recipient|
|message||The message to send. If longer than 160 normal chars, it will be split into parts of 153 normal chars.|
|sender||Optional. Up to 11 alphanumeric characters, or 15 digits, that will be shown as the sender of the SMS.|
|class||Optional. Default “standard”. The message class to use for this request. If specified it must be the same for all messages in the file.|
|userref||Optional. A transparent string reference, you may set to keep track of the message in your own systems.|
We will attempt to auto detect the file encoding (ie. UTF-8 or Windows-1252/cp1252). You can override this by adding
.cp1252 to the file. Keep in mind the file must end with
.ready in order for processing to start, so to override auto detected and force utf-8, call it ie
.utf8.ready. UTF-16/32 is supported too, but only with auto detection.
Example of a unix encoded file
1 2 3
If you added
.excel to the file name, excels format is used. The target is what excel outputs on windows, running a Western Language and using the Save As “CSV (Semicolon Delimited)”.
We do not support escaping double quotes by adding backslashes. Double quotes must be escaped by adding an extra double quote, as is the most widely used convention.
You can terminate each row with CR+LF (
\r\n) or LF (
\n). We recommend LF for unix and CR+LF for excel format, as is standard on the respective platforms. Tab delimited files are not supported.
- You cannot upload Excel
.xls(x)files, save the file as “CSV (Semicolon delimited)”, and remember to add
.excel.readywhen sending the file.
- The encoding/charset of the file is auto detected, consider adding explicit encoding to the file name. Although auto detection is very good, there are a few rare edgecases.
- We recommend you do not create the CSV yourself, but have some standard software do it.
- You can use newlines (ie.
\n) as normal, as long as the text is in double quotes
"<text>". Remember that CR+LF (
\r\n) is two chars in the SMS (unless you have the new SMS optimization feature enabled which can remove the CR (
- The FTP has strongly limited feature set compared the the REST API, this is by design.
- Many FTP clients cache the directory listing, so they do not show the subsequent
.successsteps unless you force refresh the client.
- You cannot delete or rename files in the
.processingstage. You can however delete
- You cannot create new directories.
- You cannot modify the file permissions.
- Due to FTP protocol design, it is not trivial to implement load balancing, so you may experience an outage of one FTP server during maintenance windows. If possible automatically try the other server if one fails.
- The timestamp added to the files is in UTC
- Existing files will be overwritten, but due to the timestamp this is unlikely.
- Files larger than 30 MB will not be processed, we recommend you split very large batches into smaller files of 10.000 rows each.