Account User(s)
This action retrieves information about user(s) in your White Swan account. This does not include Referred Clients.
API Method:
Fetch User(s)
POST https://app.whiteswan.io/api/1.1/wf/user
Returns information about users associated with your White Swan account.
Headers
Authorization*
String
Bearer <YOUR API KEY>
Content-Type*
String
application/json
Accept*
String
application/json
user-agent*
String
<YOUR APP>
Request Body
JSON Body*
Object
See specification below
Code Examples - Making the API Call:
curl -X POST "https://app.whiteswan.io/api/1.1/wf/user" \
-H "Authorization: Bearer <YOUR API KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "User-Agent: <YOUR APP>" \
-d '{
"user_email": "[email protected]"
}'import requests
url = "https://app.whiteswan.io/api/1.1/wf/user"
headers = {
"Authorization": "Bearer <YOUR API KEY>",
"Content-Type": "application/json",
"Accept": "application/json",
"User-Agent": "<YOUR APP>"
}
data = {
"user_email": "[email protected]"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())const url = "https://app.whiteswan.io/api/1.1/wf/user";
const headers = {
"Authorization": "Bearer <YOUR API KEY>",
"Content-Type": "application/json",
"Accept": "application/json",
"user-agent": "<YOUR APP>"
};
const data = {
"user_email": "[email protected]"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));import okhttp3.*;
public class WhiteSwanApiCall {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"user_email\":\"[email protected]\"}");
Request request = new Request.Builder()
.url("https://app.whiteswan.io/api/1.1/wf/user")
.post(body)
.addHeader("Authorization", "Bearer <YOUR API KEY>")
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("user-agent", "<YOUR APP>")
.build();
try {
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
} catch (IOException e) {
e.printStackTrace();
}
}
}<?php
$ch = curl_init();
$data = array(
"user_email" => "[email protected]"
);
$headers = array(
"Authorization: Bearer <YOUR API KEY>",
"Content-Type: application/json",
"Accept: application/json",
"user-agent: <YOUR APP>"
);
curl_setopt($ch, CURLOPT_URL, "https://app.whiteswan.io/api/1.1/wf/user");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
?>require 'net/http'
require 'json'
require 'uri'
uri = URI.parse("https://app.whiteswan.io/api/1.1/wf/user")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
headers = {
'Authorization' => 'Bearer <YOUR API KEY>',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'User-Agent' => '<YOUR APP>'
}
data = {
user_email: "[email protected]"
}
request = Net::HTTP::Post.new(uri.path, headers)
request.body = data.to_json
response = http.request(request)
puts response.bodypackage main
import (
"bytes"
"fmt"
"net/http"
)
func main() {
url := "https://app.whiteswan.io/api/1.1/wf/user"
data := `{
"user_email": "[email protected]"
}`
req, err := http.NewRequest("POST", url, bytes.NewBuffer([]byte(data)))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <YOUR API KEY>")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", "<YOUR APP>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}Body Parameters Specification:
User Email
user_email
Text
Optionally, you can get a specific user by specifying their email here.
Returned Parameters Specification:
User Name
name
Text
John Doe
The name of the account user.
User Permission Level
permission
Text
Admin
The permission level assigned to the account user.
Referred Clients
clients_referred
Object List
-
Details of clients referred by the account user.
-Full Name
name
Text
Alice Johnson
The name of the client referred by the account user.
-Associated Request(s) ID
associated_request_ids
List
1234567890x0987654321
The ID of the plan request(s) associated with the referred client.
-Associated Plan(s) ID
associated_plan_ids
List
1234567890x1122334455
The ID of the personal plan(s) associated with the referred client.
Referred Partners
other_partners_referred
Object List
-
Details of other partners referred by the account user.
-Partner Name
name
Text
Sample Bank
The name of other partners referred by the account user.
-Count of Requests
count_of_requests
Number
5
The number of requests associated with the other partner referred by the account user.
-Count of Issued Policies
count_of_issued_policies
Number
2
The number of issued policies associated with the other partner referred by the account user.
Total Amount Credited for User Associated Referrals
total_amount_credited
Number
10000
The total amount credited to the account user for their associated end-user and client referrals.
Last updated
Was this helpful?