The org.opencode4workspace.endpoints.PhotoPostEndpoint is used to post a new profile photo and retrieve a PhotoResponse object coresponding to a successful posting.
The PhotoPostEndpoint is instantiated like the other endpoints, by passing in the WWClient for the request. The JPEG image file is posted using the postPhoto(File file) method. The file should be a .jpg less than 300Kb (this is specified as a restriction of the "/photos" REST endpoint in the Watson Workspace documentation). Alternatively the WWClient.postPhoto(File file) helper method is available for easier use.
The "/photos" endpoint can only be called from a user-authenticated WWClient. They cannot be called from an application-authenticated WWClient.
If the posting is successful, a PhotoResponse object is returned comprising the String id of the photo, a boolean for the successful posting, and a String URL to the photo file.