(webhook().webhooks())
- list - List webhook subscriptions
- create - Create webhook subscription
- get - Get webhook subscription
- update - Update webhook subscription
- delete - Delete webhook subscription
List all webhook subscriptions
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.WebhookWebhooksAllResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
WebhookWebhooksAllResponse res = sdk.webhook().webhooks().list()
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.cursor("<value>")
.limit(20L)
.call();
if (res.getWebhooksResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
appId |
Optional<String> |
➖ |
The ID of your Unify application |
dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
cursor |
JsonNullable<String> |
➖ |
Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. |
|
limit |
Optional<Long> |
➖ |
Number of results to return. Minimum 1, Maximum 200, Default 20 |
|
WebhookWebhooksAllResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |
Create a webhook subscription to receive events
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.CreateWebhookRequest;
import com.apideck.unify.models.components.Status;
import com.apideck.unify.models.components.UnifiedApiId;
import com.apideck.unify.models.components.WebhookEventType;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.WebhookWebhooksAddResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
WebhookWebhooksAddResponse res = sdk.webhook().webhooks().create()
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.createWebhookRequest(CreateWebhookRequest.builder()
.unifiedApi(UnifiedApiId.CRM)
.status(Status.ENABLED)
.deliveryUrl("https://example.com/my/webhook/endpoint")
.events(List.of(
WebhookEventType.VAULT_CONNECTION_CREATED,
WebhookEventType.VAULT_CONNECTION_UPDATED))
.description("A description")
.build())
.call();
if (res.createWebhookResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
appId |
Optional<String> |
➖ |
The ID of your Unify application |
dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
createWebhookRequest |
CreateWebhookRequest |
✔️ |
N/A |
|
WebhookWebhooksAddResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |
Get the webhook subscription details
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.WebhookWebhooksOneResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
WebhookWebhooksOneResponse res = sdk.webhook().webhooks().get()
.id("<id>")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.call();
if (res.getWebhookResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
id |
String |
✔️ |
JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. |
|
appId |
Optional<String> |
➖ |
The ID of your Unify application |
dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
WebhookWebhooksOneResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |
Update a webhook subscription
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.Status;
import com.apideck.unify.models.components.UpdateWebhookRequest;
import com.apideck.unify.models.components.WebhookEventType;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.WebhookWebhooksUpdateResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
WebhookWebhooksUpdateResponse res = sdk.webhook().webhooks().update()
.id("<id>")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.updateWebhookRequest(UpdateWebhookRequest.builder()
.description("A description")
.status(Status.ENABLED)
.deliveryUrl("https://example.com/my/webhook/endpoint")
.events(List.of(
WebhookEventType.VAULT_CONNECTION_CREATED,
WebhookEventType.VAULT_CONNECTION_UPDATED))
.build())
.call();
if (res.updateWebhookResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
id |
String |
✔️ |
JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. |
|
appId |
Optional<String> |
➖ |
The ID of your Unify application |
dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
updateWebhookRequest |
UpdateWebhookRequest |
✔️ |
N/A |
|
WebhookWebhooksUpdateResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |
Delete a webhook subscription
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.WebhookWebhooksDeleteResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
WebhookWebhooksDeleteResponse res = sdk.webhook().webhooks().delete()
.id("<id>")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.call();
if (res.deleteWebhookResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
id |
String |
✔️ |
JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. |
|
appId |
Optional<String> |
➖ |
The ID of your Unify application |
dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
WebhookWebhooksDeleteResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |