Skip to content

Commit f9d04f9

Browse files
committed
Webhooks API added
1 parent 56816a9 commit f9d04f9

37 files changed

Lines changed: 4547 additions & 7 deletions

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Add this dependency to your project's POM:
3535
<dependency>
3636
<groupId>com.pandadoc</groupId>
3737
<artifactId>pandadoc-java-client</artifactId>
38-
<version>5.1.0</version>
38+
<version>5.2.0</version>
3939
<scope>compile</scope>
4040
</dependency>
4141
```
@@ -45,7 +45,7 @@ Add this dependency to your project's POM:
4545
Add this dependency to your project's build file:
4646

4747
```groovy
48-
compile "com.pandadoc:pandadoc-java-client:5.1.0"
48+
compile "com.pandadoc:pandadoc-java-client:5.2.0"
4949
```
5050

5151
### Others
@@ -58,7 +58,7 @@ mvn clean package
5858

5959
Then manually install the following JARs:
6060

61-
- `target/pandadoc-java-client-5.1.0.jar`
61+
- `target/pandadoc-java-client-5.2.0.jar`
6262
- `target/lib/*.jar`
6363

6464
## Getting Started
@@ -159,6 +159,14 @@ Class | Method | HTTP request | Description
159159
*TemplatesApi* | [**deleteTemplate**](docs/TemplatesApi.md#deleteTemplate) | **DELETE** /public/v1/templates/{id} | Delete Template
160160
*TemplatesApi* | [**detailsTemplate**](docs/TemplatesApi.md#detailsTemplate) | **GET** /public/v1/templates/{id}/details | Details Template
161161
*TemplatesApi* | [**listTemplates**](docs/TemplatesApi.md#listTemplates) | **GET** /public/v1/templates | List Templates
162+
*WebhookEventsApi* | [**detailsWebhookEvent**](docs/WebhookEventsApi.md#detailsWebhookEvent) | **GET** /public/v1/webhook-events/{id} | Get webhook event by uuid
163+
*WebhookEventsApi* | [**listWebhookEvent**](docs/WebhookEventsApi.md#listWebhookEvent) | **GET** /public/v1/webhook-events | Get webhook event page
164+
*WebhookSubscriptionsApi* | [**createWebhookSubscription**](docs/WebhookSubscriptionsApi.md#createWebhookSubscription) | **POST** /public/v1/webhook-subscriptions | Create webhook subscription
165+
*WebhookSubscriptionsApi* | [**deleteWebhookSubscription**](docs/WebhookSubscriptionsApi.md#deleteWebhookSubscription) | **DELETE** /public/v1/webhook-subscriptions/{id} | Delete webhook subscription
166+
*WebhookSubscriptionsApi* | [**detailsWebhookSubscription**](docs/WebhookSubscriptionsApi.md#detailsWebhookSubscription) | **GET** /public/v1/webhook-subscriptions/{id} | Get webhook subscription by uuid
167+
*WebhookSubscriptionsApi* | [**listWebhookSubscriptions**](docs/WebhookSubscriptionsApi.md#listWebhookSubscriptions) | **GET** /public/v1/webhook-subscriptions | Get all webhook subscriptions
168+
*WebhookSubscriptionsApi* | [**updateWebhookSubscription**](docs/WebhookSubscriptionsApi.md#updateWebhookSubscription) | **PATCH** /public/v1/webhook-subscriptions/{id} | Update webhook subscription
169+
*WebhookSubscriptionsApi* | [**updateWebhookSubscriptionSharedKey**](docs/WebhookSubscriptionsApi.md#updateWebhookSubscriptionSharedKey) | **PATCH** /public/v1/webhook-subscriptions/{id}/shared-key | Regenerate webhook subscription shared key
162170

163171
## Documentation for Authorization
164172

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apply plugin: 'java'
44
apply plugin: 'com.diffplug.spotless'
55

66
group = 'com.pandadoc'
7-
version = '5.1.0'
7+
version = '5.2.0'
88

99
buildscript {
1010
repositories {

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "com.pandadoc",
44
name := "pandadoc-java-client",
5-
version := "5.1.0",
5+
version := "5.2.0",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
3+
# WebhookEventDetailsResponse
4+
5+
6+
## Properties
7+
8+
Name | Type | Description | Notes
9+
------------ | ------------- | ------------- | -------------
10+
**uuid** | **UUID** | Unique webhook subscription event identifier | [optional]
11+
**name** | **String** | Webhook subscription name | [optional]
12+
**type** | **WebhookEventTriggerEnum** | | [optional]
13+
**httpStatusCode** | **Integer** | Webhook subscription event response http status code | [optional]
14+
**error** | **WebhookEventErrorEnum** | | [optional]
15+
**deliveryTime** | **OffsetDateTime** | Webhook subscription event delivery time | [optional]
16+
**url** | **String** | Webhook subscription event destination url | [optional]
17+
**signature** | **String** | Webhook subscription event digital signature | [optional]
18+
**requestBody** | **String** | Webhook subscription event request body | [optional]
19+
**responseBody** | **String** | Webhook subscription response body | [optional]
20+
**responseHeaders** | **String** | Webhook subscription response headers | [optional]
21+
**eventTime** | **OffsetDateTime** | Webhook subscription event trigger time | [optional]
22+
23+
24+

docs/WebhookEventErrorEnum.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
3+
# WebhookEventErrorEnum
4+
5+
## Enum
6+
7+
8+
* `INTERNAL_ERROR` (value: `"INTERNAL_ERROR"`)
9+
10+
* `NOT_VALID_URL` (value: `"NOT_VALID_URL"`)
11+
12+
* `CONNECT_ERROR` (value: `"CONNECT_ERROR"`)
13+
14+
* `TIMEOUT_ERROR` (value: `"TIMEOUT_ERROR"`)
15+
16+
17+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
3+
# WebhookEventHttpStatusCodeGroupEnum
4+
5+
## Enum
6+
7+
8+
* `NUMBER_100` (value: `100`)
9+
10+
* `NUMBER_200` (value: `200`)
11+
12+
* `NUMBER_300` (value: `300`)
13+
14+
* `NUMBER_400` (value: `400`)
15+
16+
* `NUMBER_500` (value: `500`)
17+
18+
19+

docs/WebhookEventItemResponse.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
3+
# WebhookEventItemResponse
4+
5+
6+
## Properties
7+
8+
Name | Type | Description | Notes
9+
------------ | ------------- | ------------- | -------------
10+
**uuid** | **UUID** | Unique webhook subscription event identifier | [optional]
11+
**name** | **String** | Webhook subscription name | [optional]
12+
**type** | **WebhookEventTriggerEnum** | | [optional]
13+
**httpStatusCode** | **Integer** | Webhook subscription event response http status code | [optional]
14+
**error** | **WebhookEventErrorEnum** | | [optional]
15+
**deliveryTime** | **OffsetDateTime** | Webhook subscription event delivery time | [optional]
16+
17+
18+

docs/WebhookEventPageResponse.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
3+
# WebhookEventPageResponse
4+
5+
6+
## Properties
7+
8+
Name | Type | Description | Notes
9+
------------ | ------------- | ------------- | -------------
10+
**items** | [**List&lt;WebhookEventItemResponse&gt;**](WebhookEventItemResponse.md) | | [optional]
11+
12+
13+

docs/WebhookEventTriggerEnum.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
3+
# WebhookEventTriggerEnum
4+
5+
## Enum
6+
7+
8+
* `RECIPIENT_COMPLETED` (value: `"recipient_completed"`)
9+
10+
* `DOCUMENT_UPDATED` (value: `"document_updated"`)
11+
12+
* `DOCUMENT_DELETED` (value: `"document_deleted"`)
13+
14+
* `DOCUMENT_STATE_CHANGED` (value: `"document_state_changed"`)
15+
16+
* `DOCUMENT_CREATION_FAILED` (value: `"document_creation_failed"`)
17+
18+
19+

docs/WebhookEventsApi.md

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# WebhookEventsApi
2+
3+
All URIs are relative to *https://api.pandadoc.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**detailsWebhookEvent**](WebhookEventsApi.md#detailsWebhookEvent) | **GET** /public/v1/webhook-events/{id} | Get webhook event by uuid
8+
[**listWebhookEvent**](WebhookEventsApi.md#listWebhookEvent) | **GET** /public/v1/webhook-events | Get webhook event page
9+
10+
11+
12+
## detailsWebhookEvent
13+
14+
> WebhookEventDetailsResponse detailsWebhookEvent(id)
15+
16+
Get webhook event by uuid
17+
18+
### Example
19+
20+
```java
21+
// Import classes:
22+
import com.pandadoc.client.ApiClient;
23+
import com.pandadoc.client.ApiException;
24+
import com.pandadoc.client.Configuration;
25+
import com.pandadoc.client.auth.*;
26+
import com.pandadoc.client.models.*;
27+
import com.pandadoc.client.api.WebhookEventsApi;
28+
29+
import java.util.Arrays;
30+
import java.io.File;
31+
import java.util.List;
32+
33+
public class Example {
34+
public static void main(String[] args) {
35+
ApiClient defaultClient = Configuration.getDefaultApiClient();
36+
defaultClient.setBasePath("https://api.pandadoc.com");
37+
38+
// Configure API key authorization: apiKey
39+
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
40+
apiKey.setApiKey("YOUR API KEY");
41+
// Uncomment the following line to set a prefix for the API key, e.g. "API-Key" (defaults to null)
42+
//apiKey.setApiKeyPrefix("API-Key");
43+
44+
// Configure OAuth2 access token for authorization: oauth2
45+
// OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
46+
// oauth2.setAccessToken("YOUR ACCESS TOKEN");
47+
48+
WebhookEventsApi apiInstance = new WebhookEventsApi(defaultClient);
49+
// UUID | Webhook event uuid
50+
UUID id = UUID.randomUUID();
51+
try {
52+
WebhookEventDetailsResponse result = apiInstance.detailsWebhookEvent(id);
53+
System.out.println(result);
54+
} catch (ApiException e) {
55+
System.err.println("Exception when calling WebhookEventsApi#detailsWebhookEvent");
56+
System.err.println("Status code: " + e.getCode());
57+
System.err.println("Reason: " + e.getResponseBody());
58+
System.err.println("Response headers: " + e.getResponseHeaders());
59+
e.printStackTrace();
60+
}
61+
}
62+
}
63+
```
64+
65+
### Parameters
66+
67+
68+
Name | Type | Description | Notes
69+
------------- | ------------- | ------------- | -------------
70+
**id** | **UUID**| Webhook event uuid |
71+
72+
### Return type
73+
74+
[**WebhookEventDetailsResponse**](WebhookEventDetailsResponse.md)
75+
76+
### Authorization
77+
78+
[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2)
79+
80+
### HTTP request headers
81+
82+
- **Content-Type**: Not defined
83+
- **Accept**: application/json
84+
85+
86+
### HTTP response details
87+
| Status code | Description | Response headers |
88+
|-------------|-------------|------------------|
89+
| **200** | Get webhook event by uuid | - |
90+
| **401** | Authentication error | - |
91+
| **429** | Too Many Requests | - |
92+
93+
94+
## listWebhookEvent
95+
96+
> WebhookEventPageResponse listWebhookEvent(count, page, since, to, type, httpStatusCode, error)
97+
98+
Get webhook event page
99+
100+
### Example
101+
102+
```java
103+
// Import classes:
104+
import com.pandadoc.client.ApiClient;
105+
import com.pandadoc.client.ApiException;
106+
import com.pandadoc.client.Configuration;
107+
import com.pandadoc.client.auth.*;
108+
import com.pandadoc.client.models.*;
109+
import com.pandadoc.client.api.WebhookEventsApi;
110+
111+
import java.util.Arrays;
112+
import java.io.File;
113+
import java.util.List;
114+
115+
public class Example {
116+
public static void main(String[] args) {
117+
ApiClient defaultClient = Configuration.getDefaultApiClient();
118+
defaultClient.setBasePath("https://api.pandadoc.com");
119+
120+
// Configure API key authorization: apiKey
121+
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
122+
apiKey.setApiKey("YOUR API KEY");
123+
// Uncomment the following line to set a prefix for the API key, e.g. "API-Key" (defaults to null)
124+
//apiKey.setApiKeyPrefix("API-Key");
125+
126+
// Configure OAuth2 access token for authorization: oauth2
127+
// OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
128+
// oauth2.setAccessToken("YOUR ACCESS TOKEN");
129+
130+
WebhookEventsApi apiInstance = new WebhookEventsApi(defaultClient);
131+
// Integer | Number of element in page
132+
Integer count = 56;
133+
// Integer | Page number
134+
Integer page = 56;
135+
// OffsetDateTime | Filter option: all events from specified timestamp
136+
OffsetDateTime since = OffsetDateTime.now();
137+
// OffsetDateTime | Filter option: all events up to specified timestamp
138+
OffsetDateTime to = OffsetDateTime.now();
139+
// List<WebhookEventTriggerEnum> | Filter option: all events of type
140+
List<WebhookEventTriggerEnum> type = Arrays.asList();
141+
// List<WebhookEventHttpStatusCodeGroupEnum> | Filter option: all events of http status code
142+
List<WebhookEventHttpStatusCodeGroupEnum> httpStatusCode = Arrays.asList();
143+
// List<WebhookEventErrorEnum> | Filter option: all events with following error
144+
List<WebhookEventErrorEnum> error = Arrays.asList();
145+
try {
146+
WebhookEventPageResponse result = apiInstance.listWebhookEvent(count, page, since, to, type, httpStatusCode, error);
147+
System.out.println(result);
148+
} catch (ApiException e) {
149+
System.err.println("Exception when calling WebhookEventsApi#listWebhookEvent");
150+
System.err.println("Status code: " + e.getCode());
151+
System.err.println("Reason: " + e.getResponseBody());
152+
System.err.println("Response headers: " + e.getResponseHeaders());
153+
e.printStackTrace();
154+
}
155+
}
156+
}
157+
```
158+
159+
### Parameters
160+
161+
162+
Name | Type | Description | Notes
163+
------------- | ------------- | ------------- | -------------
164+
**count** | **Integer**| Number of element in page |
165+
**page** | **Integer**| Page number |
166+
**since** | **OffsetDateTime**| Filter option: all events from specified timestamp | [optional]
167+
**to** | **OffsetDateTime**| Filter option: all events up to specified timestamp | [optional]
168+
**type** | [**List&lt;WebhookEventTriggerEnum&gt;**](WebhookEventTriggerEnum.md)| Filter option: all events of type | [optional]
169+
**httpStatusCode** | [**List&lt;WebhookEventHttpStatusCodeGroupEnum&gt;**](WebhookEventHttpStatusCodeGroupEnum.md)| Filter option: all events of http status code | [optional]
170+
**error** | [**List&lt;WebhookEventErrorEnum&gt;**](WebhookEventErrorEnum.md)| Filter option: all events with following error | [optional]
171+
172+
### Return type
173+
174+
[**WebhookEventPageResponse**](WebhookEventPageResponse.md)
175+
176+
### Authorization
177+
178+
[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2)
179+
180+
### HTTP request headers
181+
182+
- **Content-Type**: Not defined
183+
- **Accept**: application/json
184+
185+
186+
### HTTP response details
187+
| Status code | Description | Response headers |
188+
|-------------|-------------|------------------|
189+
| **200** | Page of webhook events | - |
190+
| **401** | Authentication error | - |
191+
| **429** | Too Many Requests | - |
192+

0 commit comments

Comments
 (0)