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 VM instance, first generate a token in FortiSandbox PaaS. 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, click the CLI icon at the top right to open the CLI console.
  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>.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 PaaS API documentation.

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

Setting up and making an API call

To set up and establish a session to your VM instance, first generate a token in FortiSandbox PaaS. 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, click the CLI icon at the top right to open the CLI console.
  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>.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 PaaS API documentation.

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