Fortinet black logo

REST API Solution Guide

FortiGate group filter (/fgtgroupfilter/)

FortiGate group filter (/fgtgroupfilter/)

URL: https://[server_name]/api/[api_version]/fgtgroupfilter/

This can be found in the FortiAuthenticator GUI under Fortinet SSO Methods > SSO > FortiGate Filtering.

Supported fields

Field Display name Type Required Other restrictions
shortname Name string Yes max length=32, unique
nasname NAS name/IP string Yes max length=128, unique

Allowed methods

HTTP method Resource URI Action
GET /api/v1/fgtgroupfilter/ Get all FortiGate Group Filters.
GET /api/v1/fgtgroupfilter/[id]/ Get a specific FortiGate Group Filter with ID id.
PUT /api/v1/fgtgroupfilter/[id]/ Update an existing FortiGate Group Filter specified with ID id.

Allowed filters

Field Filters
shortname exact, iexact, contains, icontains, in

View FortiGate group filter configuration

JSON query

  • JSON specified via GET

curl -k -v -u "admin:zeyDZXmP6GbKcerqdWWEYNTnH2TaOCz5HTp2dAVS" https://192.168.0.122/api/v1/fgtgroupfilter/?format=json

  • JSON specified via Accept Header

curl -k -v -u "admin:zeyDZXmP6GbKcerqdWWEYNTnH2TaOCz5HTp2dAVS" -H 'Accept: application/json' https://192.168.0.122/api/v1/fgtgroupfilter/

Response

< HTTP/1.1 200 OK

< Date: Tue, 10 Jun 2014 13:49:24 GMT

< Server: Apache

< Vary: Accept,Accept-Language,Cookie

< X-Frame-Options: SAMEORIGIN

< Content-Language: en

< Cache-Control: no-cache

< Transfer-Encoding: chunked

< Content-Type: application/json

<

* Connection #0 to host 192.168.0.122 left intact

* Closing connection #0

{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 1}, "objects": [{"address": "1.1.1.1", "id": 1, "name": "GroupFilter_Test1", "nasname": "1.1.1.1", "resource_uri": "/api/v1/fgtgroupfilter/1/", "shortname": "GroupFilter_Test1", "sso_groups": [

Add FortiGate group filter configuration

Note that POST is not an allowed method so FGTGroup filters cannot be created via the API, however once created via the GUI, they can be modified. See below.

Modify FortiGate group filter configuration

JSON query

  • JSON specified via Accept Header

curl -k -v -u "admin:zeyDZXmP6GbKcerqdWWEYNTnH2TaOCz5HTp2dAVS" -X PUT -d '{"shortname":"GroupFilter_Test1","nasname":"2.2.2.2", "sso_groups": []}' -H 'Content-Type: application/json' https://192.168.0.122/api/v1/fgtgroupfilter/1/

Response

< HTTP/1.1 204 NO CONTENT

< Date: Mon, 16 Jun 2014 16:35:16 GMT

< Server: Apache

< Vary: Accept,Accept-Language,Cookie

< X-Frame-Options: SAMEORIGIN

< Content-Language: en

< Content-Length: 0

< Content-Type: text/html; charset=utf-8

FortiGate group filter (/fgtgroupfilter/)

URL: https://[server_name]/api/[api_version]/fgtgroupfilter/

This can be found in the FortiAuthenticator GUI under Fortinet SSO Methods > SSO > FortiGate Filtering.

Supported fields

Field Display name Type Required Other restrictions
shortname Name string Yes max length=32, unique
nasname NAS name/IP string Yes max length=128, unique

Allowed methods

HTTP method Resource URI Action
GET /api/v1/fgtgroupfilter/ Get all FortiGate Group Filters.
GET /api/v1/fgtgroupfilter/[id]/ Get a specific FortiGate Group Filter with ID id.
PUT /api/v1/fgtgroupfilter/[id]/ Update an existing FortiGate Group Filter specified with ID id.

Allowed filters

Field Filters
shortname exact, iexact, contains, icontains, in

View FortiGate group filter configuration

JSON query

  • JSON specified via GET

curl -k -v -u "admin:zeyDZXmP6GbKcerqdWWEYNTnH2TaOCz5HTp2dAVS" https://192.168.0.122/api/v1/fgtgroupfilter/?format=json

  • JSON specified via Accept Header

curl -k -v -u "admin:zeyDZXmP6GbKcerqdWWEYNTnH2TaOCz5HTp2dAVS" -H 'Accept: application/json' https://192.168.0.122/api/v1/fgtgroupfilter/

Response

< HTTP/1.1 200 OK

< Date: Tue, 10 Jun 2014 13:49:24 GMT

< Server: Apache

< Vary: Accept,Accept-Language,Cookie

< X-Frame-Options: SAMEORIGIN

< Content-Language: en

< Cache-Control: no-cache

< Transfer-Encoding: chunked

< Content-Type: application/json

<

* Connection #0 to host 192.168.0.122 left intact

* Closing connection #0

{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 1}, "objects": [{"address": "1.1.1.1", "id": 1, "name": "GroupFilter_Test1", "nasname": "1.1.1.1", "resource_uri": "/api/v1/fgtgroupfilter/1/", "shortname": "GroupFilter_Test1", "sso_groups": [

Add FortiGate group filter configuration

Note that POST is not an allowed method so FGTGroup filters cannot be created via the API, however once created via the GUI, they can be modified. See below.

Modify FortiGate group filter configuration

JSON query

  • JSON specified via Accept Header

curl -k -v -u "admin:zeyDZXmP6GbKcerqdWWEYNTnH2TaOCz5HTp2dAVS" -X PUT -d '{"shortname":"GroupFilter_Test1","nasname":"2.2.2.2", "sso_groups": []}' -H 'Content-Type: application/json' https://192.168.0.122/api/v1/fgtgroupfilter/1/

Response

< HTTP/1.1 204 NO CONTENT

< Date: Mon, 16 Jun 2014 16:35:16 GMT

< Server: Apache

< Vary: Accept,Accept-Language,Cookie

< X-Frame-Options: SAMEORIGIN

< Content-Language: en

< Content-Length: 0

< Content-Type: text/html; charset=utf-8