Forum Discussion

jasonnitta's avatar
9 years ago

Uploading Image using REST: apiuser permissions issue

Hello! I'm trying to upload a photo to the default album of a user via REST v1 by using an API user. The API user has every permission that I have access to in the Admin console. We are using session key authentication to make the calls. The REST endpoint that we are calling is:

 

 

users/login/{{username}}/media/albums/default/public/images/upload

 

 

This call is successful when passing in the API user's login to the call. However, when I pass in any other login, I get the following response error:

 

{
  "response": {
    "status": "error",
    "value": null,
    "error": {
      "code": "303",
      "message": "User 59 does not have the following permission(s) at [OUR COMMUNITY]: [ ]"
    },
    "image": null,
    "ratings_histogram": null
  }
}

 

What permissions am I missing? Thanks for your help!

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)

    Hi jasonnitta

     

    I suggest raising a ticket with our Support department - it looks like the error message you are getting back is a bit obscure and for sure it should be reviewed so that it provides the actual permission that is missing so that you can figure out what the problem is.

     

    Thanks,

    • jasonnitta's avatar
      jasonnitta
      Guide

      Thanks for your reply! I forgot to post the response that I got from KaelaC during one of our consulting sessions. It turns out that you are not able to make calls to upload photos to a user's albums on their behalf. So in this case where we have a Java service making API calls using an "API user" we are unable to upload the photo for our other users. Kaela did mention that there may be some backlog items for your API team to create a separate "API user" permission set that would give a middleware service like ours more latitude to do these types of operations via the API.

       

      Our current solution to this issue is to contract Lithium's professional services team to do some custom integration with our APIs to make calls to our APIs to retrieve data for our users in Lithium.