object mediatype.create(object/array mediaTypes)
This method allows to create new media types.
(object/array)
Media types to create.
The method accepts media types with the standard media type properties.
(object)
Returns an object containing the IDs of the created media types under the mediatypeids
property. The order of the returned IDs matches the order of the passed media types.
Create a new e-mail media type.
Request:
{
"jsonrpc": "2.0",
"method": "mediatype.create",
"params": {
"description": "E-mail",
"type": 0,
"smtp_server": "[email protected]",
"smtp_helo": "company.com",
"smtp_email": "[email protected]"
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
CMediaType::create() in frontends/php/api/classes/CMediaType.php.