Update data-sharing consent
import requests
url = "https://api.datagrid.com/v1/identity/data-sharing-opt-in"
payload = { "consent": True }
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({consent: true})
};
fetch('https://api.datagrid.com/v1/identity/data-sharing-opt-in', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://api.datagrid.com/v1/identity/data-sharing-opt-in \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consent": true
}
'{
"object": "data_sharing_opt_in",
"consent": true,
"effective_consent": true,
"reason": "disabled_by_administrator"
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Identity
Update data-sharing consent
Sets the authenticated user’s data-sharing consent. Only a user session may change consent; an API key is refused. The response returns the resulting effective consent, which can still be false when an administrator has disabled data sharing.
PUT
/
identity
/
data-sharing-opt-in
Update data-sharing consent
import requests
url = "https://api.datagrid.com/v1/identity/data-sharing-opt-in"
payload = { "consent": True }
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({consent: true})
};
fetch('https://api.datagrid.com/v1/identity/data-sharing-opt-in', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://api.datagrid.com/v1/identity/data-sharing-opt-in \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consent": true
}
'{
"object": "data_sharing_opt_in",
"consent": true,
"effective_consent": true,
"reason": "disabled_by_administrator"
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Authorizations
Response
Updated data-sharing consent for the caller