Get Form Token
Generate a session-specific form token for a named form. Required when launching forms from external form selectors.
GET https://instance.securid.com/aveksa/command.submit?cmd=getFormToken
note
This command is designed for browser-embedded contexts. The sessionToken is typically retrieved from the parent frame via JavaScript as parent.afx.sessionToken.
Request
Parameters
| getFormToken | |
| The name of the form to generate a token for. | |
The session token for the current user. Retrieved from the parent frame in external form selectors as parent.afx.sessionToken. | |
| format | properties - (Default) Returns the response as key=value pairs.json - Returns the response as JSON. |
Headers
Bearer token | |
| Accept | application/json |
| Content-Type | application/json |
Response
Parameters
type | Executed command name. |
formToken | The form token. Pass this to parent.avxfs.launchForm(formToken) to launch the form. |
Examples
Request
- Curl
- Python
- Node.js
curl -K -X GET \
"https://instance.securid.com/aveksa/command.submit?cmd=getFormToken&format=json&formName=SampleForm&sessionToken=<session-token>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json"
import requests
url = "https://instance.securid.com/aveksa/command.submit"
params = {
"cmd": "getFormToken",
"format": "json",
"formName": "SampleForm",
"sessionToken": "<session-token>"
}
headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
}
response = requests.get(url, params=params, headers=headers)
if response.status_code == 200:
data = response.json()
print(data)
else:
print(f"Request failed with status code {response.status_code}")
const axios = require('axios');
const url = "https://instance.securid.com/aveksa/command.submit";
const params = {
cmd: "getFormToken",
format: "json",
formName: "SampleForm",
sessionToken: "<session-token>"
};
const headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
};
axios.get(url, { params, headers })
.then(response => {
if (response.status === 200) {
console.log(response.data);
} else {
console.log(`Request failed with status code ${response.status}`);
}
})
.catch(error => {
console.error('Error:', error);
});
Response
- 200
- 401 Invalid Token
- 404 Form Not Found
- 412 Missing formName
- 412 Missing sessionToken
- 412 Invalid sessionToken
{
"data": {
"type": "getFormToken",
"formToken": "<form-token>"
}
}
<html>
<head>
<title>Error</title>
</head>
<body>The token is not valid for the command 'getFormToken'. Token is invalid or expired</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>formName SampleForm not found
Query String=cmd=getFormToken&format=json&formName=SampleForm&sessionToken=<session-token></body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The parameter formName is required.
Query String=cmd=getFormToken&format=json</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The parameter sessionToken is required.
Query String=cmd=getFormToken&format=json&formName=SampleForm</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>Invalid sessionToken
Query String=cmd=getFormToken&format=json&formName=SampleForm&sessionToken=<expired-token></body>
</html>