- Ensure docker is running (with kafka and zookeeper)
- Start
WebhookManagerApplication.java
- Make a GET request to
/test/all(unprotected endpoint). You should get the following response:
Public Content. - Make a GET request to
/test/user(protected endpoint). You should get a401 Unauthorizederror.
- Make a POST request to
/auth/registerwith the following JSON body:{ "name": "Publisher Name", "username": "publisher", "password": "password" }
- Make a POST request to
/auth/loginwith the following JSON body:{ "username": "publisher", "password": "password" } - Copy the token you receive as a response e.g.
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0cHVibGlzaGVyYXNkYXNAZ21haWwuY29tIiwiaWF0IjoxNzU2OTg3NTkzLCJleHAiOjE3NTY5OTExOTN9.Ej7GCz_iUbjFtuhdGdqNEiAVqFprSs7fLyBPkWqgQNikfISA3uxDB8H1LbOdrj1eH0EP7N8-L_KKUqI7u6ofbw
-
Make a GET request to
/test/userwith your token included as a Header with the name "Authorization". Make sure to prefix your token with "Bearer"
Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0cHVibGlzaGVyYXNkYXNAZ21haWwuY29tIiwiaWF0IjoxNzU2OTg3NTkzLCJleHAiOjE3NTY5OTExOTN9.Ej7GCz_iUbjFtuhdGdqNEiAVqFprSs7fLyBPkWqgQNikfISA3uxDB8H1LbOdrj1eH0EP7N8-L_KKUqI7u6ofbwYou should receive the following as a response:
User Content.
Make a POST request to /endpoints with the following JSON body (change the webhook.site url to your own)
{
"url": "https://webhook.site/d46d684f-4612-41b2-aae4-d56dd5329409",
"secret": "secret",
"enabled": true
}- Obtain the Endpoint ID and Publisher Account ID needed to create a Webhook Message by making GET requests to the respective endpoints.
NOTE: these GET requests return ALL stored endpoints and accounts, so make sure you choose the correct IDs.
a.GET {baseurl}/endpoints(attribute is labeledid)
b.GET {baseurl}/accounts(attribute is labeledid) - Make a POST request to
/webhookswith the following JSON body (replace the endpoint and publisher account IDs with your own){ "endpoint_id": "6e12091b-a260-415d-8f29-316168c13709", "publisher_account_id": "dbe919d8-b395-45f7-8b82-076d8556618a", "headers": { "header1": "v1", "header2": "v2" }, "payload": { "prop1": "val1", "prop2": "val2" }, "event_type": "test.send" }