Add Case Party
Any links you share of active cases which leads to White Swan hosted pages have their data protected through two factor authentication, and requires clients to confirm a code sent to their email or phone. Being logged in bypasses the two factor authentication.
Through the add case party endpoint you can add people to a case, which will allow them to have two factor authentication codes sent to their email or phone.
API Method:
Add Case Party
POST https://app.whiteswan.io/api/1.1/wf/invite_case_party
Initiates an application for a particular personal plan under a plan request.
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/invite_case_party" \
-H "Authorization: Bearer <YOUR API KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "User-Agent: <YOUR APP>" \
-d '{
"request": "1755962938878x653642511385623700",
"invitee_email": "[email protected]",
"invitee_phone": "1234567892"
}'import requests
url = "https://app.whiteswan.io/api/1.1/wf/invite_case_party"
headers = {
"Authorization": "Bearer <YOUR API KEY>",
"Content-Type": "application/json",
"Accept": "application/json",
"User-Agent": "<YOUR APP>"
}
data = {
"request": "1755962938878x653642511385623700",
"invitee_email": "[email protected]",
"invitee_phone": "1234567892"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())const url = "https://app.whiteswan.io/api/1.1/wf/invite_case_party";
const headers = {
"Authorization": "Bearer <YOUR API KEY>",
"Content-Type": "application/json",
"Accept": "application/json",
"user-agent": "<YOUR APP>"
};
const data = {
request: "1755962938878x653642511385623700",
invitee_email: "[email protected]",
invitee_phone: "1234567892"
};
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,
"{ \"request\":\"1755962938878x653642511385623700\", " +
"\"invitee_email\":\"[email protected]\", " +
"\"invitee_phone\":\"1234567892\" }");
Request request = new Request.Builder()
.url("https://app.whiteswan.io/api/1.1/wf/invite_case_party")
.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 (Exception e) {
e.printStackTrace();
}
}
}<?php
$ch = curl_init();
$data = array(
"request" => "1755962938878x653642511385623700",
"invitee_email" => "[email protected]",
"invitee_phone" => "1234567892"
);
$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/invite_case_party");
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/invite_case_party")
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 = {
request: "1755962938878x653642511385623700",
invitee_email: "[email protected]",
invitee_phone: "1234567892"
}
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/invite_case_party"
data := `{
"request": "1755962938878x653642511385623700",
"invitee_email": "[email protected]",
"invitee_phone": "1234567892"
}`
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:
Linked Plan Request
request
Text
1755962938878x653642511385623700
The ID of the plan request that you want to add this case part to.
Email Address
invitee_email
Text
The email of the case party that you want to add to this case.
Phone Number
invitee_phone
Text
1234567892
The phone number of the case party that you want to add to this case.
Returned Parameters Specification:
Status
status
Multiple-choice
Success
Whether the request was succesful.
Success, Failure
Linked Plan Request
request
Text
1755962937306x171818994560791740
The ID of the plan request associated with the call.
-
Request Parties
request_parties
Object List
-
A list of the current case parties associated with this case.
-
Phone
phone
Text
1234567890
The phone number of this case access party.
-
Party ID
party_id
Text
1755962937306x171818994560791740
The ID of this case access party.
-
Error Message
error_message
Text
We could not find a plan request with this ID or verify that your call contained a phone number/email. Try to double-check the email/phone and/or map an ID returned from another action/trigger.
If the call fails this parameter will provide details on the error.
-
Last updated
Was this helpful?