3

I am creating webhook for trello using trello api and mattzuba sdk, webhook is created successfully by using post method but there are two issues

  1. On getting this webhook by using GET function, no results I found.
  2. On changing in model (board id ive used) its not hitting to the callbackURL, i want some example code for callbackurl.

Here is my code of Example.php

$id = '558d029fd94e87c6230df746';
$callback_url = 'http://exampledomain.com/webhook.php';
$description = 'Webhook for board';
$webhook = array(
    'idModel' => $id,
    'callbackURL' => $callback_url,
    'description' => $description,    
);

$post = $trello2->post("tokens/$token/webhooks/?key=$key", array_filter($webhook));
print_r($post);

Here is the code of callbackurl page webhook.php

$json = file_get_contents('php://input');
$action = json_decode($json);
$sql  =  mysql_query("INSERT INTO trellowebhook (data) VALUES   ('$action')",$con);
print_r($sql);
lrnzcig
  • 3,374
  • 4
  • 33
  • 44
  • What does the response to creating the webhook look like? – Aaron Dufour Jul 16 '15 at 04:09
  • whenever change made for particular model, it will hit the callbackURL and send response in json, problem is that its not hitting the callbackURL. – Samra Batool Rizvi Jul 16 '15 at 05:12
  • Hi, according to Trello's doc (http://bit.ly/1MdsEY4), "The provided callbackURL must be a valid URL during the creation of the webhook. We run a quick HTTP HEAD request on the URL, and a 200 status code is not returned in the response, then the webhook will not be created." – Marc Jul 16 '15 at 21:42
  • Is the webhoook working if the callback url is pointing in local pc? like http://192.168.1.140/dti_infosys/main_controller/trelloCallback – Eli Apr 17 '18 at 01:11

0 Answers0