Fortinet black logo

FortiLAN Cloud User Guide

Email Users

Email Users

The Email users can be used to authenticate with FortiLAN Cloud and obtain access token with the following web call (Global domain is used in this example).

Request

$ curl https://fortilan.forticloud.com/api/v1/auth -H 'Content-Type: application/json' -d '{"accountId":"acct1@example.com","userName":"user1@email.com","password":"1234"}'

Response

{\"access_token\": \"rVDBFKWu72Jvafj1FcVgIUXoTaNV99jU\",\"expires_in\": 1593739101}

In the request, the accountId is the primary account email address and the userName is either the primary or the sub-user email address. For a sub-user created account, ensure that the user is created with Admin role instead of Regular role. Only primary account and its Admin users can use the APIs.

Invalidate the access token after it is no longer required as displayed in this example.

$ curlhttps://fortilan.forticloud.com/api/v1/auth/invalidate_token -H 'Content-Type: application/json' -H 'Authorization: Bearer $access_token' -d '{ "access_token": "$access_token" }'

Email Users

The Email users can be used to authenticate with FortiLAN Cloud and obtain access token with the following web call (Global domain is used in this example).

Request

$ curl https://fortilan.forticloud.com/api/v1/auth -H 'Content-Type: application/json' -d '{"accountId":"acct1@example.com","userName":"user1@email.com","password":"1234"}'

Response

{\"access_token\": \"rVDBFKWu72Jvafj1FcVgIUXoTaNV99jU\",\"expires_in\": 1593739101}

In the request, the accountId is the primary account email address and the userName is either the primary or the sub-user email address. For a sub-user created account, ensure that the user is created with Admin role instead of Regular role. Only primary account and its Admin users can use the APIs.

Invalidate the access token after it is no longer required as displayed in this example.

$ curlhttps://fortilan.forticloud.com/api/v1/auth/invalidate_token -H 'Content-Type: application/json' -H 'Authorization: Bearer $access_token' -d '{ "access_token": "$access_token" }'