Set User Image
Set the configured image for a given user.
POST https://instance.securid.com/aveksa/command.submit?cmd=setUserImage
info
The images must be Base64 encoded Portable Network Graphics (PNG).
Request
Parameters
setUserImage | |
format | properties - (Default) key=value . most useful when requesting a single object. If multiple objects are returned, values is a csv. ie key=value1,value2,value3 where value1 is the value for the first object, value2 is the value for the 2nd object, etc.json - Useful format for parsing into javascript or other languages. See www.json.org for details. |
The id of the run to delete. |
Headers
Bearer token | |
image/png |
Body
Base64 encoded PNG image.
Response
Parameters
type | Executed command name |
Examples
Request
- Curl
- Python
- Node.js
curl -L -X POST "https://instance.securid.com/aveksa/command.submit?cmd=setUserImage&userId=1" \
-H "Content-Type: image/png" \
-H "Authorization: Bearer <token>" \
-d "iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAYAAAA+VemSAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAWUklEQVR42u3df2wcV7UH8Dv3
ztw7szs7Hu+uvWt77Wzj2Gu3zo+6qd00P12qQiGkfSEvlNImJerLC6EKUVNQhRASqp5QhSpUIVRBQRVCCCGEUIX6IOpDoWkDfeqv
-- TRUNCATED --
97LNsqwfrVu3rtXu3oduYmJCtyzrJ2z+P2cS96VPOA/Xde+42N/DqVTqB1gmGZ61a9fKVCp1UT9xOOd113WbbnM4aICOjo41UsoX
juM4e5RSjyqlTuq6HkgpAynla6ZpiCXy924bds2JQBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIPZ/7Sv4"
import requests, json, base64
url = "https://instance.securid.com/aveksa/command.submit"
image_file = "user10.png"
params = {
"cmd": "setUserImage",
"format": "json",
"userId": 10
}
headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'image/png'
}
with open(image_file, "rb") as image_file:
payload = base64.b64encode(image_file.read()).decode('utf-8')
response = requests.post(url, headers=headers, params=params, data=payload)
if response.status_code == 200:
data = response.json()
print(data)
else:
print(f"Request failed with status code {response.status_code}")
Response
- 200
- 400
- 500 Invalid Data
{
"data": {
"type": "setUserImage"
}
}
<html>
<head>
<title>Error</title>
</head>
<body>The content-type must be multipart/form-data with the content set to content-type image/png
Query String=cmd=setUserImage&format=json&userId</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>java.lang.Exception: The File upload for 1gege failed: Illegal base64 character -1</body>
</html>