From 825127cf1a458ec0751f59b5df76cb844ead4134 Mon Sep 17 00:00:00 2001 From: James Sammut Date: Fri, 14 Jul 2023 12:50:36 +1000 Subject: [PATCH 1/3] Added timeboxed Auditevents example to the GraphQL Cookbook --- pages/apis/graphql/graphql_cookbook.md | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pages/apis/graphql/graphql_cookbook.md b/pages/apis/graphql/graphql_cookbook.md index b70ef79d9a..363c9fa342 100644 --- a/pages/apis/graphql/graphql_cookbook.md +++ b/pages/apis/graphql/graphql_cookbook.md @@ -807,6 +807,7 @@ query { } } } +} ``` Then, use the ID to delete the user: @@ -851,6 +852,32 @@ Query your organization's audit events. Audit events are only available to Enter } ``` +### Get timeboxed organization audit events + +Query your organization's audit events in a timeboxed manner using the `occurredAtFrom` and `occurredAtTo` filters in an Organization's `auditEvents` field. Audit events are only available to Enterprise customers. + +```graphql + query getOrganizationAuditEvents{ + organization(slug:"organization-slug"){ + auditEvents(first: 500, occurredAtFrom: "2023-01-01T12:00:00.000", occurredAtTo: "2023-01-01T13:00:00.000"){ + edges{ + node{ + type + occurredAt + actor{ + name + } + subject{ + name + type + } + } + } + } + } + } +``` + ## Teams A collection of common tasks with teams using the GraphQL API. From 810ab6f4cd25f60ae52d0b099559f3f444eeec63 Mon Sep 17 00:00:00 2001 From: James Sammut Date: Wed, 26 Jul 2023 12:03:49 +1000 Subject: [PATCH 2/3] Audit events timeboxed query update --- pages/apis/graphql/graphql_cookbook.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pages/apis/graphql/graphql_cookbook.md b/pages/apis/graphql/graphql_cookbook.md index 363c9fa342..dff3d183ea 100644 --- a/pages/apis/graphql/graphql_cookbook.md +++ b/pages/apis/graphql/graphql_cookbook.md @@ -852,9 +852,7 @@ Query your organization's audit events. Audit events are only available to Enter } ``` -### Get timeboxed organization audit events - -Query your organization's audit events in a timeboxed manner using the `occurredAtFrom` and `occurredAtTo` filters in an Organization's `auditEvents` field. Audit events are only available to Enterprise customers. +To get all audit events in a given period, use the `occurredAtFrom` and `occurredAtTo` filters like in the following query: ```graphql query getOrganizationAuditEvents{ From 22b67bcf1ca363e917abe2fa0c020f97b2b13182 Mon Sep 17 00:00:00 2001 From: James Sammut Date: Wed, 9 Aug 2023 10:05:22 +1000 Subject: [PATCH 3/3] Adjusted indentation of example queries - query name for timescoped example --- pages/apis/graphql/graphql_cookbook.md | 52 +++++++++++++------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/pages/apis/graphql/graphql_cookbook.md b/pages/apis/graphql/graphql_cookbook.md index dff3d183ea..66f5d88949 100644 --- a/pages/apis/graphql/graphql_cookbook.md +++ b/pages/apis/graphql/graphql_cookbook.md @@ -831,49 +831,49 @@ mutation deleteOrgMember { Query your organization's audit events. Audit events are only available to Enterprise customers. ```graphql - query getOrganizationAuditEvents{ - organization(slug:"organization-slug"){ - auditEvents(first: 500){ - edges{ - node{ +query getOrganizationAuditEvents{ + organization(slug:"organization-slug"){ + auditEvents(first: 500){ + edges{ + node{ + type + occurredAt + actor{ + name + } + subject{ + name type - occurredAt - actor{ - name - } - subject{ - name - type - } } } } } } +} ``` To get all audit events in a given period, use the `occurredAtFrom` and `occurredAtTo` filters like in the following query: ```graphql - query getOrganizationAuditEvents{ - organization(slug:"organization-slug"){ - auditEvents(first: 500, occurredAtFrom: "2023-01-01T12:00:00.000", occurredAtTo: "2023-01-01T13:00:00.000"){ - edges{ - node{ +query getTimeScopedOrganizationAuditEvents{ + organization(slug:"organization-slug"){ + auditEvents(first: 500, occurredAtFrom: "2023-01-01T12:00:00.000", occurredAtTo: "2023-01-01T13:00:00.000"){ + edges{ + node{ + type + occurredAt + actor{ + name + } + subject{ + name type - occurredAt - actor{ - name - } - subject{ - name - type - } } } } } } +} ``` ## Teams