Create/Subscribe to Webhook ======================= ---------------------------------------- 1. [Purpose][purpose] 1. [Endpoint][endpoint] 1. [Parameters][parameters] ---------------------------------------- ### Purpose of the POST Webhook create API Use this API to create a new webhook for a user. This API differs from our others in that it's both interactive and does not return a [Standard Envelope](http://theopenphotoproject.org/documentation/api/Envelope). These are the steps required to complete a webhook subscription. 1. The consumer _(you)_ makes a POST request to the provider _(the API host)_ to `http://apihost.com/webhook/subscribe` with the required parameters. 1. The provider makes a GET request back to your `callback` URL passing along a `mode`, `topic`, and `challenge` parameter. A `verifyToken` parameter is passed back if originally supplied. 1. The consumer must validate that the subscription was intended (typically using the `verifyToken`) and print out the `challenge` value with a HTTP 200 response code. 1. If the consumer response is a HTTP 200 and the content body was equal to `challenge` then the provider completes the subscription. ---------------------------------------- ### Endpoint _Authentication: required_ POST /webhook/subscribe ### Parameters 1. callback (required), A URL to POST to. This also needs to handle GET calls for the verification process. 1. topic (required), _i.e. photo.upload_ - The topic which you'd like to subscribe to. 1. mode (required), Only _sync_ is supported at this time. 1. verifyToken (optional), A provider generated string to which is passed back as part of the verification process. ---------------------------------------- [purpose]: #purpose [endpoint]: #endpoint [parameters]: #parameters