Java (SDK)
package hello.world;
import java.lang.Exception;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.errors.ErrorResponse;
import org.openapis.openapi.models.operations.UpdateUserApiClientRequestBody;
import org.openapis.openapi.models.operations.UpdateUserApiClientResponse;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
UpdateUserApiClientResponse res = sdk.clients().updateApiClient()
.clientId("<id>")
.body(UpdateUserApiClientRequestBody.builder()
.build())
.call();
if (res.object().isPresent()) {
// handle response
}
}
}curl --request PUT \
--url https://api.tradearies.dev/v1/users/api/clients/{client_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [
"<string>"
],
"redirect_uris": [
"<string>"
],
"domains": [
"<string>"
]
}
'import requests
url = "https://api.tradearies.dev/v1/users/api/clients/{client_id}"
payload = {
"name": "<string>",
"scopes": ["<string>"],
"redirect_uris": ["<string>"],
"domains": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
scopes: ['<string>'],
redirect_uris: ['<string>'],
domains: ['<string>']
})
};
fetch('https://api.tradearies.dev/v1/users/api/clients/{client_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://api.tradearies.dev/v1/users/api/clients/{client_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'scopes' => [
'<string>'
],
'redirect_uris' => [
'<string>'
],
'domains' => [
'<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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tradearies.dev/v1/users/api/clients/{client_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"redirect_uris\": [\n \"<string>\"\n ],\n \"domains\": [\n \"<string>\"\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))
}require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/users/api/clients/{client_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"redirect_uris\": [\n \"<string>\"\n ],\n \"domains\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"client_id": "<string>",
"name": "<string>",
"scopes": [
"<string>"
],
"redirect_uris": [
"<string>"
],
"domains": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"codes": [
{
"code": "<string>",
"description": "<string>"
}
]
}Clients
Update OAuth2 Client
Updates an existing OAuth2 API client owned by the authenticated user. This endpoint allows users to update their OAuth2 client configuration including client name, allowed scopes, redirect URIs, and domain restrictions. Note: The client_id and client_secret cannot be changed. Only the client owner can update their client configuration.
PUT
/
v1
/
users
/
api
/
clients
/
{client_id}
Java (SDK)
package hello.world;
import java.lang.Exception;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.errors.ErrorResponse;
import org.openapis.openapi.models.operations.UpdateUserApiClientRequestBody;
import org.openapis.openapi.models.operations.UpdateUserApiClientResponse;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
UpdateUserApiClientResponse res = sdk.clients().updateApiClient()
.clientId("<id>")
.body(UpdateUserApiClientRequestBody.builder()
.build())
.call();
if (res.object().isPresent()) {
// handle response
}
}
}curl --request PUT \
--url https://api.tradearies.dev/v1/users/api/clients/{client_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [
"<string>"
],
"redirect_uris": [
"<string>"
],
"domains": [
"<string>"
]
}
'import requests
url = "https://api.tradearies.dev/v1/users/api/clients/{client_id}"
payload = {
"name": "<string>",
"scopes": ["<string>"],
"redirect_uris": ["<string>"],
"domains": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
scopes: ['<string>'],
redirect_uris: ['<string>'],
domains: ['<string>']
})
};
fetch('https://api.tradearies.dev/v1/users/api/clients/{client_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://api.tradearies.dev/v1/users/api/clients/{client_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'scopes' => [
'<string>'
],
'redirect_uris' => [
'<string>'
],
'domains' => [
'<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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tradearies.dev/v1/users/api/clients/{client_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"redirect_uris\": [\n \"<string>\"\n ],\n \"domains\": [\n \"<string>\"\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))
}require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/users/api/clients/{client_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"redirect_uris\": [\n \"<string>\"\n ],\n \"domains\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"client_id": "<string>",
"name": "<string>",
"scopes": [
"<string>"
],
"redirect_uris": [
"<string>"
],
"domains": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"codes": [
{
"code": "<string>",
"description": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Client ID to update
Body
application/json
Response
Client updated successfully
OAuth2 client ID
Client name
List of allowed scopes
List of allowed redirect URIs
List of allowed domains
Client creation timestamp
Client last update timestamp
Last usage timestamp
Was this page helpful?
⌘I