Create/add URL Categories

Note: Before you use this API, make sure to create the URL Categories override file by copying the file /usr/share/fa/data/plugins/panorama/url_categories.json to this location: /home/afa/.fa/plugins/panorama/.

Create or add URL Categories from the URL Categories override file . Currently only Panorama devices are supported.

For further information about the URL Categories override file see (optional) Enhance URL Category accuracy.

Resource Name: /api/v1/plugins/{brand}/URLcategory/

Request Method: PUT

Request URL Parameters:

Element

Type

Description

brand
Mandatory

string

Brand name code. Only "panorama" is supported.

Request Body Parameters:

Element

Type

Description

Body
Mandatory

List of objects

A JSON list of category names to be created or added.

for example:

Copy
{
  "categories": {
    "categories": {
      "search-engines": {
        "www.bing.com": [
          "204.79.197.200",
          "13.107.21.200"
        ],
        "www.google.com": [
          "172.217.19.132",
          "172.217.18.100"
        ]
      },
      "sports": {
        "urls": {
          "www.nba.com": [
            "104.106.236.138",
            "92.122.144.117"
          ]
        }
      }
    }
  }
}

Response parameters

Element

Type

Description

categories map of objects

The list of URL categories after categories were created/added, each populated by:

  • category name

  • urls and their IPs

Response:

Status codes:

Code

Description

200

ActiveChange was triggered

400

Input validation failure

403

Authentication failure

500

Failed to complete operation.

Request cURL examples

curl -X PUT "https://localhost/afa/api/v1/plugins/panorama/URLCategory/" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"categories\" : { \"job-search\" : { \"urls\" : { \"www.indeed.com\" : [ \"169.45.207.200\" ], \"www.monster.com\" : [ \"65.9.100.58\" ], \"www.simplyhired.com\" : [ \"169.45.226.49\" ] } }, \"abortion\" : { \"urls\" : { \"www.prochoice.org\" : [ \"130.211.137.150\" ], \"www.prochoiceamerica.org\" : [ \"104.198.98.23\" ], \"www.prolifeaction.org\" : [ \"104.21.63.237\" ] } } }}" 

Response example for 200

Copy
{
  "categories": {
    "job-search": {
      "urls": {
        "www.indeed.com": [
          "169.45.207.200"
        ],
        "www.monster.com": [
          "65.9.100.58"
        ],
        "www.simplyhired.com": [
          "169.45.226.49"
        ]
      }
    },
    "abortion": {
      "urls": {
        "www.prochoice.org": [
          "130.211.137.150"
        ],
        "www.prochoiceamerica.org": [
          "104.198.98.23"
        ],
        "www.prolifeaction.org": [
          "104.21.63.237"
        ]
      }
    }
  }
}