Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable with a Trello webhook to get infos card after card creation

According to the Trello official documentation (https://trello.com/c/IMVYmVG1/1458-webhooks), about webhook payloads, "when an event triggers, you will receive a JSON payload in the following form :

{
  action: { ...  }
  model: { ... }
}

But my webhook doesn't post any "action" attribute.

Look at params my callback received :

 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"=>""

       }
      }
     }
    }

Any idea ? I'm sure you the guy or woman who reads this question got the answer :) Help me !

Read you soon...

like image 409
krichtof Avatar asked Feb 27 '15 12:02

krichtof


1 Answers

It looks like Rails eats parameters named action, probably to facilitate http verbs that some browsers don't support.

You can get at the action parameter via request.request_parameters.

like image 126
Aaron Dufour Avatar answered Nov 15 '22 07:11

Aaron Dufour