IBM Business Process Manager, Version 8.5.5

REST interface for BPD-related resources - UserAvatar Resource - GET Method

Retrieves a user's avatar or profile image. The retrieved image is a base64 encoded string packaged in a JSON structure. Use /avatar/{userNameOrID} to retrieve any user's avatar or use /avatar/current for the avatar of current logged in user.

Sample method invocation

GET /rest/bpm/wle/v1/avatar/{userNameOrID}

Parameters

None

Request content

None

Response content

User Avatar - user avatar details associated with a user (UserAvatar complexType). If there was no avatar is user's profile, a default image is returned. The response attribute 'isDefault', if set to 'true' indicates that the returned image was the default avatar.

The default content type is application/json.

MIME type: application/json


+ View schema
{  "description": "User Avatar", 
   "type": "object",
   "properties":
   {  
      "userID": {"type": "integer",
         "description": "The user ID of the user that is described by this object."
      },
      "userName": {"type": "string",
         "description": "The user name of the user that is described by this object.",
      },
      "userAvatarImage": {"type": "string",
         "description": "A base64 encoded string representing user avatar.",
      },
      "imageFormat": {"type": "string",
         "description": "Format of the image. JPG, GIF or PNG. "
      },
      "isDefault": {"type": "string",
         "description": "Indicates if the avatar image returned was default or not."
      }
   }
}
+ View example content
{
status:"200",
data:
	{
	userID:1,
	userName:"tw_admin",
	userAvatarImage:"iVBORw0KGgoAAAANSUhgILmO2Sz-truncated-R9uVQAAAABJRU5ErkJggg==",
	imageFormat:"png",
	isDefault:"true"
	}
}

MIME type: application/xml


+ View schema
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://rest.bpm.ibm.com/v1/data/useravatar"
	elementFormDefault="unqualified" xmlns="http://www.w3.org/2001/XMLSchema"
	xmlns:tns="http://rest.bpm.ibm.com/v1/data/useravatar"
	xmlns:data="http://rest.bpm.ibm.com/v1/data/root" 
	xmlns:cmn="http://rest.bpm.ibm.com/v1/data/common">

    <import schemaLocation="BPMRestData.xsd" namespace="http://rest.bpm.ibm.com/v1/data/root" />
    <import schemaLocation="Common.xsd" namespace="http://rest.bpm.ibm.com/v1/data/common" />

    <!-- 
	 This type represents a user Avatar.
    -->
    <complexType name="UserAvatarData">
	<complexContent>
	    <extension base="data:Data">
		<sequence>
		  <element name="userID" type="long" />

		    <!-- The alphanumeric user name associated with the user -->
		    <element name="userName" type="string" />
		
		    <!-- The Avatar or profile picture of the user -->
		    <element name="userAvatarImage" type="string" />
		    
		    <element name="imageFormat" type="string" />
		    
		    <element name="isDefault" type="string" />
		</sequence>
	    </extension>
	</complexContent>
    </complexType>


</schema>
+ View example content
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bpm:ResponseData xmlns:bpm="http://rest.bpm.ibm.com/v1/data" xmlns:ex="http://rest.bpm.ibm.com/v1/data/exception" xmlns:soc="http://rest.bpm.ibm.com/v1/data/social" xmlns:sys="http://rest.bpm.ibm.com/v1/data/system" xmlns:ug="http://rest.bpm.ibm.com/v1/data/usergroup">
  <status>200</status>
  <data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns8="http://rest.bpm.ibm.com/v1/data/useravatar" xsi:type="ns8:UserAvatarData">
    <userID>1</userID>
    <userName>tw_admin</userName>
    <userAvatarImage>iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAAiYAYFmG6HCj0UQyNsoqiQJRU5ErkJggg==</userAvatarImage>
    <imageFormat>png</imageFormat>
    <isDefault>true</isDefault>
  </data>
</bpm:ResponseData>

MIME type: application/x-javascript

Error Response content

Detailed error information.

The default content type is application/json.

MIME type: application/json


+ View schema
{  "description": "WLE Error Response", 
   "type": "object",
   "properties":
   {  "status": {"type": "string",
         "description": "The status of the previous API call."
      },
      "exceptionType": {"type": "string",
         "description": "The classname associated with the exception."
      },
      "errorNumber": {"type": "string",
         "description": "Message ID of the exception."
      },
      "errorMessage": {"type": "string",
         "description": "Message text of the exception."
      },
      "errorMessageParameters": {"type": ["string"], "optional": true,
         "description":"Message text parameters of the exception."
      },
      "programmersDetails": {"type": "object", "optional": true,
         "description":"Additional exception details, for example, a stack trace."
      }
   }
} 

MIME type: application/xml


+ View schema
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://rest.bpm.ibm.com/v1/data/exception"
	elementFormDefault="unqualified" xmlns="http://www.w3.org/2001/XMLSchema"
	xmlns:tns="http://rest.bpm.ibm.com/v1/data/exception"
	xmlns:dat="http://rest.bpm.ibm.com/v1/data/root">

    <import schemaLocation="BPMRestData.xsd" namespace="http://rest.bpm.ibm.com/v1/data/root" />
    
    <!--
	This type represents an error response.
    -->    
    <element name="RestRuntimeException">
	<complexType>
	    <sequence>
		<element name="status" type="string"/>
		<element name="Data" type="tns:ExceptionData">
    		</element>
	    </sequence>
	</complexType>
    </element>

    <!-- 
	 This type contains detailed error information associated with an exception.
    -->
    <complexType name="ExceptionData">
	<sequence>
	    <element name="status" type="string"/>

	    <!-- This specifies the java class name of the exception -->
	    <element name="exceptionType" type="string"/>

	    <!-- The message ID of the error message -->
	    <element name="errorNumber" type="string" minOccurs="0"/>

	    <!-- The complete error message -->
	    <element name="errorMessage" type="string"/>

	    <!-- The list of strings inserted into the error message -->
	    <element name="errorMessageParameters" type="string" minOccurs="0" maxOccurs="unbounded"/>

	    <!-- 
		 The stacktrace associated with the exception.
		 Note that this will be omitted unless the "server-stacktrace-enabled" property
		 is enabled in the server's 100Custom.xml file.
	    -->     
	    <element name="programmersDetails" type="string"></element>
	    
	    <!-- Prior responses.  Set if a bulk command was used -->
	    <element name="responses" type="dat:BulkCommandResponses" minOccurs="0"></element>
	</sequence>
    </complexType>
</schema>

MIME type: application/x-javascript

Status codes

The method returns one of the following status codes:
CodeDescription
200 OKSuccess completion.
406 Not AcceptableThe requested content type or content encoding is not supported.
500 Internal Server ErrorA severe problem has occurred, programmer's details are provided.

Available since

8.0.0

Parent Topic: UserAvatar Resource