Skip to main content

Image Upload API

Through this API, you can upload Base64-encoded image files to the PaaSoo server and obtain a unique image link (address). When sending an MMS later, you can use this link as the value for the attachment field to achieve rapid delivery of image MMS messages.

1. Invocation Method

Invocation Details
  • HTTP Method: POST
  • Content-Type: application/json
  • API Endpoint: https://api.paasoo.com/image/upload
  • Security: It is recommended to use the HTTPS protocol and include the correct key and secret.
  • Image Size Limit: Recommended to be within 300KB. Exceeding this limit requires negotiation with PaaSoo or appropriate compression.

2. Request Example

The following is an example using cURL to demonstrate how to upload an image via POST + application/json:

cURL
curl -X POST "https://api.paasoo.com/image/upload" \
-H "Content-Type: application/json" \
--data-raw '{ "key": "API_KEY", "secret": "API_SECRET", "content": "xxxx", "format": "jpg" }'
Note

content should be Base64-encoded image data; please ensure the image size is within 300KB.
format only supports jpg or png.


3. Request Parameters

ParameterTypeRequiredDescriptionExample
keystringYesAPI Key (composed of 8 letters or numbers), used to uniquely identify your account. Can be obtained in the PaaSoo dashboard.Abcdefgh
secretstringYesAPI Secret (composed of 8 letters or numbers), used in conjunction with key for authentication. Can be obtained in the PaaSoo dashboard.Abc123EF
contentstringYesBase64-encoded image content, recommended size <300KB.iVBORw0KGgoA...
formatstringYesImage format, only supports jpg or png.jpg

4. Response Parameters

4.1 Response Fields

ParameterTypeDescriptionExample
statusintegerResponse status code submitted to the PaaSoo cloud communication platform.
API status code list:
  • 0 - success: Submission successful
  • 2 - Missing parameters: Required parameters are missing
  • 3 - Invalid parameters: Parameter format error
  • 4 - Invalid credentials: key or secret error
  • 5 - Unauthorized IP: IP Whitelist restriction
  • 11 - System error: System error
  • 13 - Invalid attachment file: Invalid image file
  • 16 - Attachment size more than 300KB: Image size exceeds the limit
0
status_codestringStatus description.Missing parameters
addressstringThe unique access link of the image on the PaaSoo server.https://files.paasoo.com/images/mms/example.jpg
formatstringImage type, e.g., jpg or png.jpg
sizeintegerImage size (Unit: KB).233

4.2 Success Response Example

{
"status": 0,
"address": https://files.paasoo.com/images/mms/example.jpg,
"format": "jpg",
"size": 233
}
Note

status = 0 indicates successful upload.
address is the unique access link for the image, which can be used in subsequent MMS messages.
format and size indicate the image's file format and size (Unit: KB), respectively.

4.3 Failure Response Example

{
"status": 2,
"status_code": "Missing parameters."
}
Note

status = 2 indicates that request parameters are missing or incorrect.


5. Best Practices and Precautions

  1. Image Format and Size: To ensure the stability and compatibility of MMS delivery, please use JPG or PNG formats and keep the size within 300KB as much as possible.
  2. Image Quality and Display: MMS messages may have differences in clarity on various devices and Carrier networks due to transcoding or compression. Please test in advance.
  3. Encryption and Security: It is recommended to use the HTTPS protocol for uploading to prevent sensitive data (key, secret) from being intercepted.
  4. Callbacks and Logs: If you need to track upload records and usage, it is recommended to store the address returned after a successful upload in your business logic and associate it with the target MMS record.
  5. Automatic Cleanup: All uploaded images may be automatically deleted from the server after 30 days. If you need to retain them for a longer period, please negotiate with PaaSoo in advance.

6. Appendix

  • Subsequent Use: The obtained address can be directly entered into the attachment parameter of the MMS API to achieve low-latency, highly available image transmission.
  • Reuse and Expiration: Once successfully uploaded, the image link generally does not expire immediately, but as mentioned above, the server may automatically delete the image after 30 days.
  • Mass Images: If you need to upload a large number of images frequently, please contact us to learn about solutions such as batch uploads or additional bandwidth budgets.
Support

If you encounter any technical issues or have business inquiries during the API integration, please do not hesitate to contact our Support team at support@paasoo.com. We are always here to assist you.