Send MMS with curl | ![]() |
NowSMS Support Forums ⬆ NowSMS Support - MMS & Advanced Issues ⬆ |
◄ ► |
Author | Message | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 6201 Registered: 08-2008 |
curl is a command-line utility that is frequently used from the command line or scripts to transfer data. Because it supports HTTP file upload (multipart/form-data), it can provide a very simple interface for sending MMS via NowSMS. Examples: curl -F PhoneNumber=99999999 -F MMSFrom=88888888 -F MMSFile=@image.png -F 'MMSText=This is a test' http://localhost:8800/?user=username&password=password More than one image: curl -F PhoneNumber=99999999 -F MMSFrom=88888888 -F MMSFile=@image1.png -F MMSFile=@image2.jpg -F 'MMSText=This is a test' http://localhost:8800/?user=username&password=password Read text from an existing file: curl -F PhoneNumber=99999999 -F MMSFrom=88888888 -F MMSFile=@image.png -F MMSFile=@textfile.txt http://localhost:8800/?user=username&password=password Use image from another web server: curl -F PhoneNumber=99999999 -F MMSFrom=88888888 -F MMSFile=http://server/path/image.png -F 'MMSText=This is a test' http://localhost:8800/?user=username&password=password Specify NowSMS User account (SMS Users) using Authorization header: curl --header 'Authorization: basic dXNlcm5hbWU6cGFzc3dvcmQ=' -F PhoneNumber=99999999 -F MMSFrom=88888888 -F MMSFile=@image.png -F 'MMSText=This is a test' http://localhost:8800 When using this interface, it is not possible to programmatically assign MIME content types. NowSMS will encode the content type based on well-known file extensions such as .png, .jpg, .jpeg, .gif and .txt. (If necessary, edit MMSCTYPE.INI to define additional types.) |