curl -X POST "https://api-sandbox.whitelabel.com/v1/organizations/users" \
-H "Content-Type: application/json" \
-H "PUBLIC-API-KEY: <PUBLIC-API-KEY>" \
-H "PRIVATE-SECRET-KEY: <PRIVATE-SECRET-KEY>" \
-d '{
"email": "user@example.com",
"first_name": "string",
"last_name": "string",
"account_permissions": [
{
"account_id": "00000000-0000-0000-0000-000000000000",
"role_id": "string"
}
],
"account_group_permissions": [
{
"account_group_id": "00000000-0000-0000-0000-000000000000",
"role_id": "string"
}
]
}' const response = await fetch ( `https://api-sandbox.whitelabel.com/v1/organizations/users` , {
method: 'POST' ,
headers: { 'Content-Type' : 'application/json' , 'PUBLIC-API-KEY' : '<PUBLIC-API-KEY>' , 'PRIVATE-SECRET-KEY' : '<PRIVATE-SECRET-KEY>' },
body: JSON . stringify ({
"email" : "user@example.com" ,
"first_name" : "string" ,
"last_name" : "string" ,
"account_permissions" : [
{
"account_id" : "00000000-0000-0000-0000-000000000000" ,
"role_id" : "string"
}
],
"account_group_permissions" : [
{
"account_group_id" : "00000000-0000-0000-0000-000000000000" ,
"role_id" : "string"
}
]
})
});
const data = await response. json (); import requests
response = requests.request(
"POST" ,
"https://api-sandbox.whitelabel.com/v1/organizations/users" ,
headers = { "PUBLIC-API-KEY" : "<PUBLIC-API-KEY>" , "PRIVATE-SECRET-KEY" : "<PRIVATE-SECRET-KEY>" },
json = {
"email" : "user@example.com" ,
"first_name" : "string" ,
"last_name" : "string" ,
"account_permissions" : [
{
"account_id" : "00000000-0000-0000-0000-000000000000" ,
"role_id" : "string"
}
],
"account_group_permissions" : [
{
"account_group_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" );
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , true );
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST , "POST" );
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 , '{
"email": "user@example.com",
"first_name": "string",
"last_name": "string",
"account_permissions": [
{
"account_id": "00000000-0000-0000-0000-000000000000",
"role_id": "string"
}
],
"account_group_permissions": [
{
"account_group_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 ( "POST" , "https://api-sandbox.whitelabel.com/v1/organizations/users" , strings. NewReader ( `{
"email": "user@example.com",
"first_name": "string",
"last_name": "string",
"account_permissions": [
{
"account_id": "00000000-0000-0000-0000-000000000000",
"role_id": "string"
}
],
"account_group_permissions": [
{
"account_group_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" ))
. header ( "Content-Type" , "application/json" )
. header ( "PUBLIC-API-KEY" , "<PUBLIC-API-KEY>" )
. header ( "PRIVATE-SECRET-KEY" , "<PRIVATE-SECRET-KEY>" )
. method ( "POST" , HttpRequest.BodyPublishers. ofString ( "{ \n \" email \" : \" user@example.com \" , \n \" first_name \" : \" string \" , \n \" last_name \" : \" string \" , \n \" account_permissions \" : [ \n { \n \" account_id \" : \" 00000000-0000-0000-0000-000000000000 \" , \n \" role_id \" : \" string \"\n } \n ], \n \" account_group_permissions \" : [ \n { \n \" account_group_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" )
http = Net :: HTTP . new (uri. host , uri. port )
http. use_ssl = uri. scheme == "https"
request = Net :: HTTP :: Post . new (uri)
request[ "Content-Type" ] = "application/json"
request[ "PUBLIC-API-KEY" ] = "<PUBLIC-API-KEY>"
request[ "PRIVATE-SECRET-KEY" ] = "<PRIVATE-SECRET-KEY>"
request. body = "{ \n \" email \" : \" user@example.com \" , \n \" first_name \" : \" string \" , \n \" last_name \" : \" string \" , \n \" account_permissions \" : [ \n { \n \" account_id \" : \" 00000000-0000-0000-0000-000000000000 \" , \n \" role_id \" : \" string \"\n } \n ], \n \" account_group_permissions \" : [ \n { \n \" account_group_id \" : \" 00000000-0000-0000-0000-000000000000 \" , \n \" role_id \" : \" string \"\n } \n ] \n }"
response = http. request (request)
puts response. body ⧉