Create or modify the category and subcategories using the data provided in JSON format.
updateCategory
| URL | https://api.enginemailer.com/restapi/subscriber/emsubscriber/updateCategory |
| Method | HTTP POST |
Table: Parameter
| Parameter name | Description | Column Type |
|---|---|---|
| SubscriberData | A list of category and subcategory data. | JSON String |
Table: Data Definition for JSON
| Parameter name | Description | Column Type | Maximum Length | Required? |
|---|---|---|---|---|
| categoryID | Category ID. 0 for new category. Otherwise, use the existing category ID. | Int |
Yes | |
| categoryName | Name of the category, for existing category, name will be updated. | String |
128 | Yes |
| description | Description for the category | String |
128 | No |
| isvisible | Visibility for the category. Default is true. | Boolean |
No | |
| subcategories | List of sub categories object | JArray (Int) |
No |
Table: Subcategories Data Type
| Data Type | Expected Value Format | Maximum Length |
|---|---|---|
| subcategoryID |
<Int> 0 for new subcategory.Otherwise, use the existing subcategory ID. |
|
| subcategoryName |
<String> |
128 |
| description |
<String> (Not Required) |
128 |
Request Example
Header
<APIKEY> - Value
Body
{
"categoryID":123,
"categoryname":"Malaysian Festival",
"description": "Festival celebrated in Malaysia",
"subcategories":[
{
"subcategoryid":0,
"subcategoryname":"Eid al-Fitri"
},
{
"subcategoryId":0,
"subcategoryNAME":"CNY"
}
],
"isvisible": false
}
Response
Success Response
{
"Result": {
"Status": "OK",
"StatusCode": "200",
"Data": {
"categoryID": 123,
"categoryName": "Malaysian Festival",
"description": "Festival celebrated in Malaysia",
"subcategories": [
{
"subcategoryID": 1,
"subcategoryName": "Eid al-Fitri",
"description": ""
},
{
"subcategoryID": 2,
"subcategoryName": "CNY",
"description": ""
}
]
}
}
}
Failed Response
{
"Result":{
"StatusCode":"500",
"Status":"InternalServerError",
"ErrorMessage":"Authentication Failed!"
}
}