Skip to content

docs(webhooks): add webhook documentation#13

Open
Crashdoom wants to merge 2 commits intomainfrom
docs/webhooks
Open

docs(webhooks): add webhook documentation#13
Crashdoom wants to merge 2 commits intomainfrom
docs/webhooks

Conversation

@Crashdoom
Copy link
Member

  • Add about webhooks page
  • Add some webhook events and payloads
  • Add info on validating payloads and JWTs
  • Fix spelling error
  • Fix CSS

- Add about webhooks page
- Add some webhook events and payloads
- Add info on validating payloads and JWTs
- Fix spelling error
- Fix CSS
- Add additional event types
- Fix formatting issues
@Crashdoom Crashdoom requested review from Nican and SimonSchick August 25, 2022 16:27
@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: a5e4528
Status: ✅  Deploy successful!
Preview URL: https://d9beb1d4.concat-docs.pages.dev
Branch Preview URL: https://docs-webhooks.concat-docs.pages.dev

View logs

Copy link

@SimonSchick SimonSchick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

There is too much spacing on the page which leads to the code sections being squashed/compressed

Each POST request will include the following headers:

<attribute id="ep-ch-user-agent" name="user-agent" type="string" response>
The HTTP client used to send the request. This will always be <code>ConCat/AxiosHTTPClient</code>.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't really matter for authenticating webhook requests and I don't think we should include that here as some people might start to depend on it incorrectly as an 'identification' step.

The HTTP client used to send the request. This will always be <code>ConCat/AxiosHTTPClient</code>.
</attribute>
<attribute id="ep-ch-authorization" name="authorization" type="string" response>
A bearer token with a signed JWT payload containing a base64-encoded sha256 hash of the <code>data</code> property. See <link to="/docs/api/webhooks/validating"><strong>Validating Payloads</strong></link> for more information.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add link to header spec maybe?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also consider adding links to jwt spec etc just to make this clearer.

</div>
<div>
<exampleBox header='Response' headerSubText='application/json'>
{`{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we potentially store these in separate files?

<parentAttribute id="ep-et-vu-volunteer" name="volunteer" type="object" response>
<span>The volunteer record containing the user's application.</span>
<>
<attribute id="ep-et-vu-v-id" name="id" type="string" response>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little worried this is going to become extremely repetitive very quickly which will potentially add to copy/paste errors.


## JWT format

The JWT payload will contain the following properties:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also link here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants