curl --request PUT \
--url https://{host}/consent/v1/UserConsents/metadata \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"consentId": "<string>",
"userId": "<string>",
"metadata": {}
}
'import requests
url = "https://{host}/consent/v1/UserConsents/metadata"
payload = {
"consentId": "<string>",
"userId": "<string>",
"metadata": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({consentId: '<string>', userId: '<string>', metadata: {}})
};
fetch('https://{host}/consent/v1/UserConsents/metadata', 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://{host}/consent/v1/UserConsents/metadata",
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([
'consentId' => '<string>',
'userId' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://{host}/consent/v1/UserConsents/metadata"
payload := strings.NewReader("{\n \"consentId\": \"<string>\",\n \"userId\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://{host}/consent/v1/UserConsents/metadata")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"consentId\": \"<string>\",\n \"userId\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/consent/v1/UserConsents/metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"consentId\": \"<string>\",\n \"userId\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"consent": {
"id": "<string>",
"component": "<string>",
"version": 123,
"revision": 123,
"key": "<string>"
},
"acceptedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"isActive": true,
"acceptedBy": "<string>",
"activationSource": "<string>",
"revokedAt": "2023-11-07T05:31:56Z",
"revokedBy": "<string>",
"revocationSource": "<string>",
"metadata": {}
}{
"name": "<string>",
"message": "<string>",
"details": null
}Updates the metadata of a user consent
curl --request PUT \
--url https://{host}/consent/v1/UserConsents/metadata \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"consentId": "<string>",
"userId": "<string>",
"metadata": {}
}
'import requests
url = "https://{host}/consent/v1/UserConsents/metadata"
payload = {
"consentId": "<string>",
"userId": "<string>",
"metadata": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({consentId: '<string>', userId: '<string>', metadata: {}})
};
fetch('https://{host}/consent/v1/UserConsents/metadata', 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://{host}/consent/v1/UserConsents/metadata",
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([
'consentId' => '<string>',
'userId' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://{host}/consent/v1/UserConsents/metadata"
payload := strings.NewReader("{\n \"consentId\": \"<string>\",\n \"userId\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://{host}/consent/v1/UserConsents/metadata")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"consentId\": \"<string>\",\n \"userId\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/consent/v1/UserConsents/metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"consentId\": \"<string>\",\n \"userId\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"consent": {
"id": "<string>",
"component": "<string>",
"version": 123,
"revision": 123,
"key": "<string>"
},
"acceptedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"isActive": true,
"acceptedBy": "<string>",
"activationSource": "<string>",
"revokedAt": "2023-11-07T05:31:56Z",
"revokedBy": "<string>",
"revocationSource": "<string>",
"metadata": {}
}{
"name": "<string>",
"message": "<string>",
"details": null
}Authorizations
Body
The DTO containing the updated metadata
Response
User consent metadata updated successfully
DTO, represents user accepted consent instance
Consent instance information
Show child attributes
Show child attributes
UTC date, when consent was accepted by user
UTC date, when consent will expire
Who accepted the consent. It can be a user, member service representative, etc.
The source which triggered activation of UserConsent Possible values for Coop: "WEB" Internettet "EMAIL" E-mail "TELEF" Telefon "SKM" Skema "BUTIK" Samtykke i butik "MOAPP" MobilApp "M16AP" M16 MobilApp "FRDKA" Freemium APP DK "KNB" KNB NETOPRETTELSE
UTC date, when consent was revoked Null if consent is active
Who revoked the consent. It can be a user, member service representative, etc.
The source which triggered revocation of UserConsent
Metadata for user consent
Show child attributes
Show child attributes