Business Rules - Categories/Keywords

Categories/Keywords

Get

GET /api/repositories/(string: repository)/categories

Get a list of all business rule categories & keywords in the repository

GET /api/repositories/test/categories HTTP/1.1
Accept: application/json
Response Code Reason
200 No error
500 Server error

The response contains a JSON list of all the categories & keywords in the repository, each item consisting of key/value pairs containing the numeric ‘id’ & the ‘name’ of the category and a list of business rules keywords defined in the given category. Each keyword item consists of key/value pairs containing the numeric ‘id’ and the ‘name’ of the keyword. The response also includes a ‘used’ field for each category and keyword which is a boolean value representing whether or not the category or keyword has been used in any rules. This can be useful for determining when a category can be deleted.

An empty list of keywords will be returned for the categories that do not have any keywords defined.

For example, the request above could result in the following response:

[
    {
        "id": "1",
        "name": "CCAR-Aggregator",
        "used": "1",
        "keywords": [
            {
                "id": "1",
                "name": "BKFS",
                "used": "1"
            }
        ]
    },
    {
        "id": "2",
        "name": "CCAR-Aggregator_Active",
        "used": "1",
        "keywords": [
            {
                "id": "2",
                "name": "No",
                "used": "1"
            }
        ]
    }
]

Categories

Add

POST /api/repositories/(string: repository)/categories

Adds a category to the repository.

JSON Parameters:
 
  • body – The request body

The request requires a Standard Request packet.

POST /api/repositories/test/categories HTTP/1.1
Content-Type: application/json

{
    "command": "add",
    "data": {
        "name": "new category name"
    }
}
Response Code Reason
201 Success
500 Server error

Edit

POST /api/repositories/(string: repository)/categories/(number: category)

Edits a category.

JSON Parameters:
 
  • body – The request body

The request requires a Standard Request packet.

POST /api/repositories/test/categories/3 HTTP/1.1
Content-Type: application/json

{
    "command": "edit",
    "data": {
        "name": "changed category"
    }
}
Response Code Reason
204 Success
500 Server error

Delete

DELETE /api/repositories/(string: repository)/categories/(number: category)

Delete a category from the repository

DELETE /api/repositories/test/categories/15 HTTP/1.1
Response Code Reason
204 Success
500 Server error
/api/repositories/{repository}/categories/(number:category)/keywords
Parameter Type Purpose
repository string The name of the repository to access
category number The id of the category

Keywords

Add

POST /api/repositories/(string: repository)/categories/(number: category)/keywords

Adds a keyword to the given category in the repository.

JSON Parameters:
 
  • body – The request body

The request requires a Standard Request packet.

POST /api/repositories/test/categories/1 HTTP/1.1
Content-Type: application/json

{
    "command": "add",
    "data": {
        "name": "new keyword name"
    }
}
Response Code Reason
201 Success
500 Server error

Edit

POST /api/repositories/(string: repository)/categories/(number: category)/keywords/(number: keyword)

Edits a keyword.

JSON Parameters:
 
  • body – The request body

The request requires a Standard Request packet.

POST /api/repositories/test/categories/3/keywords/2 HTTP/1.1
Content-Type: application/json

{
    "command": "edit",
    "data": {
        "name": "changed keyword"
    }
}
Response Code Reason
204 Success
500 Server error

Delete

DELETE /api/repositories/(string: repository)/categories/(number: category)/keywords/(number: keyword)

Delete a keyword from the category

DELETE /api/repositories/test/categories/3/keywords/2 HTTP/1.1
Response Code Reason
204 Success
500 Server error