Fortinet black logo

online help

Get Credentials Token

Copy Link
Copy Doc ID 58cdf477-b7d4-11ea-8b7d-00505692583a:451336

Get Credentials Token

Description

Get the FortiCWP OAuth 2.0 bearer token by the credentials generated on FortiCWP. Before using this API, first generate a credential on FortiCWP. Follow the guide in Generate Credentials

URL

/api/v1/auth/credentials/token/

Method: POST

Request Header

Key

Value

Type

Description

Authorization Basic <FortiCWP credentials> String Authorization credential generated in FortiCWP
Content-Type application/x-www-form-urlencoded String

Request Body Parameters

Name Required Value Description
grant_type Required client_credentials

Sample Request

Request URL

POST https://www.forticwp.com/api/v1/auth/credentials/token/

Request Header

Authorization: Basic c492a2c2-b542-46fa-9894-d56d287bab1f

Content-Type: application/x-www-form-urlencoded

Request Body

grant_type=client_credentials

HTTP

POST /api/v1/auth/credentials/token/ HTTP/1.1

Host: www.forticwp.com

Authorization: Basic f59fb84e-c896-4d38-91f3-1eee401823b6

Content-Type: application/x-www-form-urlencoded

Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials

Response Variable

Name

Type

Description

access_token String Access token
refresh_token String Refresh token
token_type String Type of token

expires

String

Timestamp of when the token will expire

Sample Response

{

"token_type": "bearer",

"expires": 1.585245989931E12,

"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzY29wZSI6IkFQSSIsImlzcyI6ImZhdXRoLXNlcnZlciIsImhvc3QiOl2RLHbI",

"refresh_token": "I4WnuRUY0xHEsoNMDvmurq_J45VHyuxa4DRWq5mevlYB1YT1yL2TUAA8vRRNNyOyy5RwEww62j0cAM8yxa4"

}

Get Credentials Token

Description

Get the FortiCWP OAuth 2.0 bearer token by the credentials generated on FortiCWP. Before using this API, first generate a credential on FortiCWP. Follow the guide in Generate Credentials

URL

/api/v1/auth/credentials/token/

Method: POST

Request Header

Key

Value

Type

Description

Authorization Basic <FortiCWP credentials> String Authorization credential generated in FortiCWP
Content-Type application/x-www-form-urlencoded String

Request Body Parameters

Name Required Value Description
grant_type Required client_credentials

Sample Request

Request URL

POST https://www.forticwp.com/api/v1/auth/credentials/token/

Request Header

Authorization: Basic c492a2c2-b542-46fa-9894-d56d287bab1f

Content-Type: application/x-www-form-urlencoded

Request Body

grant_type=client_credentials

HTTP

POST /api/v1/auth/credentials/token/ HTTP/1.1

Host: www.forticwp.com

Authorization: Basic f59fb84e-c896-4d38-91f3-1eee401823b6

Content-Type: application/x-www-form-urlencoded

Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials

Response Variable

Name

Type

Description

access_token String Access token
refresh_token String Refresh token
token_type String Type of token

expires

String

Timestamp of when the token will expire

Sample Response

{

"token_type": "bearer",

"expires": 1.585245989931E12,

"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzY29wZSI6IkFQSSIsImlzcyI6ImZhdXRoLXNlcnZlciIsImhvc3QiOl2RLHbI",

"refresh_token": "I4WnuRUY0xHEsoNMDvmurq_J45VHyuxa4DRWq5mevlYB1YT1yL2TUAA8vRRNNyOyy5RwEww62j0cAM8yxa4"

}