Package blue.starry.penicillin.endpoints.accountactivity

Functions

Link copied to clipboard
fun AccountActivity.checkSubscription(envName: String, vararg options: Option): EmptyApiAction

Provides a way to determine if a webhook configuration is subscribed to the provided user’s events. If the provided user context has an active subscription with provided application, returns 204 OK. If the response code is not 204, then the user does not have an active subscription. See HTTP Response code and error messages below for details.

Link copied to clipboard
fun AccountActivity.deleteWebhook(    envName: String,     webhookId: String,     vararg options: Option): EmptyApiAction

Removes the webhook from the provided application's all activities configuration. The webhook ID can be accessed by making a call to GET /1.1/account_activity/all/webhooks.

Link copied to clipboard
fun AccountActivity.listSubscriptions(envName: String, vararg options: Option): JsonObjectApiAction<Subscription.List>

Returns a list of the current All Activity type subscriptions. Note that the /list endpoint requires application-only OAuth, so requests should be made using a bearer token instead of user context.

Link copied to clipboard
fun AccountActivity.listWebhooks(vararg options: Option): JsonObjectApiAction<Webhook.List>

Returns all environments, webhook URLs and their statuses for the authenticating app. Currently, only one webhook URL can be registered to each environment. We mark a URL as invalid if it fails the daily validation check. In order to re-enable the URL, call the update endpoint. Alternatively, this endpoint can be used with an environment name to only return webhook URLS for the given environment: GET account_activity/all/:env_name/webhooks (see second example)

Link copied to clipboard
fun AccountActivity.listWebhooksByEnvName(envName: String, vararg options: Option): JsonArrayApiAction<Webhook.Model>

Returns all environments, webhook URLs and their statuses for the authenticating app. Currently, only one webhook URL can be registered to each environment. We mark a URL as invalid if it fails the daily validation check. In order to re-enable the URL, call the update endpoint. Alternatively, this endpoint can be used with an environment name to only return webhook URLS for the given environment: GET account_activity/all/:env_name/webhooks (see second example)

Link copied to clipboard
fun AccountActivity.registerWebhook(    envName: String,     url: String,     vararg options: Option): JsonObjectApiAction<Webhook.Model>

Registers a webhook URL for all event types. The URL will be validated via CRC request before saving. In case the validation failed, returns comprehensive error message to the requester.

Link copied to clipboard
fun AccountActivity.subscribe(envName: String, vararg options: Option): EmptyApiAction

Subscribes the provided application to all events for the provided environment for all message types. After activation, all events for the requesting user will be sent to the application’s webhook via POST request. Subscriptions are limited to a maximum of 15 unique users per application in the free (sandbox) tier.

Link copied to clipboard
fun AccountActivity.subscriptionCount(vararg options: Option): JsonObjectApiAction<Subscription.Count>

Returns the count of subscriptions that are currently active on your account for all activities. Note that the /count endpoint requires application-only OAuth, so that you should make requests using a bearer token instead of user context.

Link copied to clipboard
fun AccountActivity.triggerCRC(    envName: String,     webhookId: String,     vararg options: Option): EmptyApiAction

Triggers the challenge response check (CRC) for the given environments webhook for all activities. If the check is successful, returns 204 and re-enables the webhook by setting its status to valid.

Link copied to clipboard
fun AccountActivity.unsubscribe(envName: String, vararg options: Option): EmptyApiAction

Deactivates subscription(s) for the provided user context and application for all activities. After deactivation, all events for the requesting user will no longer be sent to the webhook URL.

Properties

Link copied to clipboard

Shorthand property to AccountActivity.listWebhooks.

Link copied to clipboard