Get User Image
Obtain the configured image for a given user.
GET https://instance.securid.com/aveksa/command.submit?cmd=getUserImage
Request
Parameters
getUserImage | |
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. |
userId | The user id of the user to retrieve the image for. If no userId is specified, the image is applied to the user associated with the token. If using trusted application, then the first user image will be returned. |
Headers
Bearer token | |
Accept | application/json |
Content-Type | application/json |
Response
Parameters
Binary image representing the requested logo (Content-Type : image/png
).
Examples
Request
- Curl
- Python
- Node.js
curl -K -X GET \
"https://instance.securid.com/aveksa/command.submit?cmd=getUserImage&format=json&userId=10" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-o 10.png
import requests
url = "https://instance.securid.com/aveksa/command.submit"
params = {
"cmd": "getUserImage",
"format": "json",
"userId": "10"
}
headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
}
response = requests.get(url, params=params, headers=headers)
if response.status_code == 200:
content_type = response.headers.get('Content-Type')
if content_type == 'image/png':
image_data = response.content
with open('10.png', 'wb') as f:
f.write(image_data)
print("Saved to '10.png'")
else:
print("Response does not contain PNG image data.")
else:
print(f"Request failed with status code {response.status_code}")
const axios = require('axios');
const fs = require('fs');
const url = "https://instance.securid.com/aveksa/command.submit";
const params = {
cmd: "getUserImage",
format: "json",
userId: "10"
};
const headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
};
axios.get(url, { params, headers, responseType: 'arraybuffer' })
.then(response => {
if (response.status === 200) {
const content_type = response.headers['content-type'];
if (content_type === 'image/png') {
const image_data = response.data;
fs.writeFileSync('10.png', image_data, 'binary');
console.log("Saved to '10.png'");
} else {
console.log("Response does not contain PNG image data.");
}
} else {
console.log(`Request failed with status code ${response.status}`);
}
})
.catch(error => {
console.error('Error:', error);
});
Response
- 200
- 200 Invalid User ID
Binary image data
{
"data": {
"type": "getUserImage"
}
}