Skip to content

Commit

Permalink
Adds docs and example for webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
ajimix committed May 11, 2018
1 parent 02ede8b commit 39a07e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions asana.php
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,8 @@ public function removeCustomFieldFromProject($projectId, $customFieldId)

/**
* Creates a webhook.
* Please read the documentation (or see webhook-target.php inside examples) as the target must be a valid url and must return a valid header back.
* https://asana.com/developers/api-reference/webhooks
*
* @param string $resourceId A resource ID to subscribe to. The resource can be a task or project.
* @param string $target The URL to receive the HTTP POST.
Expand Down
11 changes: 11 additions & 0 deletions examples/webhook-target.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
* This is just a simple example of a webhook target that you must implement in order to be able to create it properly with the API.
* The url should respond to https POST requests and has to be accessible by ASANA.
*
* For more information please read the following resources:
* https://asana.com/developers/api-reference/webhooks
* http://resthooks.org/docs/security/
*/
header('x-hook-secret: ' . $_SERVER['HTTP_X_HOOK_SECRET']);
echo '200 OK';

0 comments on commit 39a07e0

Please sign in to comment.