简体   繁体   English

使用 API 更新跑道个人资料图片

[英]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.我们计划制作一个 Podio Out of Office 扩展,以便人们可以添加开始和结束日期,并且个人资料图片将在此期间自动更改为不在办公室版本。

We cannot see a method to do that in Podio API documentation and tried the solution as per the official comment here .我们在 Podio API 文档中看不到这样做的方法,并根据此处官方评论尝试了解决方案。

But that method is not working now.但是这种方法现在行不通了。 Here is the error we are receiving这是我们收到的错误

在此处输入图片说明

Any help on how to do this?有关如何执行此操作的任何帮助?

Please try using https instead of http, and PUT instead of POST.请尝试使用 https 代替 http,使用 PUT 代替 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 )获取用户当前的个人资料GET /contact/user/{user_id} (我们称结果为p
  2. Get the users avatar from p.image.link (should be a URL)p.image.link获取用户头像(应该是一个 URL)
  3. Download and alter the image下载并更改图像
  4. As the user: Upload the image - get the file ID, let's call it image_id作为用户:上传图片 - 获取文件 ID,我们称之为image_id
  5. As the user: PUT to /contact/{p.profile_id} the value {"avatar" : <image_id>}作为用户: PUT/contact/{p.profile_id}{"avatar" : <image_id>}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM