API - Category

Description
These APIs are used to perform CRUD operations on Categories.
Get All
GET /Campaign/api/interact/rest/v2/channels/{icIdOrName}/categories?page=0&size=10
Parameters Description Values
page number, nth page to retrieve records. 0
size number of records per page. 10
Optional, if mode = recent, API will retrieve 5 strategies that are most recently updated
Output
Table 1. Response Codes
Success 200 Ok
Error 400 Bad Request
Server Error 500 Internal/Server Error
Example: Content-Type: application/json
{
	"content": [ 
		{ "description": "string", 
		  "id": 0, 
		  "name": "string",
		  "systemDefined": true
		}
	],
	"page": { 
		"hasNext": true, 
		"hasPrev": true, 
		"pageNumber": 0, 
		"size": 0, 
		"totalElements": 0, 
		"totalPages": 0 
	}
}

Get
GET /Campaign/api/interact/rest/v2/channels/{icIdOrName}/categories/{categoryIdOrName}
Output
Table 2. Response Codes
Success 200 Ok
Error 400 Bad Request
Server Error 500 Internal/Server Error
Example: Content-Type: application/json
{
  "description": "string",
  "id": 0,
  "name": "string",
  "systemDefined": true
}
Create
POST /Campaign/api/interact/rest/v2/channels/{icIdOrName}/categories
Input
Body Parameter – Content-Type: application/json
{
  "categories": [
    {
      "description": "string",
      "id": 0,
      "name": "string",
      "systemDefined": true
    }
  ]
}
Output
Table 3. Response Codes
Success 201 Created
Miscellaneous 207 Status code for batch request
Error 400 Bad Request
Server Error 500 Internal/Server Error
Example: Content-Type: application/json
[
    {
        "headers": {},
        "body": <entity>/<error-msg>,
        "status": 201/400/500
    }
]
Update
PUT /Campaign/api/interact/rest/v2/channels/{icIdOrName}/categories/{categoryIdOrName}
Input
Body Parameter – Content-Type: application/json
{
  "description": "string",
  "id": 0,
  "name": "string",
  "systemDefined": true
}
Output
Table 4. Response Codes
Success 202 Accepted
Error 400 Bad Request
Server Error 500 Internal/Server Error
Example: Content-Type: application/json
{
  "description": "string",
  "id": 0,
  "name": "string",
  "systemDefined": true
}
Delete a Category by Id or Name
DELETE /Campaign/api/interact/rest/v2/channels/{icIdOrName}/categories/{categoryIdOrName}
Output
Table 5. Response Codes
Success 200 Ok
Error 400 Bad Request
Server Error 500 Internal/Server Error
Delete Multiple Categories
DELETE /Campaign/api/interact/rest/v2/channels/{icIdOrName}/categories
Request Parameters
Parameters Description
ids Comma separated Category IDs to be deleted.
Output
Table 6. Response Codes
Success 200 Ok
Error 400 Bad Request
Server Error 500 Internal/Server Error