0

I'm trying to set up a nodejs server to make some sync between Podio and Trello. My problem is that when I update Podio through their api, the webhook gets triggered even if I've request for the hook not to be triggered.

I'm using the module: node-podio-api

example call, which causes an infinite loop:

var authCode = result.auth;

var options = { auth: authCode,
                type: "item",
                id: podioId,
                hook: false,
                body:{value:comment}}

podio.commentsAddCommentToObject(options,function(err,result){
    if(err) throw err;
    console.log(util.inspect(result, { showHidden: true, depth: null }))
});
Niels Sønderbæk
  • 3,487
  • 4
  • 30
  • 43
  • not sure if such option is available, however you can create an empty function for the hook and just return everything in order to continue your normal flow – silicakes Aug 13 '15 at 13:28
  • I'm not really sure how this would solve the loop? – Niels Sønderbæk Aug 13 '15 at 13:36
  • I think (as I'm not certain about this API), that if you return a truth statement on your hook option, it will always loop, so what you need is: hook: function() { return false; } instead of just false – silicakes Aug 13 '15 at 16:42

1 Answers1

0

So it turns out that this API doesn't actually support the 'hook' value, which is why it failed. For reference, this is an old API wrapper library, which shouldn't be used. Use the official one: https://github.com/podio/podio-js/

To archive not make the webhook fire when updating an item, you just need to add the following to the url: "?hook=false"

E.g:

podio.request('get','/item/123456?hook=false)

won't fire the webhooks

Niels Sønderbæk
  • 3,487
  • 4
  • 30
  • 43