Forum Discussion

DaveWi's avatar
DaveWi
Khoros Alumni (Retired)
9 years ago

Help with v1 Album.images.upload api?

Can any lithium developer help me to understand the intended usage of the v1 Album.images.upload api?  Looking at the documentation, I see that the endpoint accepts a 'image.content' parameter.  My questions are:

 - Is that a base64 encoded version of the image file that I want to upload?

 - Why is that parameter listed as optional?  That is, how could I ever upload an image without supplying its content?

 

Also, bonus points if someone could comment on what the valid values are for the 'image.visibility'?

 

Thanks in advance for your help consuming the community v1 image upload api!

 

 

  • Documenting the solution to my own question here.  The ''images/upload' api seems to expect multi-part form data and the 'image.content' param expects raw image bytes (not base64 encoded).  Also, the ''image.content'' doesn't really seem to be optional.

     

    curl -v -F image.content=@/path/to/upload/image.jpeg "http://community.lithium.com/community-name/restapi/vc/users/id/[id] /media/albums/default/public/images/upload?restapi.session_key=[redacted]"
  • DaveWi's avatar
    DaveWi
    Khoros Alumni (Retired)

    Documenting the solution to my own question here.  The ''images/upload' api seems to expect multi-part form data and the 'image.content' param expects raw image bytes (not base64 encoded).  Also, the ''image.content'' doesn't really seem to be optional.

     

    curl -v -F image.content=@/path/to/upload/image.jpeg "http://community.lithium.com/community-name/restapi/vc/users/id/[id] /media/albums/default/public/images/upload?restapi.session_key=[redacted]"