From ca1349ab45d8f8c87ac78d86581f13a5c0a94e65 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 27 Jun 2018 10:43:03 -0700 Subject: [PATCH] Add an explicit example of constraining "transaction.search" to the webhook documentation Summary: Depends on D19509. Ref T13151. See PHI725. `transaction.search` supports "constraints" and the documentation mentions it in passing, but doesn't really show how to do it, and the method is not automatically self-documenting because it isn't a "real" `*.search` method. Add an example of how to use the `contraints` parameter to retrieve information about only the relevant transactions. Also remove a refernece to `requestb.in`, which is now defunct. Test Plan: Called `transaction.search` with similar parameters. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13151 Differential Revision: https://secure.phabricator.com/D19510 --- src/docs/user/userguide/webhooks.diviner | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/docs/user/userguide/webhooks.diviner b/src/docs/user/userguide/webhooks.diviner index 51521b462b..10d1f36da0 100644 --- a/src/docs/user/userguide/webhooks.diviner +++ b/src/docs/user/userguide/webhooks.diviner @@ -38,9 +38,6 @@ options: phabricator/ $ ./bin/webhook call --id 42 --object D123 ``` -You can use a tool like [[ https://requestb.in | RequestBin ]] to inspect -the headers and payload for calls to hooks. - Verifying Requests ================== @@ -157,6 +154,20 @@ Hooks that are interested in changes should generally make a call to `transaction.search`, passing the transaction PHIDs as a constraint to retrieve details about the transactions. +For example, your call to `transaction.search` may look something like this: + +```lang=json +{ + "objectIdentifier": "PHID-XXXX-abcdef", + "constraints": { + "phids": [ + "PHID-XACT-XXXX-11111111", + "PHID-XACT-XXXX-22222222" + ] + } +} +``` + The `phid.query` method can also be used to retrieve generic information about a list of objects.