FortiCWP REST API resources are free for development purpose. To use these API resources, an OAuth 2.0 bearer token is required in the Authorization header. One method to get OAuth 2.0 bearer token is to call Get Credentials Token.
Before calling Get Credentials Token API, follow the steps below to generate a credential:
- Log into FortiCWP with your account.
- Click on Global Settings on the top right hand side.
- Click API Settings from the Global Settings menu
- Click +Generate Credential on the right to generate a credential.
- Give a name for the credential, and click Generate Credential.
- Copy and save the credential for use later in REST API calls. and click Copy and Close
Note: The credential is only valid for 1 year from the creation date.
The generated credential can be used repeatedly as long as it is not revoked or become invalid on FortiCWP.