Skip to main content
PUT
/
connections
/
{nameOrID}
/
datamasking-rules
Update Data Masking Rule Connections
curl --request PUT \
  --url https://use.hoop.dev/api/connections/{nameOrID}/datamasking-rules \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "status": "active",
    "rule_id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"
  }
]
'
import requests

url = "https://use.hoop.dev/api/connections/{nameOrID}/datamasking-rules"

payload = [
{
"status": "active",
"rule_id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"
}
]
headers = {"Content-Type": "application/json"}

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

print(response.text)
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([{status: 'active', rule_id: '15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7'}])
};

fetch('https://use.hoop.dev/api/connections/{nameOrID}/datamasking-rules', 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://use.hoop.dev/api/connections/{nameOrID}/datamasking-rules",
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([
[
'status' => 'active',
'rule_id' => '15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7'
]
]),
CURLOPT_HTTPHEADER => [
"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://use.hoop.dev/api/connections/{nameOrID}/datamasking-rules"

payload := strings.NewReader("[\n {\n \"status\": \"active\",\n \"rule_id\": \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7\"\n }\n]")

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

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("https://use.hoop.dev/api/connections/{nameOrID}/datamasking-rules")
.header("Content-Type", "application/json")
.body("[\n {\n \"status\": \"active\",\n \"rule_id\": \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7\"\n }\n]")
.asString();
require 'uri'
require 'net/http'

url = URI("https://use.hoop.dev/api/connections/{nameOrID}/datamasking-rules")

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

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"status\": \"active\",\n \"rule_id\": \"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7\"\n }\n]"

response = http.request(request)
puts response.read_body
[
  {
    "connection_id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
    "id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
    "rule_id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
    "status": "active"
  }
]
{
"message": "the error description"
}
{
"message": "the error description"
}
{
"message": "the error description"
}

Body

application/json

The request body resource

status
enum<string>
required

The status of the data masking rule

Available options:
active,
inactive
Example:

"active"

rule_id
string

The unique identifier of the data masking rule

Example:

"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"

Response

OK

connection_id
string

The unique identifier of the connection

Example:

"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"

id
string

The unique identifier of the data masking rule connection

Example:

"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"

rule_id
string

The unique identifier of the data masking rule

Example:

"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"

status
enum<string>

The status of the data masking rule connection

Available options:
active,
inactive
Example:

"active"