Passer au contenu principal
PUT
https://{tenantDomain}/api/v2
/
connections
/
{id}
/
directory-provisioning
/
synchronized-groups
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Connections;
using System.Collections.Generic;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.Connections.DirectoryProvisioning.SetAsync(
            id: "id",
            request: new ReplaceSynchronizedGroupsRequestContent {
                Groups = new List<SynchronizedGroupPayload>(){
                    new SynchronizedGroupPayload {
                        Id = "id"
                    },
                }

            }
        );
    }

}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.connections.directoryprovisioning.requests.ReplaceSynchronizedGroupsRequestContent;
import com.auth0.client.mgmt.types.SynchronizedGroupPayload;
import java.util.Arrays;

public class Example {
    public static void main(String[] args) {
        ManagementApi client = ManagementApi
            .builder()
            .token("<token>")
            .build();

        client.connections().directoryProvisioning().set(
            "id",
            ReplaceSynchronizedGroupsRequestContent
                .builder()
                .groups(
                    Arrays.asList(
                        SynchronizedGroupPayload
                            .builder()
                            .id("id")
                            .build()
                    )
                )
                .build()
        );
    }
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Connections\DirectoryProvisioning\Requests\ReplaceSynchronizedGroupsRequestContent;
use Auth0\SDK\API\Management\Types\SynchronizedGroupPayload;

$client = new Management(
    token: '<token>',
);
$client->connections->directoryProvisioning->set(
    'id',
    new ReplaceSynchronizedGroupsRequestContent([
        'groups' => [
            new SynchronizedGroupPayload([
                'id' => 'id',
            ]),
        ],
    ]),
);
from auth0.management import ManagementClient, SynchronizedGroupPayload

client = ManagementClient(
    token="<token>",
)

client.connections.directory_provisioning.set(
    id="id",
    groups=[
        SynchronizedGroupPayload(
            id="id",
        )
    ],
)
require "auth0"

client = Auth0::Management.new(token: "<token>")

client.connections.directory_provisioning.set(
  id: "id",
  groups: [{
    id: "id"
  }]
)
curl --request PUT \
  --url https://{tenantDomain}/api/v2/connections/{id}/directory-provisioning/synchronized-groups \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "groups": [
    {
      "id": "<string>"
    }
  ]
}
'
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({groups: [{id: '<string>'}]})
};

fetch('https://{tenantDomain}/api/v2/connections/{id}/directory-provisioning/synchronized-groups', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://{tenantDomain}/api/v2/connections/{id}/directory-provisioning/synchronized-groups"

	payload := strings.NewReader("{\n  \"groups\": [\n    {\n      \"id\": \"<string>\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Paramètres de chemin

id
string
requis

The id of the connection to create or replace synchronized groups for

Corps

groups
object[]
requis

Array of Google Workspace Directory group objects to synchronize.

Réponse

No Content