Fortinet black logo

Online Help

Get Authorization Token

Copy Link
Copy Doc ID 4a6f3c4b-8d0f-11eb-a7dc-00505692583a:582638

Get Authorization Token

Description

Get the FortiCWP OAuth 2.0 bearer token through FortiCWP account username and password.

URL

/api/v1/auth/token

Method: POST

Request Headers

Key

Value

Type

Description

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

Request Body Parameters

Name Required Value Description
grant_type Required password

username

Required

<username>

FortiCWP account user name

passowrd

Required

<password>

FortiCWP account password

Sample Request

Request URL

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

Request Header

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

Request Body

grant_type: password

username: XXXXXXXXXX

password: XXXXXXXXXX

HTTP

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

Host: www.forticwp.com

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

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

grant_type=password&username=XXXXXXXXX&password=XXXXXXXXX

Response Variables

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.585002117836E12,

"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzY29wZSI6IkFQSSIsImlzcyI6ImZhdXRoLXNlcnZlciIsImhvc3QiOlsiRkNXUCJdkOpH0",

"refresh_token": "I4WnuRUY0xHEsoNMDvmurq_J45VHyuxa4DRWq5mevlYB1YT1yL2TUAA8vRRNNyOyy5RwEww62j0cAM8yxa4B5kU8"

}

Get Authorization Token

Description

Get the FortiCWP OAuth 2.0 bearer token through FortiCWP account username and password.

URL

/api/v1/auth/token

Method: POST

Request Headers

Key

Value

Type

Description

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

Request Body Parameters

Name Required Value Description
grant_type Required password

username

Required

<username>

FortiCWP account user name

passowrd

Required

<password>

FortiCWP account password

Sample Request

Request URL

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

Request Header

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

Request Body

grant_type: password

username: XXXXXXXXXX

password: XXXXXXXXXX

HTTP

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

Host: www.forticwp.com

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

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

grant_type=password&username=XXXXXXXXX&password=XXXXXXXXX

Response Variables

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.585002117836E12,

"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzY29wZSI6IkFQSSIsImlzcyI6ImZhdXRoLXNlcnZlciIsImhvc3QiOlsiRkNXUCJdkOpH0",

"refresh_token": "I4WnuRUY0xHEsoNMDvmurq_J45VHyuxa4DRWq5mevlYB1YT1yL2TUAA8vRRNNyOyy5RwEww62j0cAM8yxa4B5kU8"

}