Trello Card Update API
Trello Card Update API
我一直在尝试使用Trello的REST API。到目前为止,我可以通过常规POST调用将一些卡推入系统。我现在想做的是用新的信息更新卡片(即新的描述、新的评论或将卡片移动到新的列表等)
我可以用PUT或POST方法来做这件事吗?还是我首先需要删除旧卡并创建一个新卡?如果是的话,有人能举个例子说明他们是如何做到这一点的吗?
我尝试过以下PUT方法,但似乎不起作用:
PUT https://api.trello.com/1/cards/[existing card id]?key=[key]&token=[TOKEN]
然后我将在请求的正文中提供参数,如下所示:
{
"id": "542de77c832cff3f97884ad8",
"badges": {
"votes": 0,
"viewingMemberVoted": false,
"subscribed": false,
"fogbugz": "",
"checkItems": 0,
"checkItemsChecked": 0,
"comments": 0,
"attachments": 0,
"description": true,
"due": null
},
"checkItemStates": [],
"closed": false,
"dateLastActivity": "2014-10-03T00:02:04.042Z",
"desc": "test",
"descData": null,
"due": null,
"idBoard": "5417684179931e027c3d6bb9",
"idChecklists": [],
"idList": "5417684179931e027c3d6bbc",
"idMembers": [],
"idShort": 14,
"idAttachmentCover": null,
"manualCoverAttachment": false,
"labels": [],
"name": "new test #1 updated",
"pos": 131072,
"shortUrl": "https://trello.com/c/XYZ",
}
顺便说一下,我正在使用Postman客户端来执行我的HTTP方法。最后,我想将这些函数实现到一个小的javascript模块中。有人知道我做错了什么吗?
提前感谢!
很好,所以已经花了很长时间,但现在我在过去的几个小时里遇到了同样的问题。对我来说,x-www-form-urlencoded
身体的把戏没有奏效。
对于仍在挣扎的人们:
1.)您想要更改的每个参数都必须在查询参数中定义-不需要主体
2.)请确保键入的URL为https://
,而不是http://
!这实际上解决了问题。
Trello Api似乎将每个http://
请求都解释为GET。
玩得开心!:-)
使用失眠休息客户端,它使用PUT+body内容作为json。不需要在url中添加字段。
* Preparing request to https://api.trello.com/1/cards/card_id?key=your_key&token=some_token
* Current time is 2020-08-07T11:28:18.144Z
* Using libcurl/7.69.1 OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.7 libidn2/2.1.1 libssh2/1.9.0 nghttp2/1.40.0
* Using default HTTP version
* Disable timeout
* Enable automatic URL encoding
* Enable SSL validation
* Enable cookie sending with jar of 1 cookie
* Found bundle for host api.trello.com: 0xa7f54da37800 [can multiplex]
* Re-using existing connection! (#4) with host api.trello.com
* Connected to api.trello.com (96.7.239.40) port 443 (#4)
* Using Stream ID: 3 (easy handle 0xa7f54da37800)
> PUT /1/cards/card_id?key=your_key&token=some_token HTTP/2
> Host: api.trello.com
> user-agent: insomnia/2020.3.3
> cookie: dsc=blablabla
> content-type: application/json
> accept: */*
> content-length: 20
{"desc":"123123123"}
* We are completely uploaded and fine
相关文章:
- 如何更改bigquery API中的计费层选项
- Amazon S3 REST API大小不正确
- 客户端服务器REST API captcha实现
- 使用Facebook live API创建实时视频对象时的隐私设置
- 谷歌放置API:按国家或餐馆名称搜索餐馆
- MeteorJS:在带有回调的vzaar api上正确使用wrapAsync
- 是否可以控制获取哪些Google地图脚本(JavaScript API)
- API密钥使用和检查示例
- 谷歌地图API v3不适用于移动浏览器或PhoneGap
- 任何方式使AJAX调用Gmail API,而无需通过JS库
- 谷歌地图JS API+JSON-多个标记没有显示
- 单击超链接时,如何使用Google Maps API v3缩放地图
- 如何在 API 调用后和 if 语句中启用提交按钮
- 与运行长作业(javascript,node.js)的第三方API同步的最佳实践
- 搜索api在mac上显示对话框
- Backbone.js restful json API design
- Trello Card Update API
- firebase web API版本2.X支持在写实时数据时返回set和update的承诺
- AngularJS和Restangular试图将update方法转换为API
- BackboneJS Update Model and REST API