curl -X PUT "https://api-sandbox.whitelabel.com/v1/organizations/users/<user_id>/account-permissions" \
-H "Content-Type: application/json" \
-H "PUBLIC-API-KEY: <PUBLIC-API-KEY>" \
-H "PRIVATE-SECRET-KEY: <PRIVATE-SECRET-KEY>" \
-d '{
"account_permissions": [
{
"account_id": "00000000-0000-0000-0000-000000000000",
"role_id": "string"
}
]
}' const response = await fetch ( `https://api-sandbox.whitelabel.com/v1/organizations/users/${ user_id }/account-permissions` , {
method: 'PUT' ,
headers: { 'Content-Type' : 'application/json' , 'PUBLIC-API-KEY' : '<PUBLIC-API-KEY>' , 'PRIVATE-SECRET-KEY' : '<PRIVATE-SECRET-KEY>' },
body: JSON . stringify ({
"account_permissions" : [
{
"account_id" : "00000000-0000-0000-0000-000000000000" ,
"role_id" : "string"
}
]
})
});
const data = await response. json (); import requests
response = requests.request(
"PUT" ,
"https://api-sandbox.whitelabel.com/v1/organizations/users/ {user_id} /account-permissions" ,
headers = { "PUBLIC-API-KEY" : "<PUBLIC-API-KEY>" , "PRIVATE-SECRET-KEY" : "<PRIVATE-SECRET-KEY>" },
json = {
"account_permissions" : [
{
"account_id" : "00000000-0000-0000-0000-000000000000" ,
"role_id" : "string"
}
]
},
)
data = response.json() <? php
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://api-sandbox.whitelabel.com/v1/organizations/users/<user_id>/account-permissions" );
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , true );
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST , "PUT" );
curl_setopt ($ch, CURLOPT_HTTPHEADER , [ "Content-Type: application/json" , "PUBLIC-API-KEY: <PUBLIC-API-KEY>" , "PRIVATE-SECRET-KEY: <PRIVATE-SECRET-KEY>" ]);
curl_setopt ($ch, CURLOPT_POSTFIELDS , '{
"account_permissions": [
{
"account_id": "00000000-0000-0000-0000-000000000000",
"role_id": "string"
}
]
}' );
$response = curl_exec ($ch);
curl_close ($ch); package main
import (
" fmt "
" io "
" net/http "
" strings "
)
func main () {
req, _ := http. NewRequest ( "PUT" , "https://api-sandbox.whitelabel.com/v1/organizations/users/<user_id>/account-permissions" , strings. NewReader ( `{
"account_permissions": [
{
"account_id": "00000000-0000-0000-0000-000000000000",
"role_id": "string"
}
]
}` ))
req.Header. Set ( "Content-Type" , "application/json" )
req.Header. Set ( "PUBLIC-API-KEY" , "<PUBLIC-API-KEY>" )
req.Header. Set ( "PRIVATE-SECRET-KEY" , "<PRIVATE-SECRET-KEY>" )
resp, err := http.DefaultClient. Do (req)
if err != nil {
panic (err)
}
defer resp.Body. Close ()
data, _ := io. ReadAll (resp.Body)
fmt. Println ( string (data))
} HttpClient client = HttpClient. newHttpClient ();
HttpRequest request = HttpRequest. newBuilder ()
. uri (URI. create ( "https://api-sandbox.whitelabel.com/v1/organizations/users/<user_id>/account-permissions" ))
. header ( "Content-Type" , "application/json" )
. header ( "PUBLIC-API-KEY" , "<PUBLIC-API-KEY>" )
. header ( "PRIVATE-SECRET-KEY" , "<PRIVATE-SECRET-KEY>" )
. method ( "PUT" , HttpRequest.BodyPublishers. ofString ( "{ \n \" account_permissions \" : [ \n { \n \" account_id \" : \" 00000000-0000-0000-0000-000000000000 \" , \n \" role_id \" : \" string \"\n } \n ] \n }" ))
. build ();
HttpResponse < String > response = client. send (request, HttpResponse.BodyHandlers. ofString ());
System.out. println (response. body ()); require "net/http"
require "uri"
uri = URI ( "https://api-sandbox.whitelabel.com/v1/organizations/users/<user_id>/account-permissions" )
http = Net :: HTTP . new (uri. host , uri. port )
http. use_ssl = uri. scheme == "https"
request = Net :: HTTP :: Put . new (uri)
request[ "Content-Type" ] = "application/json"
request[ "PUBLIC-API-KEY" ] = "<PUBLIC-API-KEY>"
request[ "PRIVATE-SECRET-KEY" ] = "<PRIVATE-SECRET-KEY>"
request. body = "{ \n \" account_permissions \" : [ \n { \n \" account_id \" : \" 00000000-0000-0000-0000-000000000000 \" , \n \" role_id \" : \" string \"\n } \n ] \n }"
response = http. request (request)
puts response. body ⧉