using Auth0.ManagementApi;
using System.Threading.Tasks;
public partial class Examples
{
public async Task Example() {
var client = new ManagementClient(
token: "<token>"
);
await foreach (var item in client.Events.SubscribeAsync(
new SubscribeEventsRequestParameters {
From = "from",
FromTimestamp = "from_timestamp",
EventType = EventStreamSubscribeEventsEventTypeEnum.GroupCreated
}
))
{
/* consume each item */
}
;
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.events.requests.SubscribeEventsRequestParameters;
import com.auth0.client.mgmt.types.EventStreamSubscribeEventsEventTypeEnum;
import com.auth0.client.mgmt.types.EventStreamSubscribeEventsEventTypeParam;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();
client.events().subscribe(
SubscribeEventsRequestParameters
.builder()
.from("from")
.fromTimestamp("from_timestamp")
.eventType(
EventStreamSubscribeEventsEventTypeParam.of(EventStreamSubscribeEventsEventTypeEnum.GROUP_CREATED)
)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Events\Requests\SubscribeEventsRequestParameters;
use Auth0\SDK\API\Management\Types\EventStreamSubscribeEventsEventTypeEnum;
$client = new Management(
token: '<token>',
);
$client->events->subscribe(
new SubscribeEventsRequestParameters([
'from' => 'from',
'fromTimestamp' => 'from_timestamp',
'eventType' => EventStreamSubscribeEventsEventTypeEnum::GroupCreated->value,
]),
);from auth0.management import ManagementClient
client = ManagementClient(
token="<token>",
)
client.events.subscribe(
from="from",
from_timestamp="from_timestamp",
event_type="group.created",
)require "auth0"
client = Auth0::Management.new(token: "<token>")
client.events.subscribe(
from: "from",
from_timestamp: "from_timestamp",
event_type: "group.created"
)curl --request GET \
--url https://{tenantDomain}/api/v2/events \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenantDomain}/api/v2/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"type": "connection.created",
"offset": "<string>",
"event": {
"specversion": "1.0",
"type": "connection.created",
"source": "<string>",
"id": "<string>",
"time": "2023-11-07T05:31:56Z",
"data": {
"object": {
"id": "<string>",
"name": "<string>",
"strategy": "oidc",
"authentication": {
"active": true
},
"display_name": "<string>",
"enabled_clients": [
"<string>"
],
"is_domain_connection": true,
"metadata": {},
"realms": [
"<string>"
],
"connected_accounts": {
"active": true,
"cross_app_access": true
},
"options": {
"client_id": "<string>",
"authorization_endpoint": "<string>",
"connection_settings": {},
"domain_aliases": [
"<string>"
],
"federated_connections_access_tokens": {
"active": true
},
"icon_url": "<string>",
"id_token_session_expiry_supported": true,
"id_token_signed_response_algs": [],
"issuer": "<string>",
"jwks_uri": "<string>",
"non_persistent_attrs": [
"<string>"
],
"oidc_metadata": {
"authorization_endpoint": "<string>",
"id_token_signing_alg_values_supported": [
"<string>"
],
"issuer": "<string>",
"jwks_uri": "<string>",
"acr_values_supported": [
"<string>"
],
"claim_types_supported": [
"<string>"
],
"claims_locales_supported": [
"<string>"
],
"claims_parameter_supported": true,
"claims_supported": [
"<string>"
],
"display_values_supported": [
"<string>"
],
"dpop_signing_alg_values_supported": [
"<string>"
],
"end_session_endpoint": "<string>",
"grant_types_supported": [
"<string>"
],
"id_token_encryption_alg_values_supported": [
"<string>"
],
"id_token_encryption_enc_values_supported": [
"<string>"
],
"op_policy_uri": "<string>",
"op_tos_uri": "<string>",
"registration_endpoint": "<string>",
"request_object_encryption_alg_values_supported": [
"<string>"
],
"request_object_encryption_enc_values_supported": [
"<string>"
],
"request_object_signing_alg_values_supported": [
"<string>"
],
"request_parameter_supported": true,
"request_uri_parameter_supported": true,
"require_request_uri_registration": true,
"response_modes_supported": [
"<string>"
],
"response_types_supported": [
"<string>"
],
"scopes_supported": [
"<string>"
],
"service_documentation": "<string>",
"subject_types_supported": [
"<string>"
],
"token_endpoint": "<string>",
"token_endpoint_auth_methods_supported": [
"<string>"
],
"token_endpoint_auth_signing_alg_values_supported": [
"<string>"
],
"ui_locales_supported": [
"<string>"
],
"userinfo_encryption_alg_values_supported": [
"<string>"
],
"userinfo_encryption_enc_values_supported": [
"<string>"
],
"userinfo_endpoint": "<string>",
"userinfo_signing_alg_values_supported": [
"<string>"
]
},
"scope": "<string>",
"send_back_channel_nonce": true,
"tenant_domain": "<string>",
"token_endpoint": "<string>",
"upstream_params": {},
"userinfo_endpoint": "<string>",
"attribute_map": {
"attributes": {},
"userinfo_scope": "<string>"
},
"discovery_url": "<string>"
},
"show_as_button": true
},
"context": {
"tenant": {
"tenant_id": "<string>"
},
"client": {
"id": "<string>",
"name": "<string>",
"metadata": {}
},
"connection": {
"id": "<string>",
"name": "<string>",
"strategy": "<string>"
},
"request": {
"geo": {
"continent_code": "<string>",
"country_code": "<string>",
"country_name": "<string>",
"latitude": 123,
"longitude": 123,
"subdivision_code": "<string>",
"subdivision_name": "<string>",
"city_name": "<string>",
"time_zone": "<string>"
},
"hostname": "<string>",
"ip": "<string>",
"method": "<string>",
"user_agent": "<string>",
"custom_domain": "<string>"
}
}
},
"a0tenant": "<string>",
"a0stream": "<string>",
"a0purpose": "test"
}
}Subscribe to events via Server-Sent Events (SSE)
Subscribe to events via Server-Sent Events (SSE)
using Auth0.ManagementApi;
using System.Threading.Tasks;
public partial class Examples
{
public async Task Example() {
var client = new ManagementClient(
token: "<token>"
);
await foreach (var item in client.Events.SubscribeAsync(
new SubscribeEventsRequestParameters {
From = "from",
FromTimestamp = "from_timestamp",
EventType = EventStreamSubscribeEventsEventTypeEnum.GroupCreated
}
))
{
/* consume each item */
}
;
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.events.requests.SubscribeEventsRequestParameters;
import com.auth0.client.mgmt.types.EventStreamSubscribeEventsEventTypeEnum;
import com.auth0.client.mgmt.types.EventStreamSubscribeEventsEventTypeParam;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();
client.events().subscribe(
SubscribeEventsRequestParameters
.builder()
.from("from")
.fromTimestamp("from_timestamp")
.eventType(
EventStreamSubscribeEventsEventTypeParam.of(EventStreamSubscribeEventsEventTypeEnum.GROUP_CREATED)
)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Events\Requests\SubscribeEventsRequestParameters;
use Auth0\SDK\API\Management\Types\EventStreamSubscribeEventsEventTypeEnum;
$client = new Management(
token: '<token>',
);
$client->events->subscribe(
new SubscribeEventsRequestParameters([
'from' => 'from',
'fromTimestamp' => 'from_timestamp',
'eventType' => EventStreamSubscribeEventsEventTypeEnum::GroupCreated->value,
]),
);from auth0.management import ManagementClient
client = ManagementClient(
token="<token>",
)
client.events.subscribe(
from="from",
from_timestamp="from_timestamp",
event_type="group.created",
)require "auth0"
client = Auth0::Management.new(token: "<token>")
client.events.subscribe(
from: "from",
from_timestamp: "from_timestamp",
event_type: "group.created"
)curl --request GET \
--url https://{tenantDomain}/api/v2/events \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenantDomain}/api/v2/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"type": "connection.created",
"offset": "<string>",
"event": {
"specversion": "1.0",
"type": "connection.created",
"source": "<string>",
"id": "<string>",
"time": "2023-11-07T05:31:56Z",
"data": {
"object": {
"id": "<string>",
"name": "<string>",
"strategy": "oidc",
"authentication": {
"active": true
},
"display_name": "<string>",
"enabled_clients": [
"<string>"
],
"is_domain_connection": true,
"metadata": {},
"realms": [
"<string>"
],
"connected_accounts": {
"active": true,
"cross_app_access": true
},
"options": {
"client_id": "<string>",
"authorization_endpoint": "<string>",
"connection_settings": {},
"domain_aliases": [
"<string>"
],
"federated_connections_access_tokens": {
"active": true
},
"icon_url": "<string>",
"id_token_session_expiry_supported": true,
"id_token_signed_response_algs": [],
"issuer": "<string>",
"jwks_uri": "<string>",
"non_persistent_attrs": [
"<string>"
],
"oidc_metadata": {
"authorization_endpoint": "<string>",
"id_token_signing_alg_values_supported": [
"<string>"
],
"issuer": "<string>",
"jwks_uri": "<string>",
"acr_values_supported": [
"<string>"
],
"claim_types_supported": [
"<string>"
],
"claims_locales_supported": [
"<string>"
],
"claims_parameter_supported": true,
"claims_supported": [
"<string>"
],
"display_values_supported": [
"<string>"
],
"dpop_signing_alg_values_supported": [
"<string>"
],
"end_session_endpoint": "<string>",
"grant_types_supported": [
"<string>"
],
"id_token_encryption_alg_values_supported": [
"<string>"
],
"id_token_encryption_enc_values_supported": [
"<string>"
],
"op_policy_uri": "<string>",
"op_tos_uri": "<string>",
"registration_endpoint": "<string>",
"request_object_encryption_alg_values_supported": [
"<string>"
],
"request_object_encryption_enc_values_supported": [
"<string>"
],
"request_object_signing_alg_values_supported": [
"<string>"
],
"request_parameter_supported": true,
"request_uri_parameter_supported": true,
"require_request_uri_registration": true,
"response_modes_supported": [
"<string>"
],
"response_types_supported": [
"<string>"
],
"scopes_supported": [
"<string>"
],
"service_documentation": "<string>",
"subject_types_supported": [
"<string>"
],
"token_endpoint": "<string>",
"token_endpoint_auth_methods_supported": [
"<string>"
],
"token_endpoint_auth_signing_alg_values_supported": [
"<string>"
],
"ui_locales_supported": [
"<string>"
],
"userinfo_encryption_alg_values_supported": [
"<string>"
],
"userinfo_encryption_enc_values_supported": [
"<string>"
],
"userinfo_endpoint": "<string>",
"userinfo_signing_alg_values_supported": [
"<string>"
]
},
"scope": "<string>",
"send_back_channel_nonce": true,
"tenant_domain": "<string>",
"token_endpoint": "<string>",
"upstream_params": {},
"userinfo_endpoint": "<string>",
"attribute_map": {
"attributes": {},
"userinfo_scope": "<string>"
},
"discovery_url": "<string>"
},
"show_as_button": true
},
"context": {
"tenant": {
"tenant_id": "<string>"
},
"client": {
"id": "<string>",
"name": "<string>",
"metadata": {}
},
"connection": {
"id": "<string>",
"name": "<string>",
"strategy": "<string>"
},
"request": {
"geo": {
"continent_code": "<string>",
"country_code": "<string>",
"country_name": "<string>",
"latitude": 123,
"longitude": 123,
"subdivision_code": "<string>",
"subdivision_name": "<string>",
"city_name": "<string>",
"time_zone": "<string>"
},
"hostname": "<string>",
"ip": "<string>",
"method": "<string>",
"user_agent": "<string>",
"custom_domain": "<string>"
}
}
},
"a0tenant": "<string>",
"a0stream": "<string>",
"a0purpose": "test"
}
}Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Paramètres de requête
Opaque token representing position in the stream. If not provided, stream will start from the latest events.
1024RFC-3339 timestamp indicating where to start streaming events from. This should only be used on the initial query when a cursor may not be available. Subsequent requests should use the cursor (from) as it will be more accurate.
20Event type(s) to listen for. Specify multiple times for multiple types (e.g., ?event_type=user.created&event_type=user.updated). If not provided, all event types will be streamed.
connection.created, connection.deleted, connection.updated, group.created, group.deleted, group.member.added, group.member.deleted, group.role.assigned, group.role.deleted, group.updated, organization.connection.added, organization.connection.removed, organization.connection.updated, organization.created, organization.deleted, organization.group.role.assigned, organization.group.role.deleted, organization.member.added, organization.member.deleted, organization.member.role.assigned, organization.member.role.deleted, organization.updated, user.created, user.deleted, user.updated Réponse
Event stream successfully established.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18
- Option 19
- Option 20
- Option 21
- Option 22
- Option 23
- Option 24
- Option 25
- Option 26
- Option 27
The JSON payload delivered in each SSE data line. The type field is injected from the SSE event field by the SDK. Discriminated by type: an event type name for events, "error" for errors, and "offset-only" for cursor-only heartbeats.
The event type (injected from the SSE event field).
connection.created Opaque cursor representing position in the stream. Pass as the from query parameter to resume.
Represents an event that occurs when a connection is created.
Show child attributes
Show child attributes