using Auth0.ManagementApi;
using System.Threading.Tasks;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await foreach (var item in client.Events.SubscribeAsync(
new SubscribeEventsRequestParameters {
From = "from",
FromTimestamp = "from_timestamp",
EventType = new List<EventStreamSubscribeEventsEventTypeEnum>(){
EventStreamSubscribeEventsEventTypeEnum.ConnectionCreated,
}
}
))
{
/* consume each item */
}
;
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.EventStreamSubscribeEventsEventTypeEnum;
import com.auth0.client.mgmt.types.SubscribeEventsRequestParameters;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.events().subscribe(
SubscribeEventsRequestParameters
.builder()
.eventType(
Arrays.asList(EventStreamSubscribeEventsEventTypeEnum.CONNECTION_CREATED)
)
.from("from")
.fromTimestamp("from_timestamp")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Events\Requests\SubscribeEventsRequestParameters;
use Auth0\SDK\API\Management\Types\EventStreamSubscribeEventsEventTypeEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->events->subscribe(
new SubscribeEventsRequestParameters([
'from' => 'from',
'fromTimestamp' => 'from_timestamp',
'eventType' => [
EventStreamSubscribeEventsEventTypeEnum::ConnectionCreated->value,
],
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.events.subscribe(
from="from",
from_timestamp="from_timestamp",
event_type=[
"connection.created"
],
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.events.subscribe(
from: "from",
from_timestamp: "from_timestamp",
event_type: ["connection.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))
}{
"event": {
"a0stream": "<string>",
"a0tenant": "<string>",
"data": {
"object": {
"id": "<string>",
"name": "<string>",
"strategy": "oidc",
"authentication": {
"active": true
},
"connected_accounts": {
"active": true,
"cross_app_access": true
},
"display_name": "<string>",
"enabled_clients": [
"<string>"
],
"is_domain_connection": true,
"metadata": {},
"options": {
"client_id": "<string>",
"attribute_map": {
"attributes": {},
"userinfo_scope": "<string>"
},
"authorization_endpoint": "<string>",
"connection_settings": {},
"discovery_url": "<string>",
"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>"
},
"realms": [
"<string>"
],
"show_as_button": true
},
"context": {
"tenant": {
"tenant_id": "<string>"
},
"client": {
"id": "<string>",
"metadata": {},
"name": "<string>"
},
"connection": {
"id": "<string>",
"name": "<string>",
"strategy": "<string>"
},
"request": {
"geo": {
"city_name": "<string>",
"continent_code": "<string>",
"country_code": "<string>",
"country_name": "<string>",
"latitude": 123,
"longitude": 123,
"subdivision_code": "<string>",
"subdivision_name": "<string>",
"time_zone": "<string>"
},
"hostname": "<string>",
"ip": "<string>",
"method": "<string>",
"user_agent": "<string>",
"custom_domain": "<string>"
}
}
},
"id": "<string>",
"source": "<string>",
"specversion": "1.0",
"time": "2023-11-07T05:31:56Z",
"type": "connection.created",
"a0purpose": "test"
},
"offset": "<string>",
"type": "connection.created"
}S’abonner aux Events
S’abonner aux événements au moyen de Server-Sent Events (SSE)
using Auth0.ManagementApi;
using System.Threading.Tasks;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await foreach (var item in client.Events.SubscribeAsync(
new SubscribeEventsRequestParameters {
From = "from",
FromTimestamp = "from_timestamp",
EventType = new List<EventStreamSubscribeEventsEventTypeEnum>(){
EventStreamSubscribeEventsEventTypeEnum.ConnectionCreated,
}
}
))
{
/* consume each item */
}
;
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.EventStreamSubscribeEventsEventTypeEnum;
import com.auth0.client.mgmt.types.SubscribeEventsRequestParameters;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.events().subscribe(
SubscribeEventsRequestParameters
.builder()
.eventType(
Arrays.asList(EventStreamSubscribeEventsEventTypeEnum.CONNECTION_CREATED)
)
.from("from")
.fromTimestamp("from_timestamp")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Events\Requests\SubscribeEventsRequestParameters;
use Auth0\SDK\API\Management\Types\EventStreamSubscribeEventsEventTypeEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->events->subscribe(
new SubscribeEventsRequestParameters([
'from' => 'from',
'fromTimestamp' => 'from_timestamp',
'eventType' => [
EventStreamSubscribeEventsEventTypeEnum::ConnectionCreated->value,
],
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.events.subscribe(
from="from",
from_timestamp="from_timestamp",
event_type=[
"connection.created"
],
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.events.subscribe(
from: "from",
from_timestamp: "from_timestamp",
event_type: ["connection.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))
}{
"event": {
"a0stream": "<string>",
"a0tenant": "<string>",
"data": {
"object": {
"id": "<string>",
"name": "<string>",
"strategy": "oidc",
"authentication": {
"active": true
},
"connected_accounts": {
"active": true,
"cross_app_access": true
},
"display_name": "<string>",
"enabled_clients": [
"<string>"
],
"is_domain_connection": true,
"metadata": {},
"options": {
"client_id": "<string>",
"attribute_map": {
"attributes": {},
"userinfo_scope": "<string>"
},
"authorization_endpoint": "<string>",
"connection_settings": {},
"discovery_url": "<string>",
"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>"
},
"realms": [
"<string>"
],
"show_as_button": true
},
"context": {
"tenant": {
"tenant_id": "<string>"
},
"client": {
"id": "<string>",
"metadata": {},
"name": "<string>"
},
"connection": {
"id": "<string>",
"name": "<string>",
"strategy": "<string>"
},
"request": {
"geo": {
"city_name": "<string>",
"continent_code": "<string>",
"country_code": "<string>",
"country_name": "<string>",
"latitude": 123,
"longitude": 123,
"subdivision_code": "<string>",
"subdivision_name": "<string>",
"time_zone": "<string>"
},
"hostname": "<string>",
"ip": "<string>",
"method": "<string>",
"user_agent": "<string>",
"custom_domain": "<string>"
}
}
},
"id": "<string>",
"source": "<string>",
"specversion": "1.0",
"time": "2023-11-07T05:31:56Z",
"type": "connection.created",
"a0purpose": "test"
},
"offset": "<string>",
"type": "connection.created"
}Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Paramètres de requête
Jeton opaque représentant la position dans le flux. S’il n’est pas fourni, le flux commencera à partir des événements les plus récents.
1024Horodatage RFC-3339 indiquant à partir de quel moment commencer la diffusion des événements. Ce paramètre ne doit être utilisé que dans la requête initiale, lorsqu’un curseur n’est pas encore disponible. Les requêtes suivantes doivent utiliser le curseur (from), car il sera plus précis.
20Type(s) d’événement à écouter. Indiquez ce paramètre plusieurs fois pour plusieurs types (p. ex., ?event_type=user.created&event_type=user.updated). S’il n’est pas fourni, tous les types d’événement seront diffusés. Type(s) d’événement à écouter. Indiquez ce paramètre plusieurs fois pour plusieurs types (p. ex., ?event_type=user.created&event_type=user.updated). S’il n’est pas fourni, tous les types d’événements seront diffusés.
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
Flux d’événements établi avec succès.
- 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
Le payload JSON transmis dans chaque ligne de données SSE. Le champ type est injecté à partir du champ d’événement SSE par le SDK. La distinction se fait selon le type : un nom de type d’événement pour les événements, "error" pour les erreurs et "offset-only" pour les heartbeats avec offset seulement.
Représente un événement qui se produit lorsqu’une connexion est créée.
Show child attributes
Show child attributes
Curseur opaque représentant une position dans le flux. Transmettez-le comme paramètre de requête from pour reprendre le flux.
Le type d’événement (injecté à partir du champ event de SSE).
connection.created