apipodio

Update Podio profile picture using API


We were planning to make a Podio Out of Office extension so people can add start and end date and the profile picture will be automatically changed with an out of office version in that period.

We cannot see a method to do that in Podio API documentation and tried the solution as per the official comment here.

But that method is not working now. Here is the error we are receiving

enter image description here

Any help on how to do this?


Solution

  • Please try using https instead of http, and PUT instead of POST.

    curl -H "Content-Type: application/json" 
         -H "Authorization: OAuth2 <my_auth_token>" 
         -X PUT 
         -d '{"avatar":<avatar_id>}'
         "https://api.podio.com/contact/<profile_id>"
    

    Whole solution:

    1. Get the users current profile GET /contact/user/{user_id} (let's call the result p)
    2. Get the users avatar from p.image.link (should be a URL)
    3. Download and alter the image
    4. As the user: Upload the image - get the file ID, let's call it image_id
    5. As the user: PUT to /contact/{p.profile_id} the value {"avatar" : <image_id>}