Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding webhook implementation #3

Merged
merged 1 commit into from
Mar 7, 2025
Merged

Adding webhook implementation #3

merged 1 commit into from
Mar 7, 2025

Conversation

asachs01
Copy link
Owner

@asachs01 asachs01 commented Mar 7, 2025

#Overview

This PR implements a complete webhook system for the Autotask API client, including event handling and webhook verification. It also fixes pagination parameter handling issues that were causing incorrect results.

#Changes

##Webhook Implementation

  • Added webhook handler registration system allowing clients to register handlers for specific event types
  • Implemented webhook event handling with proper routing to registered handlers
  • Added support for webhook signature verification using HMAC-SHA256
  • Created a new SetWebhookSecret method to configure the webhook verification secret
  • Implemented proper HTTP status code responses for webhook requests

##Pagination Fixes

  • Fixed an issue where pagination parameters were incorrectly included in the filter string
  • Updated the FetchPage function to properly set page parameters in query parameters
  • Ensured distinct results are displayed for each page

##Documentation and Examples

  • Added comprehensive webhook example in examples/webhook/
  • Created detailed README for the webhook example explaining setup and usage
  • Updated main README with webhook usage information
  • Added tests for webhook functionality

##Testing

  • Added unit tests for webhook handler registration
  • Added tests for webhook event handling
  • Added tests for webhook signature verification
  • Manually tested pagination fixes with real API calls

##Breaking Changes

None. All changes are backward compatible.

##Future Work

  • Add support for batch webhook processing
  • Implement webhook delivery retry mechanism
  • Add webhook event history tracking

@asachs01 asachs01 merged commit 0d92699 into main Mar 7, 2025
1 check passed
@asachs01 asachs01 deleted the feature/finish_webhooks branch March 7, 2025 03:04
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.

1 participant