Fortinet white logo
Fortinet white logo

REST API Solution Guide

FortiTokens (/fortitokens/)

FortiTokens (/fortitokens/)

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

This endpoint represents the FortiToken resource. In the FortiAuthenticator GUI, this resource corresponds to Authentication > User Management > FortiTokens. This API is for use by third-party user provisioning systems to ascertain which tokens are available to be provisioned to a user.

Supported fields

Field Display name Type Required

Read Only

Other restrictions
serial Serial number string No

type Type string No

Either ftk or ftm
status Status string No

One of new, available, pending, assigned
locked locked boolean No

true or false
license license string No

The license under which the FortiToken was activated

last_used_at

Last used time

string

No

Yes

ISO-8601 formatted time in UTC.

Allowed methods

HTTP Method Resource URI Action
GET /api/v1/fortitokens/ Get all FortiTokens
DELETE /api/v1/fortitokens/[id] Delete one FortiToken

Allowed filters

Field Lookup expressions Values
serial exact, iexact
type ftk, ftm
status new, available, pending, assigned
license A string, for example FTMTRIALNOREGIST

View all tokens

JSON query

  • JSON specified via GET

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

Response

< HTTP/1.1 200 OK

< Date: Mon, 09 Jun 2014 18:17:42 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": 2}, "objects": [{"resource_uri": "/api/v1/fortitokens/1/", "serial": "FTKMOB44142CCBF3", "status": "available", "type": "ftm"}, {"resource_uri": "/api/v1/fortitokens/2/", "serial": "FTKMOB4471BB94D1", "status": "available", "type": "ftm"}]}

View subset of tokens using filters

This example shows how it is possible to obtain a list of specific tokens e.g. The first available FortiToken Mobile token.

JSON query

  • JSON specified via GET

curl -k -v -u "admin:zeyDZXmP6GbKcerqdWWEYNTnH2TaOCz5HTp2dAVS" -H 'Accept: application/json' "https://192.168.0.122/api/v1/fortitokens/?format=json&type=ftm&status=available&limit=1"

The URL requires additional quoting in this case otherwise the Unix CLI treats the “&” as an instruction to place the cURL command into the background.

Response

< HTTP/1.1 200 OK

< Date: Mon, 09 Jun 2014 18:17:42 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": 1, "next": "/api/v1/fortitokens/?status=available&type=ftm&offset=1&limit=1&format=json", "offset": 0, "previous": null, "total_count": 2}, "objects": [{"resource_uri": "/api/v1/fortitokens/1/", "serial": "FTKMOB44142CCBF3", "status": "available", "type": "ftm"}]}

FortiTokens (/fortitokens/)

FortiTokens (/fortitokens/)

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

This endpoint represents the FortiToken resource. In the FortiAuthenticator GUI, this resource corresponds to Authentication > User Management > FortiTokens. This API is for use by third-party user provisioning systems to ascertain which tokens are available to be provisioned to a user.

Supported fields

Field Display name Type Required

Read Only

Other restrictions
serial Serial number string No

type Type string No

Either ftk or ftm
status Status string No

One of new, available, pending, assigned
locked locked boolean No

true or false
license license string No

The license under which the FortiToken was activated

last_used_at

Last used time

string

No

Yes

ISO-8601 formatted time in UTC.

Allowed methods

HTTP Method Resource URI Action
GET /api/v1/fortitokens/ Get all FortiTokens
DELETE /api/v1/fortitokens/[id] Delete one FortiToken

Allowed filters

Field Lookup expressions Values
serial exact, iexact
type ftk, ftm
status new, available, pending, assigned
license A string, for example FTMTRIALNOREGIST

View all tokens

JSON query

  • JSON specified via GET

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

Response

< HTTP/1.1 200 OK

< Date: Mon, 09 Jun 2014 18:17:42 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": 2}, "objects": [{"resource_uri": "/api/v1/fortitokens/1/", "serial": "FTKMOB44142CCBF3", "status": "available", "type": "ftm"}, {"resource_uri": "/api/v1/fortitokens/2/", "serial": "FTKMOB4471BB94D1", "status": "available", "type": "ftm"}]}

View subset of tokens using filters

This example shows how it is possible to obtain a list of specific tokens e.g. The first available FortiToken Mobile token.

JSON query

  • JSON specified via GET

curl -k -v -u "admin:zeyDZXmP6GbKcerqdWWEYNTnH2TaOCz5HTp2dAVS" -H 'Accept: application/json' "https://192.168.0.122/api/v1/fortitokens/?format=json&type=ftm&status=available&limit=1"

The URL requires additional quoting in this case otherwise the Unix CLI treats the “&” as an instruction to place the cURL command into the background.

Response

< HTTP/1.1 200 OK

< Date: Mon, 09 Jun 2014 18:17:42 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": 1, "next": "/api/v1/fortitokens/?status=available&type=ftm&offset=1&limit=1&format=json", "offset": 0, "previous": null, "total_count": 2}, "objects": [{"resource_uri": "/api/v1/fortitokens/1/", "serial": "FTKMOB44142CCBF3", "status": "available", "type": "ftm"}]}