curl --request PATCH \
--url https://cloud.cdata.com/api/v1/admin/users/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "deactivated"
}
'import requests
url = "https://cloud.cdata.com/api/v1/admin/users/{id}"
payload = { "status": "deactivated" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'deactivated'})
};
fetch('https://cloud.cdata.com/api/v1/admin/users/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloud.cdata.com/api/v1/admin/users/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'deactivated'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloud.cdata.com/api/v1/admin/users/{id}"
payload := strings.NewReader("{\n \"status\": \"deactivated\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://cloud.cdata.com/api/v1/admin/users/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"deactivated\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.cdata.com/api/v1/admin/users/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"deactivated\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>",
"status": "active",
"scim_managed": true,
"external_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "USER_NOT_FOUND",
"message": "The specified user does not exist."
}
}{
"error": {
"code": "SCIM_MANAGED_FIELD",
"message": "Name fields on SCIM-provisioned users are owned by the IdP and cannot be updated via this endpoint."
}
}ユーザーの更新
Partially update user attributes. Only fields included in the request body are modified; omitted fields retain their current values. Name fields (first_name, last_name) cannot be updated for SCIM-managed users; they are owned by the IdP.
curl --request PATCH \
--url https://cloud.cdata.com/api/v1/admin/users/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "deactivated"
}
'import requests
url = "https://cloud.cdata.com/api/v1/admin/users/{id}"
payload = { "status": "deactivated" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'deactivated'})
};
fetch('https://cloud.cdata.com/api/v1/admin/users/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloud.cdata.com/api/v1/admin/users/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'deactivated'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloud.cdata.com/api/v1/admin/users/{id}"
payload := strings.NewReader("{\n \"status\": \"deactivated\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://cloud.cdata.com/api/v1/admin/users/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"deactivated\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.cdata.com/api/v1/admin/users/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"deactivated\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>",
"status": "active",
"scim_managed": true,
"external_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "USER_NOT_FOUND",
"message": "The specified user does not exist."
}
}{
"error": {
"code": "SCIM_MANAGED_FIELD",
"message": "Name fields on SCIM-provisioned users are owned by the IdP and cannot be updated via this endpoint."
}
}承認
The access token received from the authorization server in the OAuth 2.0 flow.
パスパラメータ
User identifier (UUID).
ボディ
The user's first name. Not accepted for scim_managed: true users; name fields are owned by the IdP.
The user's last name. null for users with a single name. Not accepted for scim_managed: true users.
Lifecycle state. Deactivating immediately revokes all PATs.
active, deactivated レスポンス
Returns the full user object.
User identifier.
The email address of the user.
The user's first name.
The user's last name.
Current lifecycle state of the user.
active, invited, deactivated false for API-created users. true for SCIM-provisioned users.
Idempotency key supplied by the calling system.
ISO 8601 UTC.
User ID of the creator. null for SCIM-provisioned users.
このページは役に立ちましたか?