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
- 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
keyandsecret. - 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 -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" }'
content should be Base64-encoded image data; please ensure the image size is within 300KB.
format only supports jpg or png.
3. Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| key | string | Yes | API Key (composed of 8 letters or numbers), used to uniquely identify your account. Can be obtained in the PaaSoo dashboard. | Abcdefgh |
| secret | string | Yes | API Secret (composed of 8 letters or numbers), used in conjunction with key for authentication. Can be obtained in the PaaSoo dashboard. | Abc123EF |
| content | string | Yes | Base64-encoded image content, recommended size <300KB. | iVBORw0KGgoA... |
| format | string | Yes | Image format, only supports jpg or png. | jpg |
4. Response Parameters
4.1 Response Fields
| Parameter | Type | Description | Example |
|---|---|---|---|
| status | integer | Response status code submitted to the PaaSoo cloud communication platform. API status code list:
| 0 |
| status_code | string | Status description. | Missing parameters |
| address | string | The unique access link of the image on the PaaSoo server. | https://files.paasoo.com/images/mms/example.jpg |
| format | string | Image type, e.g., jpg or png. | jpg |
| size | integer | Image size (Unit: KB). | 233 |
4.2 Success Response Example
{
"status": 0,
"address": https://files.paasoo.com/images/mms/example.jpg,
"format": "jpg",
"size": 233
}
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."
}
status = 2 indicates that request parameters are missing or incorrect.
5. Best Practices and Precautions
- 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.
- 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.
- Encryption and Security: It is recommended to use the HTTPS protocol for uploading to prevent sensitive data (
key,secret) from being intercepted. - Callbacks and Logs: If you need to track upload records and usage, it is recommended to store the
addressreturned after a successful upload in your business logic and associate it with the target MMS record. - 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
addresscan be directly entered into theattachmentparameter 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.
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.