创建卡片后无法使用 Trello webhook 获取信息卡片
Unable with a Trello webhook to get infos card after card creation
根据 Trello 官方文档 (https://trello.com/c/IMVYmVG1/1458-webhooks),关于 webhook 负载,
“当事件触发时,您将收到以下形式的 JSON 负载:
{
action: { ... }
model: { ... }
}
但我的 webhook 没有 post 任何 "action" 属性。
查看我收到的回调参数:
Started POST "/trello_hooks/doing_callback" for 127.0.0.1 at 2015-02-27 11:29:04 +0100
Processing by TrelloHooksController#doing_callback as HTML
Parameters: {"model"=>{"id"=>"54efd4339c9ed81c24d64ced", "name"=>"Bureau", "desc"=>"", "descData"=>nil, "closed"=>false, "idOrganization"=>nil, "pinned"=>false, "url"=>"https://trello.com/b/C9Tlh6lw/bureau",
"shortUrl"=>"https://trello.com/b/C9Tlh6lw", "prefs"=>{"permissionLevel"=>"private", "voting"=>"disabled", "comments"=>"members", "invitations"=>"members", "selfJoin"=>false, "cardCovers"=>true, "cardAging"=>"regular", "calendarFeedEnabled"=>false, "background"=>"blue", "backgroundColor"=>"#0079BF", "backgroundImage"=>nil,
"backgroundImageScaled"=>nil, "backgroundTile"=>false, "backgroundBrightness"=>"unknown", "canBePublic"=>true, "canBeOrg"=>true, "canBePrivate"=>true, "canInvite"=>true}, "labelNames"=>{"green"=>"Merci Edgar", "yellow"=>"LBP", "orange"=>"Kismar", "red"=>"WhiteMark", "purple"=>"", "blue"=>"", "sky"=>"", "lime"=>"", "pink"=>"", "black"=>""}},
"trello_hook"=>{"action"=>"doing_callback", "model"=>{"id"=>"54efd4339c9ed81c24d64ced", "name"=>"Bureau", "desc"=>"", "descData"=>nil, "closed"=>false, "idOrganization"=>nil, "pinned"=>false, "url"=>"https://trello.com/b/C9Tlh6lw/bureau", "shortUrl"=>"https://trello.com/b/C9Tlh6lw", "prefs"=>{"permissionLevel"=>"private", "voting"=>"disabled", "comments"=>"members", "invitations"=>"members", "selfJoin"=>false, "cardCovers"=>true, "cardAging"=>"regular", "calendarFeedEnabled"=>false, "background"=>"blue", "backgroundColor"=>"#0079BF", "backgroundImage"=>nil, "backgroundImageScaled"=>nil, "backgroundTile"=>false, "backgroundBrightness"=>"unknown", "canBePublic"=>true, "canBeOrg"=>true, "canBePrivate"=>true, "canInvite"=>true},
"labelNames"=>{"green"=>"Merci Edgar", "yellow"=>"LBP", "orange"=>"Kismar", "red"=>"WhiteMark", "purple"=>"", "blue"=>"", "sky"=>"", "lime"=>"", "pink"=>"", "black"=>""
}
}
}
}
有什么想法吗?我敢肯定,读过这个问题的男人或女人得到了答案 :) 帮帮我!
很快就会看到你...
看起来 Rails 吃掉了名为 action
的参数,可能是为了促进某些浏览器不支持的 http 动词。
您可以通过request.request_parameters
获取action
参数。
根据 Trello 官方文档 (https://trello.com/c/IMVYmVG1/1458-webhooks),关于 webhook 负载, “当事件触发时,您将收到以下形式的 JSON 负载:
{
action: { ... }
model: { ... }
}
但我的 webhook 没有 post 任何 "action" 属性。
查看我收到的回调参数:
Started POST "/trello_hooks/doing_callback" for 127.0.0.1 at 2015-02-27 11:29:04 +0100
Processing by TrelloHooksController#doing_callback as HTML
Parameters: {"model"=>{"id"=>"54efd4339c9ed81c24d64ced", "name"=>"Bureau", "desc"=>"", "descData"=>nil, "closed"=>false, "idOrganization"=>nil, "pinned"=>false, "url"=>"https://trello.com/b/C9Tlh6lw/bureau",
"shortUrl"=>"https://trello.com/b/C9Tlh6lw", "prefs"=>{"permissionLevel"=>"private", "voting"=>"disabled", "comments"=>"members", "invitations"=>"members", "selfJoin"=>false, "cardCovers"=>true, "cardAging"=>"regular", "calendarFeedEnabled"=>false, "background"=>"blue", "backgroundColor"=>"#0079BF", "backgroundImage"=>nil,
"backgroundImageScaled"=>nil, "backgroundTile"=>false, "backgroundBrightness"=>"unknown", "canBePublic"=>true, "canBeOrg"=>true, "canBePrivate"=>true, "canInvite"=>true}, "labelNames"=>{"green"=>"Merci Edgar", "yellow"=>"LBP", "orange"=>"Kismar", "red"=>"WhiteMark", "purple"=>"", "blue"=>"", "sky"=>"", "lime"=>"", "pink"=>"", "black"=>""}},
"trello_hook"=>{"action"=>"doing_callback", "model"=>{"id"=>"54efd4339c9ed81c24d64ced", "name"=>"Bureau", "desc"=>"", "descData"=>nil, "closed"=>false, "idOrganization"=>nil, "pinned"=>false, "url"=>"https://trello.com/b/C9Tlh6lw/bureau", "shortUrl"=>"https://trello.com/b/C9Tlh6lw", "prefs"=>{"permissionLevel"=>"private", "voting"=>"disabled", "comments"=>"members", "invitations"=>"members", "selfJoin"=>false, "cardCovers"=>true, "cardAging"=>"regular", "calendarFeedEnabled"=>false, "background"=>"blue", "backgroundColor"=>"#0079BF", "backgroundImage"=>nil, "backgroundImageScaled"=>nil, "backgroundTile"=>false, "backgroundBrightness"=>"unknown", "canBePublic"=>true, "canBeOrg"=>true, "canBePrivate"=>true, "canInvite"=>true},
"labelNames"=>{"green"=>"Merci Edgar", "yellow"=>"LBP", "orange"=>"Kismar", "red"=>"WhiteMark", "purple"=>"", "blue"=>"", "sky"=>"", "lime"=>"", "pink"=>"", "black"=>""
}
}
}
}
有什么想法吗?我敢肯定,读过这个问题的男人或女人得到了答案 :) 帮帮我!
很快就会看到你...
看起来 Rails 吃掉了名为 action
的参数,可能是为了促进某些浏览器不支持的 http 动词。
您可以通过request.request_parameters
获取action
参数。