Skip to content

Commit a47f935

Browse files
committed
Webhooks API added
1 parent a707c54 commit a47f935

39 files changed

+6056
-5
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ Class | Method | HTTP request | Description
120120
*TemplatesApi* | [**delete_template**](docs/TemplatesApi.md#delete_template) | **DELETE** /public/v1/templates/{id} | Delete Template
121121
*TemplatesApi* | [**details_template**](docs/TemplatesApi.md#details_template) | **GET** /public/v1/templates/{id}/details | Details Template
122122
*TemplatesApi* | [**list_templates**](docs/TemplatesApi.md#list_templates) | **GET** /public/v1/templates | List Templates
123+
*WebhookEventsApi* | [**details_webhook_event**](docs/WebhookEventsApi.md#details_webhook_event) | **GET** /public/v1/webhook-events/{id} | Get webhook event by uuid
124+
*WebhookEventsApi* | [**list_webhook_event**](docs/WebhookEventsApi.md#list_webhook_event) | **GET** /public/v1/webhook-events | Get webhook event page
125+
*WebhookSubscriptionsApi* | [**create_webhook_subscription**](docs/WebhookSubscriptionsApi.md#create_webhook_subscription) | **POST** /public/v1/webhook-subscriptions | Create webhook subscription
126+
*WebhookSubscriptionsApi* | [**delete_webhook_subscription**](docs/WebhookSubscriptionsApi.md#delete_webhook_subscription) | **DELETE** /public/v1/webhook-subscriptions/{id} | Delete webhook subscription
127+
*WebhookSubscriptionsApi* | [**details_webhook_subscription**](docs/WebhookSubscriptionsApi.md#details_webhook_subscription) | **GET** /public/v1/webhook-subscriptions/{id} | Get webhook subscription by uuid
128+
*WebhookSubscriptionsApi* | [**list_webhook_subscriptions**](docs/WebhookSubscriptionsApi.md#list_webhook_subscriptions) | **GET** /public/v1/webhook-subscriptions | Get all webhook subscriptions
129+
*WebhookSubscriptionsApi* | [**update_webhook_subscription**](docs/WebhookSubscriptionsApi.md#update_webhook_subscription) | **PATCH** /public/v1/webhook-subscriptions/{id} | Update webhook subscription
130+
*WebhookSubscriptionsApi* | [**update_webhook_subscription_shared_key**](docs/WebhookSubscriptionsApi.md#update_webhook_subscription_shared_key) | **PATCH** /public/v1/webhook-subscriptions/{id}/shared-key | Regenerate webhook subscription shared key
123131

124132

125133
## License

docs/WebhookEventDetailsResponse.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# WebhookEventDetailsResponse
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**uuid** | **str, none_type** | Unique webhook subscription event identifier | [optional]
8+
**name** | **str** | Webhook subscription name | [optional]
9+
**type** | [**WebhookEventTriggerEnum**](WebhookEventTriggerEnum.md) | | [optional]
10+
**http_status_code** | **int, none_type** | Webhook subscription event response http status code | [optional]
11+
**error** | [**WebhookEventErrorEnum**](WebhookEventErrorEnum.md) | | [optional]
12+
**delivery_time** | **datetime** | Webhook subscription event delivery time | [optional]
13+
**url** | **str** | Webhook subscription event destination url | [optional]
14+
**signature** | **str** | Webhook subscription event digital signature | [optional]
15+
**request_body** | **str** | Webhook subscription event request body | [optional]
16+
**response_body** | **str, none_type** | Webhook subscription response body | [optional]
17+
**response_headers** | **str, none_type** | Webhook subscription response headers | [optional]
18+
**event_time** | **datetime** | Webhook subscription event trigger time | [optional]
19+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
20+
21+
[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
22+
23+

docs/WebhookEventErrorEnum.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# WebhookEventErrorEnum
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**value** | **str** | | must be one of ["INTERNAL_ERROR", "NOT_VALID_URL", "CONNECT_ERROR", "TIMEOUT_ERROR", ]
8+
9+
[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# WebhookEventHttpStatusCodeGroupEnum
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**value** | **int** | | must be one of [100, 200, 300, 400, 500, ]
8+
9+
[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

docs/WebhookEventItemResponse.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# WebhookEventItemResponse
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**uuid** | **str, none_type** | Unique webhook subscription event identifier | [optional]
8+
**name** | **str** | Webhook subscription name | [optional]
9+
**type** | [**WebhookEventTriggerEnum**](WebhookEventTriggerEnum.md) | | [optional]
10+
**http_status_code** | **int, none_type** | Webhook subscription event response http status code | [optional]
11+
**error** | [**WebhookEventErrorEnum**](WebhookEventErrorEnum.md) | | [optional]
12+
**delivery_time** | **datetime** | Webhook subscription event delivery time | [optional]
13+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
14+
15+
[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
16+
17+

docs/WebhookEventPageResponse.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# WebhookEventPageResponse
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**items** | [**[WebhookEventItemResponse]**](WebhookEventItemResponse.md) | | [optional]
8+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
9+
10+
[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

docs/WebhookEventTriggerEnum.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# WebhookEventTriggerEnum
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**value** | **str** | | must be one of ["recipient_completed", "document_updated", "document_deleted", "document_state_changed", "document_creation_failed", ]
8+
9+
[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

docs/WebhookEventsApi.md

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
# pandadoc_client.WebhookEventsApi
2+
3+
All URIs are relative to *https://api.pandadoc.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**details_webhook_event**](WebhookEventsApi.md#details_webhook_event) | **GET** /public/v1/webhook-events/{id} | Get webhook event by uuid
8+
[**list_webhook_event**](WebhookEventsApi.md#list_webhook_event) | **GET** /public/v1/webhook-events | Get webhook event page
9+
10+
11+
# **details_webhook_event**
12+
> WebhookEventDetailsResponse details_webhook_event(id)
13+
14+
Get webhook event by uuid
15+
16+
### Example
17+
18+
* Api Key Authentication (apiKey):
19+
* OAuth Authentication (oauth2):
20+
21+
```python
22+
import pandadoc_client
23+
from pandadoc_client.api import webhook_events_api
24+
from pandadoc_client.model.webhook_event_details_response import WebhookEventDetailsResponse
25+
from pprint import pprint
26+
27+
# Defining the host is optional and defaults to https://api.pandadoc.com
28+
# See configuration.py for a list of all supported configuration parameters.
29+
configuration = pandadoc_client.Configuration(
30+
host="https://api.pandadoc.com",
31+
)
32+
33+
# The client must configure the authentication and authorization parameters
34+
# in accordance with the API server security policy.
35+
# Examples for each auth method are provided below, use the example that
36+
# satisfies your auth use case.
37+
38+
# Configure API key authorization: apiKey
39+
configuration.api_key['apiKey'] = 'YOUR_API_KEY'
40+
configuration.api_key_prefix['apiKey'] = 'API-Key'
41+
42+
# Configure OAuth2 access token for authorization: oauth2
43+
# configuration = pandadoc_client.Configuration(
44+
# host="https://api.pandadoc.com",
45+
# )
46+
# configuration.access_token = 'YOUR_ACCESS_TOKEN'
47+
48+
# Enter a context with an instance of the API client
49+
with pandadoc_client.ApiClient(configuration) as api_client:
50+
# Create an instance of the API class
51+
api_instance = webhook_events_api.WebhookEventsApi(api_client)
52+
id = "id_example" # str | Webhook event uuid
53+
54+
# example passing only required values which don't have defaults set
55+
try:
56+
# Get webhook event by uuid
57+
api_response = api_instance.details_webhook_event(id)
58+
pprint(api_response)
59+
except pandadoc_client.ApiException as e:
60+
print("Exception when calling WebhookEventsApi->details_webhook_event: %s\n" % e)
61+
```
62+
63+
### Parameters
64+
65+
Name | Type | Description | Notes
66+
------------- | ------------- | ------------- | -------------
67+
**id** | **str**| Webhook event uuid |
68+
69+
### Return type
70+
71+
[**WebhookEventDetailsResponse**](WebhookEventDetailsResponse.md)
72+
73+
### Authorization
74+
75+
[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2)
76+
77+
### HTTP request headers
78+
79+
- **Content-Type**: Not defined
80+
- **Accept**: application/json
81+
82+
83+
### HTTP response details
84+
85+
| Status code | Description | Response headers |
86+
|-------------|-------------|------------------|
87+
**200** | Get webhook event by uuid | - |
88+
**401** | Authentication error | - |
89+
**429** | Too Many Requests | - |
90+
91+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
92+
93+
# **list_webhook_event**
94+
> WebhookEventPageResponse list_webhook_event(count, page)
95+
96+
Get webhook event page
97+
98+
### Example
99+
100+
* Api Key Authentication (apiKey):
101+
* OAuth Authentication (oauth2):
102+
103+
```python
104+
import pandadoc_client
105+
from pandadoc_client.api import webhook_events_api
106+
from pandadoc_client.model.webhook_event_trigger_enum import WebhookEventTriggerEnum
107+
from pandadoc_client.model.webhook_event_page_response import WebhookEventPageResponse
108+
from pandadoc_client.model.webhook_event_http_status_code_group_enum import WebhookEventHttpStatusCodeGroupEnum
109+
from pandadoc_client.model.webhook_event_error_enum import WebhookEventErrorEnum
110+
from pprint import pprint
111+
112+
# Defining the host is optional and defaults to https://api.pandadoc.com
113+
# See configuration.py for a list of all supported configuration parameters.
114+
configuration = pandadoc_client.Configuration(
115+
host="https://api.pandadoc.com",
116+
)
117+
118+
# The client must configure the authentication and authorization parameters
119+
# in accordance with the API server security policy.
120+
# Examples for each auth method are provided below, use the example that
121+
# satisfies your auth use case.
122+
123+
# Configure API key authorization: apiKey
124+
configuration.api_key['apiKey'] = 'YOUR_API_KEY'
125+
configuration.api_key_prefix['apiKey'] = 'API-Key'
126+
127+
# Configure OAuth2 access token for authorization: oauth2
128+
# configuration = pandadoc_client.Configuration(
129+
# host="https://api.pandadoc.com",
130+
# )
131+
# configuration.access_token = 'YOUR_ACCESS_TOKEN'
132+
133+
# Enter a context with an instance of the API client
134+
with pandadoc_client.ApiClient(configuration) as api_client:
135+
# Create an instance of the API class
136+
api_instance = webhook_events_api.WebhookEventsApi(api_client)
137+
count = 0 # int | Number of element in page
138+
page = 0 # int | Page number
139+
since = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | Filter option: all events from specified timestamp (optional)
140+
to = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | Filter option: all events up to specified timestamp (optional)
141+
type = [
142+
WebhookEventTriggerEnum("document_state_changed"),
143+
] # [WebhookEventTriggerEnum] | Filter option: all events of type (optional)
144+
http_status_code = [
145+
WebhookEventHttpStatusCodeGroupEnum(400),
146+
] # [WebhookEventHttpStatusCodeGroupEnum] | Filter option: all events of http status code (optional)
147+
error = [
148+
WebhookEventErrorEnum("TIMEOUT_ERROR"),
149+
] # [WebhookEventErrorEnum] | Filter option: all events with following error (optional)
150+
151+
# example passing only required values which don't have defaults set
152+
try:
153+
# Get webhook event page
154+
api_response = api_instance.list_webhook_event(count, page)
155+
pprint(api_response)
156+
except pandadoc_client.ApiException as e:
157+
print("Exception when calling WebhookEventsApi->list_webhook_event: %s\n" % e)
158+
159+
# example passing only required values which don't have defaults set
160+
# and optional values
161+
try:
162+
# Get webhook event page
163+
api_response = api_instance.list_webhook_event(
164+
count,
165+
page,
166+
since=since,
167+
to=to,
168+
type=type,
169+
http_status_code=http_status_code,
170+
error=error,
171+
)
172+
pprint(api_response)
173+
except pandadoc_client.ApiException as e:
174+
print("Exception when calling WebhookEventsApi->list_webhook_event: %s\n" % e)
175+
```
176+
177+
### Parameters
178+
179+
Name | Type | Description | Notes
180+
------------- | ------------- | ------------- | -------------
181+
**count** | **int**| Number of element in page |
182+
**page** | **int**| Page number |
183+
**since** | **datetime**| Filter option: all events from specified timestamp | [optional]
184+
**to** | **datetime**| Filter option: all events up to specified timestamp | [optional]
185+
**type** | [**[WebhookEventTriggerEnum]**](WebhookEventTriggerEnum.md)| Filter option: all events of type | [optional]
186+
**http_status_code** | [**[WebhookEventHttpStatusCodeGroupEnum]**](WebhookEventHttpStatusCodeGroupEnum.md)| Filter option: all events of http status code | [optional]
187+
**error** | [**[WebhookEventErrorEnum]**](WebhookEventErrorEnum.md)| Filter option: all events with following error | [optional]
188+
189+
### Return type
190+
191+
[**WebhookEventPageResponse**](WebhookEventPageResponse.md)
192+
193+
### Authorization
194+
195+
[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2)
196+
197+
### HTTP request headers
198+
199+
- **Content-Type**: Not defined
200+
- **Accept**: application/json
201+
202+
203+
### HTTP response details
204+
205+
| Status code | Description | Response headers |
206+
|-------------|-------------|------------------|
207+
**200** | Page of webhook events | - |
208+
**401** | Authentication error | - |
209+
**429** | Too Many Requests | - |
210+
211+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
212+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# WebhookSubscriptionCreateRequest
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**name** | **str** | |
8+
**url** | **str** | |
9+
**triggers** | [**[WebhookSubscriptionTriggerEnum], none_type**](WebhookSubscriptionTriggerEnum.md) | |
10+
**payload** | [**[WebhookSubscriptionPayloadEnum], none_type**](WebhookSubscriptionPayloadEnum.md) | | [optional]
11+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
12+
13+
[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
14+
15+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# WebhookSubscriptionItemResponse
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**uuid** | **str, none_type** | | [optional]
8+
**name** | **str** | | [optional]
9+
**url** | **str** | | [optional]
10+
**active** | **bool** | | [optional]
11+
**payload** | [**[WebhookSubscriptionPayloadEnum], none_type**](WebhookSubscriptionPayloadEnum.md) | | [optional]
12+
**triggers** | [**[WebhookSubscriptionTriggerEnum], none_type**](WebhookSubscriptionTriggerEnum.md) | | [optional]
13+
**workspace_id** | **str** | | [optional]
14+
**shared_key** | **str** | | [optional]
15+
**status** | [**WebhookSubscriptionStatusEnum**](WebhookSubscriptionStatusEnum.md) | | [optional]
16+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
17+
18+
[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
19+
20+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# WebhookSubscriptionListResponse
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**items** | [**[WebhookSubscriptionItemResponse]**](WebhookSubscriptionItemResponse.md) | | [optional]
8+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
9+
10+
[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# WebhookSubscriptionPatchRequest
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**name** | **str** | | [optional]
8+
**url** | **str** | | [optional]
9+
**active** | **bool** | | [optional] if omitted the server will use the default value of True
10+
**payload** | [**[WebhookSubscriptionPayloadEnum], none_type**](WebhookSubscriptionPayloadEnum.md) | | [optional]
11+
**triggers** | [**[WebhookSubscriptionTriggerEnum], none_type**](WebhookSubscriptionTriggerEnum.md) | | [optional]
12+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
13+
14+
[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
15+
16+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# WebhookSubscriptionPayloadEnum
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**value** | **str** | | must be one of ["metadata", "fields", "products", "tokens", "pricing", ]
8+
9+
[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

0 commit comments

Comments
 (0)