Upload MMS Attachments
POST
https://api.laaffic.com/v3/mmsUpload
Upload MMS attachments.
Request Sample (to upload a txt attachment with the attachment content of "123456")
copy Request URL:
https://api.laaffic.com/v3/mmsUpload
Request Method:
POST
Request Headers:
Content-Type: application/json;charset=UTF-8
Sign: 05d7a50893e22a5c4bb3216ae3396c7c
Timestamp: 1630468800
Api-Key: bDqJFiq9
Request Body:
{
"fileType":"txt",
"fileData":"MTizNDU2"
}
Request Sample (upload png attachment)
copy Request URL:
https://api.laaffic.com/v3/mmsUpload
Request Method:
POST
Request Headers:
Content-Type: application/json;charset=UTF-8
Sign: 05d7a50893e22a5c4bb3216ae3396c7c
Timestamp: 1630468800
Api-Key: bDqJFiq9
Request Body:
{
"fileType":"png",
"fileData":"Base64 encoded file content"
}
Request Sample
copy {
"status":"0",
"reason":"success",
"data":"57_3_1727059993381.txt"
}
Sample code for Java-base64 code conversion:
copy public static String file2Base64(File file) {
if (file == null) {
return null;
}
String base64 = null;
FileInputStream fin = null;
try {
fin = new FileInputStream(file);
byte[] buff = new byte[fin.available()];
fin.read(buff);
base64 = Base64.encode(buff);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fin != null) {
try {
fin.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return base64;
}