Skip to main content
PUT
/
authorization
/
{id}
Update an Authorization
curl --request PUT \
  --url http://{host}:{port}/{contextPath}/authorization/{id} \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "permissions": 16,
  "userId": "*",
  "groupId": null,
  "resourceType": 1,
  "resourceId": "*"
}
'
import requests

url = "http://{host}:{port}/{contextPath}/authorization/{id}"

payload = {
"permissions": 16,
"userId": "*",
"groupId": None,
"resourceType": 1,
"resourceId": "*"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({permissions: 16, userId: '*', groupId: null, resourceType: 1, resourceId: '*'})
};

fetch('http://{host}:{port}/{contextPath}/authorization/{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_PORT => "62437",
CURLOPT_URL => "http://{host}:{port}/{contextPath}/authorization/{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([
'permissions' => 16,
'userId' => '*',
'groupId' => null,
'resourceType' => 1,
'resourceId' => '*'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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 := "http://{host}:{port}/{contextPath}/authorization/{id}"

payload := strings.NewReader("{\n \"permissions\": 16,\n \"userId\": \"*\",\n \"groupId\": null,\n \"resourceType\": 1,\n \"resourceId\": \"*\"\n}")

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

req.Header.Add("Authorization", "Basic <encoded-value>")
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.put("http://{host}:{port}/{contextPath}/authorization/{id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"permissions\": 16,\n \"userId\": \"*\",\n \"groupId\": null,\n \"resourceType\": 1,\n \"resourceId\": \"*\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("http://{host}:{port}/{contextPath}/authorization/{id}")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"permissions\": 16,\n \"userId\": \"*\",\n \"groupId\": null,\n \"resourceType\": 1,\n \"resourceId\": \"*\"\n}"

response = http.request(request)
puts response.read_body
{
  "type": "<string>",
  "message": "<string>",
  "code": 123
}
{
"type": "<string>",
"message": "<string>",
"code": 123
}
{
"type": "<string>",
"message": "<string>",
"code": 123
}
{
"type": "<string>",
"message": "<string>",
"code": 123
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

id
string
required

The id of the authorization to be updated.

Body

application/json
permissions
string[] | null

An array of Strings holding the permissions provided by this authorization.

userId
string | null

The id of the user this authorization has been created for. The value * represents a global authorization ranging over all users.

groupId
string | null

The id of the group this authorization has been created for.

resourceType
integer<int32> | null

An integer representing the resource type. See the User Guide for a list of integer representations of resource types.

resourceId
string | null

The resource Id. The value * represents an authorization ranging over all instances of a resource.

Response

Request successful. This method returns no content.