public String addComment(String photosetId, String commentText) throws FlickrException {
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("method", METHOD_ADD_COMMENT);

        parameters.put("photoset_id", photosetId);
        parameters.put("comment_text", commentText);

        // Note: This method requires an HTTP POST request.
        Response response = transportAPI.post(transportAPI.getPath(), parameters, apiKey, sharedSecret);
        if (response.isError()) {
            throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
        }
        // response:
        // <comment id="97777-12492-72057594037942601" />
        Element commentElement = response.getPayload();
        return commentElement.getAttribute("id");
    }
public String addComment ( String photosetId , String commentText ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_ADD_COMMENT ) ; parameters . put ( "photoset_id" , photosetId ) ; parameters . put ( "comment_text" , commentText ) ; Response response = transportAPI . post ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element commentElement = response . getPayload ( ) ; return commentElement . getAttribute ( "id" ) ; }
Add a comment to a photoset. This method requires authentication with 'write' permission.

@param photosetId
The id of the photoset to add a comment to.
@param commentText
Text of the comment
@return the comment id
@throws FlickrException