HTTP API - Send MMS: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
'''POST <nowiki>http://gateway_ip/api/send_mms</nowiki>''' | '''POST <nowiki>http://gateway_ip/api/send_mms</nowiki>''' | ||
'''Request Parameters''' | '''Request Parameters:''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|'''Parameter''' | |'''Parameter''' | ||
Line 11: | Line 11: | ||
|port | |port | ||
|Interger | |Interger | ||
| | |Port on which to send the MMS | ||
|- | |- | ||
|title | |title | ||
|String | |String | ||
| | |Title of the MMS | ||
|- | |- | ||
|number | |number | ||
Line 22: | Line 22: | ||
|- | |- | ||
|file_id | |file_id | ||
| | |Array | ||
|file_id can | |The file_id can be an integer in the range「0,31] or an array of integers in the range [0,31]. | ||
The length of the array must be less than 6. | |||
Each file uploaded | Each file should be uploaded through: '''"<nowiki>https://gateway_ip/api/mms_file/file</nowiki>[file_id]'''" | ||
and will be in the MMS sent as an attachment. | |||
|} | |} | ||
'''Response Parameters''' | '''Response Parameters:''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|'''Parameter''' | |'''Parameter''' | ||
Line 41: | Line 42: | ||
202: Request has been accepted and will be processed later; | 202: Request has been accepted and will be processed later; | ||
400: Request format is not valid 404:file is not found | 400: Request format is not valid | ||
404:file is not found | |||
500: other errors | 500: other errors | ||
Line 51: | Line 54: | ||
|mms_id | |mms_id | ||
|Integer | |Integer | ||
|mms_id represents the ID of an MMS | |mms_id represents the ID of an MMS. | ||
It is used for subsequent querying of the sending status. | |||
|} | |} | ||
'''Example:''' | |||
'''Request:''' | |||
curl -k --anyauth -u admin:admin -d '{"port":0,"title":"Test","number":"12345","file_id":0}' -H "Content-Type: application/json" <nowiki>https://gateway_ip/api/send_mms</nowiki> | curl -k --anyauth -u admin:admin -d '{"port":0,"title":"Test","number":"12345","file_id":0}' -H "Content-Type: application/json" <nowiki>https://gateway_ip/api/send_mms</nowiki> | ||
'''Response:''' | |||
{"error_code":200,"sn":"xxxx-xxxx-xxxx-xxxx","mms_id":1} | {"error_code":200,"sn":"xxxx-xxxx-xxxx-xxxx","mms_id":1} |
Latest revision as of 09:59, 24 June 2024
POST http://gateway_ip/api/send_mms
Request Parameters:
Parameter | Type | Description |
Required Parameter | ||
port | Interger | Port on which to send the MMS |
title | String | Title of the MMS |
number | String | The phone number of the receipient |
file_id | Array | The file_id can be an integer in the range「0,31] or an array of integers in the range [0,31].
The length of the array must be less than 6. Each file should be uploaded through: "https://gateway_ip/api/mms_file/file[file_id]" and will be in the MMS sent as an attachment. |
Response Parameters:
Parameter | Type | Description |
error_code | Integer | Codes that may be returned:
202: Request has been accepted and will be processed later; 400: Request format is not valid 404:file is not found 500: other errors |
sn | String | SN of the gateway |
mms_id | Integer | mms_id represents the ID of an MMS.
It is used for subsequent querying of the sending status. |
Example:
Request:
curl -k --anyauth -u admin:admin -d '{"port":0,"title":"Test","number":"12345","file_id":0}' -H "Content-Type: application/json" https://gateway_ip/api/send_mms
Response:
{"error_code":200,"sn":"xxxx-xxxx-xxxx-xxxx","mms_id":1}