- create - Create trigger
- list - List triggers
- get - Get trigger
- update - Update trigger
- delete - Delete trigger
- searchEvents - Search events for a trigger
- listPresets - List trigger presets
- getPreset - Get trigger preset
- listPresetInputValues - Search trigger preset input values
- searchPresetEvents - Search events for a trigger preset
Create a trigger from a preset and return it with its signing secret.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.PlatformTriggerCreateRequest;
import com.glean.api_client.glean_api_client.models.components.PlatformTriggerDelivery;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformTriggersCreateResponse;
import java.lang.Exception;
import java.util.Map;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformTriggerCreateRequest req = PlatformTriggerCreateRequest.builder()
.presetId("GITHUB_1")
.delivery(PlatformTriggerDelivery.builder()
.webhookUrl("https://example.com/webhook")
.build())
.inputs(Map.ofEntries(
Map.entry("repository", "{repository}")))
.build();
PlatformTriggersCreateResponse res = sdk.triggers().create()
.request(req)
.call();
if (res.platformTriggerCreateResponse().isPresent()) {
System.out.println(res.platformTriggerCreateResponse().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
request |
PlatformTriggerCreateRequest | ✔️ | The request object to use for the request. |
PlatformTriggersCreateResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/PlatformProblemDetailException | 400, 401, 403, 404, 408, 409, 413, 429 | application/problem+json |
| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json |
| models/errors/APIException | 4XX, 5XX | */* |
List triggers owned by the authenticated caller.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformTriggersListResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformTriggersListResponse res = sdk.triggers().list()
.pageSize(50L)
.call();
if (res.platformTriggerListResponse().isPresent()) {
System.out.println(res.platformTriggerListResponse().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
pageSize |
Optional<Long> | ➖ | Maximum number of triggers to return. |
cursor |
Optional<String> | ➖ | Opaque pagination cursor from a previous response. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/PlatformProblemDetailException | 400, 401, 403, 408, 429 | application/problem+json |
| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json |
| models/errors/APIException | 4XX, 5XX | */* |
Retrieve a trigger owned by the authenticated caller.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformTriggersGetResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformTriggersGetResponse res = sdk.triggers().get()
.triggerId("{trigger_id}")
.call();
if (res.platformTriggerGetResponse().isPresent()) {
System.out.println(res.platformTriggerGetResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
triggerId |
String | ✔️ | ID of the trigger to retrieve. | {trigger_id} |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/PlatformProblemDetailException | 400, 401, 403, 404, 408, 429 | application/problem+json |
| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json |
| models/errors/APIException | 4XX, 5XX | */* |
Update a trigger.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.PlatformTriggerDelivery;
import com.glean.api_client.glean_api_client.models.components.PlatformTriggerUpdateRequest;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformTriggersUpdateResponse;
import java.lang.Exception;
import java.util.Map;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformTriggersUpdateResponse res = sdk.triggers().update()
.triggerId("{trigger_id}")
.platformTriggerUpdateRequest(PlatformTriggerUpdateRequest.builder()
.inputs(Map.ofEntries(
Map.entry("repository", "{repository}")))
.delivery(PlatformTriggerDelivery.builder()
.webhookUrl("https://example.com/webhook")
.build())
.build())
.call();
if (res.platformTriggerGetResponse().isPresent()) {
System.out.println(res.platformTriggerGetResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
triggerId |
String | ✔️ | ID of the trigger to update. | {trigger_id} |
platformTriggerUpdateRequest |
PlatformTriggerUpdateRequest | ✔️ | N/A | { "inputs": { "repository": "{repository}" }, "delivery": { "webhook_url": "https://example.com/webhook" } } |
PlatformTriggersUpdateResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/PlatformProblemDetailException | 400, 401, 403, 404, 408, 413, 429 | application/problem+json |
| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json |
| models/errors/APIException | 4XX, 5XX | */* |
Delete a trigger.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformTriggersDeleteResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformTriggersDeleteResponse res = sdk.triggers().delete()
.triggerId("{trigger_id}")
.call();
// handle response
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
triggerId |
String | ✔️ | ID of the trigger to delete. | {trigger_id} |
PlatformTriggersDeleteResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/PlatformProblemDetailException | 400, 401, 403, 404, 408, 429 | application/problem+json |
| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json |
| models/errors/APIException | 4XX, 5XX | */* |
Search recent content events an existing trigger matches. Read-only — no webhook delivery is made. Covers the last seven days.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.PlatformTriggerEventSearchRequest;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformTriggersEventsSearchResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformTriggersEventsSearchResponse res = sdk.triggers().searchEvents()
.triggerId("{trigger_id}")
.platformTriggerEventSearchRequest(PlatformTriggerEventSearchRequest.builder()
.build())
.call();
if (res.platformTriggerEventSearchResponse().isPresent()) {
System.out.println(res.platformTriggerEventSearchResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
triggerId |
String | ✔️ | ID of the trigger whose events to search. | {trigger_id} |
platformTriggerEventSearchRequest |
Optional<PlatformTriggerEventSearchRequest> | ➖ | N/A | { "page_size": 10 } |
PlatformTriggersEventsSearchResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/PlatformProblemDetailException | 400, 401, 403, 404, 408, 413, 429 | application/problem+json |
| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json |
| models/errors/APIException | 4XX, 5XX | */* |
List the trigger presets available to the caller. A preset is a curated content-trigger template (e.g. a new Jira ticket) which is passed when creating a trigger.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformTriggerPresetsListResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformTriggerPresetsListResponse res = sdk.triggers().listPresets()
.pageSize(50L)
.call();
if (res.platformTriggerPresetListResponse().isPresent()) {
System.out.println(res.platformTriggerPresetListResponse().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
datasource |
Optional<String> | ➖ | Restrict results to presets for a single datasource (e.g. github). |
pageSize |
Optional<Long> | ➖ | Maximum number of presets to return. |
cursor |
Optional<String> | ➖ | Opaque pagination cursor from a previous response. |
PlatformTriggerPresetsListResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/PlatformProblemDetailException | 400, 401, 403, 408, 429 | application/problem+json |
| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json |
| models/errors/APIException | 4XX, 5XX | */* |
Retrieve a single trigger preset by id.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformTriggerPresetsGetResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformTriggerPresetsGetResponse res = sdk.triggers().getPreset()
.presetId("{preset_id}")
.call();
if (res.platformTriggerPresetGetResponse().isPresent()) {
System.out.println(res.platformTriggerPresetGetResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
presetId |
String | ✔️ | ID of the preset to retrieve. | {preset_id} |
PlatformTriggerPresetsGetResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/PlatformProblemDetailException | 400, 401, 403, 404, 408, 429 | application/problem+json |
| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json |
| models/errors/APIException | 4XX, 5XX | */* |
Return up to 300 selectable values for a single picklist input on a preset. Results are intended for typeahead selection and are not cursor-paginated. When is_truncated is true, refine query to narrow the result set.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformTriggerPresetsInputValuesListResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformTriggerPresetsInputValuesListResponse res = sdk.triggers().listPresetInputValues()
.presetId("{preset_id}")
.field("{field}")
.call();
if (res.platformTriggerPresetInputValueListResponse().isPresent()) {
System.out.println(res.platformTriggerPresetInputValueListResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
presetId |
String | ✔️ | ID of the preset the input belongs to. | {preset_id} |
field |
String | ✔️ | Field identifier of the input whose values to list. | {field} |
query |
Optional<String> | ➖ | Prefix filter over the input's option values, for typeahead. Matching is on the option value, not its display name. |
PlatformTriggerPresetsInputValuesListResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/PlatformProblemDetailException | 400, 401, 403, 404, 408, 429 | application/problem+json |
| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json |
| models/errors/APIException | 4XX, 5XX | */* |
Search recent content events an unsaved trigger built from this preset would match, to preview it before creating the trigger. Read-only — no trigger is created and no webhook delivery is made. Covers the last seven days.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.PlatformTriggerPresetEventSearchRequest;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformTriggerPresetsEventsSearchResponse;
import java.lang.Exception;
import java.util.Map;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformTriggerPresetsEventsSearchResponse res = sdk.triggers().searchPresetEvents()
.presetId("{preset_id}")
.platformTriggerPresetEventSearchRequest(PlatformTriggerPresetEventSearchRequest.builder()
.inputs(Map.ofEntries(
Map.entry("repository", "{repository}")))
.build())
.call();
if (res.platformTriggerEventSearchResponse().isPresent()) {
System.out.println(res.platformTriggerEventSearchResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
presetId |
String | ✔️ | ID of the preset to preview. | {preset_id} |
platformTriggerPresetEventSearchRequest |
Optional<PlatformTriggerPresetEventSearchRequest> | ➖ | N/A | { "inputs": { "repository": "{repository}" }, "page_size": 10 } |
PlatformTriggerPresetsEventsSearchResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/PlatformProblemDetailException | 400, 401, 403, 404, 408, 413, 429 | application/problem+json |
| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json |
| models/errors/APIException | 4XX, 5XX | */* |