package example
import (
context "context"
client "github.com/auth0/go-auth0/management/management/client"
jobs "github.com/auth0/go-auth0/management/management/jobs"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &jobs.CreateExportUsersRequestContent{}
client.Jobs.UsersExports.Create(
context.TODO(),
request,
)
}
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.jobs.usersExports.create({});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.jobs.usersExports.create({});
}
main();
curl --request POST \
--url https://{tenantDomain}/api/v2/jobs/users-exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "con_0000000000000001",
"limit": 5,
"fields": [
{
"name": "<string>",
"export_as": "<string>"
}
]
}
'import requests
url = "https://{tenantDomain}/api/v2/jobs/users-exports"
payload = {
"connection_id": "con_0000000000000001",
"limit": 5,
"fields": [
{
"name": "<string>",
"export_as": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/jobs/users-exports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_id' => 'con_0000000000000001',
'limit' => 5,
'fields' => [
[
'name' => '<string>',
'export_as' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/jobs/users-exports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_id\": \"con_0000000000000001\",\n \"limit\": 5,\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"export_as\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/jobs/users-exports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_id\": \"con_0000000000000001\",\n \"limit\": 5,\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"export_as\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "pending",
"type": "users_export",
"id": "job_0000000000000001",
"created_at": "<string>",
"connection_id": "con_0000000000000001",
"format": "json",
"limit": 5,
"fields": [
{
"name": "<string>",
"export_as": "<string>"
}
]
}Create export users job
Export all users to a file via a long-running job.
package example
import (
context "context"
client "github.com/auth0/go-auth0/management/management/client"
jobs "github.com/auth0/go-auth0/management/management/jobs"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &jobs.CreateExportUsersRequestContent{}
client.Jobs.UsersExports.Create(
context.TODO(),
request,
)
}
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.jobs.usersExports.create({});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.jobs.usersExports.create({});
}
main();
curl --request POST \
--url https://{tenantDomain}/api/v2/jobs/users-exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "con_0000000000000001",
"limit": 5,
"fields": [
{
"name": "<string>",
"export_as": "<string>"
}
]
}
'import requests
url = "https://{tenantDomain}/api/v2/jobs/users-exports"
payload = {
"connection_id": "con_0000000000000001",
"limit": 5,
"fields": [
{
"name": "<string>",
"export_as": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/jobs/users-exports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_id' => 'con_0000000000000001',
'limit' => 5,
'fields' => [
[
'name' => '<string>',
'export_as' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/jobs/users-exports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_id\": \"con_0000000000000001\",\n \"limit\": 5,\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"export_as\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/jobs/users-exports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_id\": \"con_0000000000000001\",\n \"limit\": 5,\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"export_as\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "pending",
"type": "users_export",
"id": "job_0000000000000001",
"created_at": "<string>",
"connection_id": "con_0000000000000001",
"format": "json",
"limit": 5,
"fields": [
{
"name": "<string>",
"export_as": "<string>"
}
]
}Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corps
connection_id of the connection from which users will be exported.
^con_[A-Za-z0-9]{16}$Format of the file. Must be json or csv.
json, csv Limit the number of records.
x >= 1List of fields to be included in the CSV. Defaults to a predefined set of fields.
Show child attributes
Show child attributes
Réponse
Job created successfully.
Status of this job.
Type of job this is.
ID of this job.
When this job was created.
connection_id of the connection from which users will be exported.
^con_[A-Za-z0-9]{16}$Format of the file. Must be json or csv.
json, csv Limit the number of records.
x >= 1List of fields to be included in the CSV. Defaults to a predefined set of fields.
Show child attributes
Show child attributes
Cette page vous a-t-elle été utile ?