This function allows you to create a mediatype as defined by the mediatype data array.
Parameter | Type | Optional | Description | Details |
---|---|---|---|---|
mediatype data | array or object | Array of Mediatype objects or a single object | mediatypeid shouldn't be specified |
Parameter | Description |
---|---|
result | Operation successful. Result will contain array of created Mediatype IDs. mediatypeid are assigned to each Mediatype object |
error | In case of any errors |
Create two new mediatypes:
{
"jsonrpc": "2.0",
"method": "mediatype.create",
"params": [{
"type": "0",
"description": "Root Email",
"smtp_server": "[email protected]",
"smtp_helo": "domain.com",
"smtp_email": "[email protected]",
"exec_path": "",
"gsm_modem": "",
"username": "",
"passwd": ""
},
{
"type": "2",
"description": "SMS",
"smtp_server": "",
"smtp_helo": "",
"smtp_email": "",
"exec_path": "",
"gsm_modem": "\/dev\/ttyS0",
"username": "",
"passwd": ""
}],
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 2
}
Mediatype created successfully:
Mediatype already exists: