Getting Started

Typical flow of working with APIs is:

  1. Create Session
  2. Call Required APIs
  3. Delete Session

Create Session

First step is to create a session with controller and obtain session ID. This session ID can now be used for making other calls. POST call on Sessions collection create a new session.

curl 'https://api.a10networks.com/api/v2/sessions' \
-XPOST \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic c29tZW9uZUBleGFtcGxlLm5ldDpwYXNzd29yZA==' \
-H 'provider: root' \
--data-binary '{"userId":"someone@example.net"}'

The newly created session object is returned in JSON format.

{
  "id" : "914cc8d1-3df0-4910-beea-6b0016ba626b",
  "providerId" : "067e6162-3b6f-4ae2-a171-2470b63dff00",
  "provider" : {
    "name" : "root",
    "id" : "067e6162-3b6f-4ae2-a171-2470b63dff00",
    "authenticationProvider" : {
      "type" : "default",
      "inheritable" : "optional"
    },
    "services" : [ ]
  },
  "authenticationProvider" : {
    "type" : "default",
    "inheritable" : "optional"
  },
  "userId" : "someone@example.com",
  "createdAt" : "Jul 28, 2017 09:02:09 AM UTC",
  "lastAccessedAt" : "Jul 28, 2017 09:02:09 AM UTC"
}

‘id’ from the session object will be used for session authentication in all subsequent calls. This session expires after 60 minutes of inactivity and required to be created again.

Call Required APIs

Sequence of APIs can be called to perform the required task. All these API calls can use the session authentication by including session id obtained in previous step as part of Authorization header.

curl 'https://api.a10networks.com/api/v2/roles' \
-XGET \
-H 'Content-Type: application/json' \
-H 'Authorization: Session 914cc8d1-3df0-4910-beea-6b0016ba626b' \
-H 'provider: root'

Any number of API calls can use the same session.

curl 'https://api.a10networks.com/api/v2/providers/root/tenants' \
-XGET \
-H 'Content-Type: application/json' \
-H 'Authorization: Session 914cc8d1-3df0-4910-beea-6b0016ba626b' \
-H 'provider: root'

Delete Session

Though the session automatically expires in 60 minutes, it is a good practice to delete the session after use. Calling session object’s URI with DELETE method deletes the session. After delete, session id can’t be used for session authentication.

curl 'https://api.a10networks.com/api/v2/sessions/914cc8d1-3df0-4910-beea-6b0016ba626b' \
-XDELETE \
-H 'Content-Type: application/json' \
-H 'Authorization: Session 914cc8d1-3df0-4910-beea-6b0016ba626b' \
-H 'provider: root' \