Fortinet black logo

Setting up and making an API call

Setting up and making an API call

To set up and establish a session to your FortiSandbox PaaS instance, generate a token first. On the client software, use the token to authorize and make the API call to establish the session.

To generate a token in FortiSandbox PaaS:
  1. In FortiSandbox PaaS, open the CLI console by clicking the CLI icon at the top-right of the page.
  2. In the CLI console, run the following CLI command to generate a new token.

    login-token -g

To authorize and make the API call on the client software:
  1. On your client software, make the following API call to:

    https://<account-id>.<region>.fortisandboxcloud.com/jsonrpc

    {
    "method": "get",
    "params": [
    {
    "url": "/sys/login/token",
    "token": "<token>"
    }
    ],
    "session": "",
    "id": 53,
    "ver": "2.5"
    }

    Field

    Description

    id

    The user-id on the portal or one used in the URL in your FortiSandbox PaaS instance.

    token

    The token you just generated.

When the session is established, all API calls are similar to the FortiSandbox API document.

Tooltip

We recommend renewing your token on a regular basis to keep access to your PaaS instance secure.

Setting up and making an API call

To set up and establish a session to your FortiSandbox PaaS instance, generate a token first. On the client software, use the token to authorize and make the API call to establish the session.

To generate a token in FortiSandbox PaaS:
  1. In FortiSandbox PaaS, open the CLI console by clicking the CLI icon at the top-right of the page.
  2. In the CLI console, run the following CLI command to generate a new token.

    login-token -g

To authorize and make the API call on the client software:
  1. On your client software, make the following API call to:

    https://<account-id>.<region>.fortisandboxcloud.com/jsonrpc

    {
    "method": "get",
    "params": [
    {
    "url": "/sys/login/token",
    "token": "<token>"
    }
    ],
    "session": "",
    "id": 53,
    "ver": "2.5"
    }

    Field

    Description

    id

    The user-id on the portal or one used in the URL in your FortiSandbox PaaS instance.

    token

    The token you just generated.

When the session is established, all API calls are similar to the FortiSandbox API document.

Tooltip

We recommend renewing your token on a regular basis to keep access to your PaaS instance secure.