Introduction

The Orca API exposes ORCA's resources like inbox entries, calendar entries, and patients. These resources can be accessed and manipulated using the HTTP methods GET, POST, PUT and DELETE.

All Orca API's resources are accessed and manipulated in a similar way.

Method Uri Action
GET /patients List all patients
POST /patients Stores a patient in the ORCA's database
GET /patients/[id] Gets the patient with the specified id
PUT/PATCH /patients/[id] Updates the patient with the specified id
DELETE /patients/[id] Soft Deletes the patient with the specified id

Unless otherwise specified, the base URL for API endpoints is:

https://orcaapi.orcasandbox.com/api

using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/patients");
var TOKEN = "xxxxxxxxxxxxxxxxx";
//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.GetAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                        
var request = require("request");

var options = {
    method: 'GET',
    url: 'https://orcaapi.orcasandbox.com/api/patients',
    headers: {
        Connection: 'keep-alive',
        Host: 'orcaapi.orcasandbox.com',
        Authorization: 'Bearer ' + TOKEN,
        Accept: 'application/json'
    }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
                        
setUrl('https://orcaapi.orcasandbox.com/api/patients');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
    'Host' => 'orcaapi.orcasandbox.com',
    'Authorization' => 'Bearer ' . TOKEN,
    'Accept' => 'application/json'
]);

try {
    $response = $request->send();

    echo $response->getBody();
} catch (HttpException $ex) {
    echo $ex;
}
                        
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
    .url("https://orcaapi.orcasandbox.com/api/patients")
    .get()
    .addHeader("Accept", "application/json")
    .addHeader("Authorization", "Bearer " + TOKEN)
    .addHeader("Host", "orcaapi.orcasandbox.com")
    .addHeader("Connection", "keep-alive")
    .build();

Response response = client.newCall(request).execute();
                    

Authentication

/connect

Full URL: https://orcaapi.orcasandbox.com/api/connect

The OAuth2 authorization endpoint. Your app redirects a user to this endpoint, allowing them to delegate access to their account.

Parameter Type Description
client_id String The client id belonging to your application
redirect_uri String The redirect uri you have configured for your application
scope String '*'
using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/connect");
var TOKEN = "xxxxxxxxxxxxxxxxx";
//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.GetAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                    
var request = require("request");

var options = {
    method: 'GET',
    url: 'https://orcaapi.orcasandbox.com/api/connect',
    headers: {
        'cache-control': 'no-cache'
    }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
});
                
setUrl('https://orcaapi.orcasandbox.com/api/connect');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
    'cache-control' => 'no-cache'
));

try {
    $response = $request->send();

    echo $response->getBody();
} catch (HttpException $ex) {
    echo $ex;
}
                
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
    .url("https://orcaapi.orcasandbox.com/api/connect")
    .get()
    .addHeader("cache-control", "no-cache")
    .build();

Response response = client.newCall(request).execute();
                    

Inbox

The inbox resource contains inbox items that will be entered into tje Orca Inbox. It contains the following properties:

Property Type Notes
title string
message string
assigned_to [int]
inbox_item_status string 'received', 'pending' or 'completed'
archived boolean
using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/inbox");
var TOKEN = "xxxxxxxxxxxxxxxxx";
//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.GetAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                        
<?php
    $authorize_url = "https://orcaapi.orcasandbox.com/authorize";
    $token_url = "https://orcaapi.orcasandbox.com/token";
    $callback_uri = "YOUR_REDIRECT_URL";
    $test_api_url = "YOUR_API_ENDPOINT";
    $client_id = "CLIENT_ID";
    $client_secret = "CLIENT_SECRET";


    if ($_POST["authorization_code"]) {
        //	what to do if there's an authorization code
        $access_token = getAccessToken($_POST["authorization_code"]);
        $resource = getResource($access_token);
        echo $resource;
    } elseif ($_GET["code"]) {
        $access_token = getAccessToken($_GET["code"]);
        $resource = getResource($access_token);
        echo $resource;
    } else {
        //	what to do if there's no authorization code
        getAuthorizationCode();
    }

                

GET /inbox

Returns a paginated array of inbox items belonging to the client of the token's scope. By default the items are arranged on descending order on which they were created

Parameter Type Description
page int How many results per page
per_page int Which page to be returned

The response is an array with the properties:

Property Type Description
total int HTotal patients
per_page int Total results per page
current_page int Current page
last_page int Last page
from int From Patient index
to int To patient index
data [inbox_item] Array of inbox items
using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/inbox");
var TOKEN = "xxxxxxxxxxxxxxxxx";
//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.GetAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
{
  "data":{
    "first_name":"John",
    "last_name":"Smith",
    "address_line_1":"123 Spooner St",
    "address_line_2":null,
    "city":"Quahog",
    "state":"Michigan",
    "zip":"12345",
    "email_personal":"[email protected]",
    "email_other":"[email protected]",
    "phone_number_home":"2221112211",
    "phone_number_work":"2223333344",
    "social_network_fb":"\/john.smith",
    "social_network_twitter":"@john.smith",
    "avatar":"https://example.com/john/avatar.jpg",
    "language":"EN"
  }
}
                

POST /inbox

Creates an inbox item in the ORCA database, assigns it to the company tied to the token's scope and returns that patient.

Property Type Notes
title string Required
message string Required
using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/inbox/{id}");
var TOKEN = "xxxxxxxxxxxxxxxxx";
var content = new FormUrlEncodedContent(new[]
    {
         new KeyValuePair("title", "test title")
         new KeyValuePair("message", "test message")
     });
//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.PostAsync(requestUri,content);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
{
    "data":{
        "first_name":"John",
        "last_name":"Smith",
        "address_line_1":"123 Spooner St",
        "address_line_2":null,
        "city":"Quahog",
        "state":"Michigan",
        "zip":"12345",
        "email_personal":"[email protected]",
        "email_other":"[email protected]",
        "phone_number_home":"2221112211",
        "phone_number_work":"2223333344",
        "social_network_fb":"\/john.smith",
        "social_network_twitter":"@john.smith",
        "avatar":"https://example.com/john/avatar.jpg",
        "language":"EN"
    }
}
                

GET /inbox/[ID]

Returns the specified inbox item resource by ID given

using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/inbox/{id}");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.GetAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
{
    "data":{
        "first_name":"John22",
        "last_name":"Smith",
        "address_line_1":"123 Spooner St",
        "address_line_2":null,
        "city":"Quahog",
        "state":"Michigan",
        "zip":"12345",
        "email_personal":"[email protected]",
        "email_other":"[email protected]",
        "phone_number_home":"2221112211",
        "phone_number_work":"2223333344",
        "social_network_fb":"\/john.smith",
        "social_network_twitter":"@john.smith",
        "avatar":"https://example.com/john/avatar.jpg",
        "language":"EN"
    }
}
                

PUT/PATCH /inbox/[ID]

Updates inbox item resource by ID given. Fields passed will be updated.

Property Type Notes
title string
message string
assigned_to [int]
inbox_item_status string Must be either: 'received', 'pending' or 'completed'
archived boolean
using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/inbox/{id}");
var TOKEN = "xxxxxxxxxxxxxxxxx";
//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.PutAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
{
    "data":{
        "first_name":"John11",
        "last_name":"Smith",
        "address_line_1":"123 Spooner St",
        "address_line_2":null,
        "city":"Quahog",
        "state":"Michigan",
        "zip":"12345",
        "email_personal":"[email protected]",
        "email_other":"[email protected]",
        "phone_number_home":"2221112211",
        "phone_number_work":"2223333344",
        "social_network_fb":"\/john.smith",
        "social_network_twitter":"@john.smith",
        "avatar":"https://example.com/john/avatar.jpg",
        "language":"EN"
    }
}
                

DELETE /inbox/[ID]

Soft deleted patient resource by ID given.

using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/inbox/{id}");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.DeleteAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
{
"data":{
    "first_name":"John",
    "last_name":"Smith",
    "address_line_1":"123 Spooner St",
    "address_line_2":null,
    "city":"Quahog",
    "state":"Michigan",
    "zip":"12345",
    "email_personal":"[email protected]",
    "email_other":"[email protected]",
    "phone_number_home":"2221112211",
    "phone_number_work":"2223333344",
    "social_network_fb":"\/john.smith",
    "social_network_twitter":"@john.smith",
    "avatar":"https://example.com/john/avatar.jpg",
    "language":"EN"
}
}
                

Calendar

The calendar resource contains calendar items that will be entered into the Orca calendar. It contains the following properties:

Property Type Description
event_start DateTime Date time when the event starts
event_length int How many days does the event last
title string Title of the calendar entry
description string Description of the calendar entry
using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/calendar");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.GetAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
<?php
    $authorize_url = "https://orcaapi.orcasandbox.com/authorize";
    $token_url = "https://orcaapi.orcasandbox.com/token";

    $callback_uri = "YOUR_REDIRECT_URL";
    $test_api_url = "YOUR_API_ENDPOINT";
    $client_id = "CLIENT_ID";
    $client_secret = "CLIENT_SECRET";

    if ($_POST["authorization_code"]) {
        //	what to do if there's an authorization code
        $access_token = getAccessToken($_POST["authorization_code"]);
        $resource = getResource($access_token);
        echo $resource;
    } elseif ($_GET["code"]) {
        $access_token = getAccessToken($_GET["code"]);
        $resource = getResource($access_token);
        echo $resource;
    } else {
        //	what to do if there's no authorization code
        getAuthorizationCode();
    }

                

GET /calendar

Returns an array of calendar items belonging to the client of the token's scope at the time given.

Parameter Type Description
timeframe string ['month','week']
calendar_datetime DateTime DateTime when to get the calendar item array

The response is an array with the properties:

Property Type Description
from DateTime From calendar datetime
to DateTime To calendar datetime
data [calendar_item] Array of calendar items
using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/calendar/{id}");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.GetAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
{
    "data":{
        "first_name":"John",
        "last_name":"Smith",
        "address_line_1":"123 Spooner St",
        "address_line_2":null,
        "city":"Quahog",
        "state":"Michigan",
        "zip":"12345",
        "email_personal":"[email protected]",
        "email_other":"[email protected]",
        "phone_number_home":"2221112211",
        "phone_number_work":"2223333344",
        "social_network_fb":"\/john.smith",
        "social_network_twitter":"@john.smith",
        "avatar":"https://example.com/john/avatar.jpg",
        "language":"EN"
    }
}
                

POST /calendar

Creates a calendar entry iin the ORCA database, assigns it to the company tied to the token’s scope and returns that entry.

Property Type Notes
event_start DateTime Required
event_length int Required
title string Required
description string
using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/calendar");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.PostAsync(requestUri,content);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
{
    "data":{
        "first_name":"John",
        "last_name":"Smith",
        "address_line_1":"123 Spooner St",
        "address_line_2":null,
        "city":"Quahog",
        "state":"Michigan",
        "zip":"12345",
        "email_personal":"[email protected]",
        "email_other":"[email protected]",
        "phone_number_home":"2221112211",
        "phone_number_work":"2223333344",
        "social_network_fb":"\/john.smith",
        "social_network_twitter":"@john.smith",
        "avatar":"https://example.com/john/avatar.jpg",
        "language":"EN"
    }
}
                

GET /calendar/[ID]

Returns the specified calendar item resource by ID given

using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/calendar/{id}");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.GetAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
{
    "data":{
        "first_name":"John",
        "last_name":"Smith",
        "address_line_1":"123 Spooner St",
        "address_line_2":null,
        "city":"Quahog",
        "state":"Michigan",
        "zip":"12345",
        "email_personal":"[email protected]",
        "email_other":"[email protected]",
        "phone_number_home":"2221112211",
        "phone_number_work":"2223333344",
        "social_network_fb":"\/john.smith",
        "social_network_twitter":"@john.smith",
        "avatar":"https://example.com/john/avatar.jpg",
        "language":"EN"
    }
}
                

PUT/PATCH /calendar/[ID]

Updates calendar item resource by ID given. Fields passed will be updated.

Property Type Notes
event_start DateTime
event_length int
title string
description string
using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/calendar/{id}");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.PutAsync(requestUri,content);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
{
    "data":{
        "first_name":"John",
        "last_name":"Smith",
        "address_line_1":"123 Spooner St",
        "address_line_2":null,
        "city":"Quahog",
        "state":"Michigan",
        "zip":"12345",
        "email_personal":"[email protected]",
        "email_other":"[email protected]",
        "phone_number_home":"2221112211",
        "phone_number_work":"2223333344",
        "social_network_fb":"\/john.smith",
        "social_network_twitter":"@john.smith",
        "avatar":"https://example.com/john/avatar.jpg",
        "language":"EN"
    }
}
                

DELETE /calendar/[ID]

Soft deletes calendar item resource by ID given.

using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/calendar/{id}");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await ClientDeleteAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
{
    "data":{
        "first_name":"John",
        "last_name":"Smith",
        "address_line_1":"123 Spooner St",
        "address_line_2":null,
        "city":"Quahog",
        "state":"Michigan",
        "zip":"12345",
        "email_personal":"[email protected]",
        "email_other":"[email protected]",
        "phone_number_home":"2221112211",
        "phone_number_work":"2223333344",
        "social_network_fb":"\/john.smith",
        "social_network_twitter":"@john.smith",
        "avatar":"https://example.com/john/avatar.jpg",
        "language":"EN"
    }
}
                

Patients

The patient resource contains information about individual patients for the ORCA user. It contains the following properties:

Property Type Description
first_name String Patient's first name
last_name String Patient's last name
address_line_1 String Patient's address
address_line_2 String Patient's address
city String Patient's address
state String Patient's address
zip String Patient's address
email_personal String Patient's personal email
email_other String Patient's alternative email
phone_number_home String Patient's home phone number
phone_number_work String Patient's work phone number
social_network_fb String Patient's facebook
social_network_twitter String Patient's twitter
avatar String Patient's avatar image
language String Patient's language spoken
    {
        "data":{
            "first_name":"John",
            "last_name":"Smith",
            "address_line_1":"123 Spooner St",
            "address_line_2":null,
            "city":"Quahog",
            "state":"Michigan",
            "zip":"12345",
            "email_personal":"[email protected]",
            "email_other":"[email protected]",
            "phone_number_home":"2221112211",
            "phone_number_work":"2223333344",
            "social_network_fb":"\/john.smith",
            "social_network_twitter":"@john.smith",
            "avatar":"https://example.com/john/avatar.jpg",
            "language":"EN"
        }
    }
                

GET /patients

Returns a paginated array of patients belonging to the client of the token's scope.

Parameter Type Description
page int How many results per page
per_page int Which page to be returned

The response is an array with the properties:

Property Type Description
total int Total patients
per_page int Total results per page
current_page int Current page
last_page int Last page
from int From Patient index
to int To patient index
data [patient] Array of patients
using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/patients");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.GetAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
    var request = require("request");

    var options = {
        method: 'GET',
        url: 'https://orcaapi.orcasandbox.com/api/patients',
        headers: {
            Connection: 'keep-alive',
            Host: 'orcaapi.orcasandbox.com',
            Authorization: 'Bearer ' + TOKEN,
            Accept: 'application/json'
        }
    };

    request(options, function (error, response, body) {
        if (error) throw new Error(error);

        console.log(body);
    });
                
    setUrl('https://orcaapi.orcasandbox.com/api/patients');
    $request->setMethod(HTTP_METH_GET);

    $request->setHeaders([
        'Host' => 'orcaapi.orcasandbox.com',
        'Authorization' => 'Bearer ' . TOKEN,
        'Accept' => 'application/json'
    ]);

    try {
        $response = $request->send();

        echo $response->getBody();
    } catch (HttpException $ex) {
        echo $ex;
    }
                
    OkHttpClient client = new OkHttpClient();

    Request request = new Request.Builder()
    .url("https://orcaapi.orcasandbox.com/api/patients")
    .get()
    .addHeader("Accept", "application/json")
    .addHeader("Authorization", "Bearer " + TOKEN)
    .addHeader("Host", "orcaapi.orcasandbox.com")
    .addHeader("Connection", "keep-alive")
    .build();

    Response response = client.newCall(request).execute();
                

POST /patients

Creates a patient in the ORCA database, assigns it to the company tied to the token’s scope and returns that patient.

Parameter Type Description
first_name String Required
last_name String Required
address_line_1 String
address_line_2 String
city String
state String
zip String
email_personal String
email_other String
phone_number_home String
phone_number_work String
social_network_fb String
social_network_twitter String
avatar String
language String ISO 639-1
using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/patients");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.PostAsync(requestUri,content);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
    var request = require("request");

    var options = {
        method: 'POST',
        url: 'https://orcaapi.orcasandbox.com/api/patients',
        qs: {
            first_name: 'Samantha',
            last_name: 'Smith',
            address_line_1: '123%20Spooner%20St',
            address_line_2: '',
            city: 'Quahog',
            state: 'Massachusets',
            zip: '22111',
            email_personal: '[email protected]',
            email_other: '[email protected]',
            phone_number_home: '2211112222',
            phone_number_work: '2233322222',
            social_network_fb: '/john.smith',
            social_network_twitter: '@john.smith',
            avatar: 'https://example.com/users/john.jpg',
            language: 'EN'
        },
        headers: {
            Connection: 'keep-alive',
            Host: 'orcaapi.orcasandbox.com',
            Authorization: 'Bearer ' + TOKEN,
            'Content-Type': 'application/x-www-form-urlencoded',
            Accept: 'application/json'
        }
    };

    request(options, function (error, response, body) {
        if (error) throw new Error(error);

        console.log(body);
    });
                
setUrl('https://orcaapi.orcasandbox.com/api/patients');
    $request->setMethod(HTTP_METH_POST);

    $request->setQueryData([
        'first_name' => 'Samantha',
        'last_name' => 'Smith',
        'address_line_1' => '123%20Spooner%20St',
        'address_line_2' => '',
        'city' => 'Quahog',
        'state' => 'Massachusets',
        'zip' => '22111',
        'email_personal' => '[email protected]',
        'email_other' => '[email protected]',
        'phone_number_home' => '2211112222',
        'phone_number_work' => '2233322222',
        'social_network_fb' => '/john.smith',
        'social_network_twitter' => '@john.smith',
        'avatar' => 'https://example.com/users/john.jpg',
        'language' => 'EN'
    ]);

    $request->setHeaders([
        'Host' => 'orcaapi.orcasandbox.com',
        'Authorization' => 'Bearer ' + TOKEN,
        'Content-Type' => 'application/x-www-form-urlencoded',
        'Accept' => 'application/json'
    ]);

    try {
        $response = $request->send();

        echo $response->getBody();
    } catch (HttpException $ex) {
        echo $ex;
    }
                
    OkHttpClient client = new OkHttpClient();

    Request request = new Request.Builder()
    .url("https://orcaapi.orcasandbox.com/api/patients?first_name=Samantha&last_name=Smith&address_line_1=123%20Spooner%20St&address_line_2=&c[email protected][email protected]&phone_number_home=2211112222&phone_number_work=2233322222&social_network_fb=/[email protected]&avatar=https://example.com/users/john.jpg&language=EN")
    .post(null)
    .addHeader("Accept", "application/json")
    .addHeader("Content-Type", "application/x-www-form-urlencoded")
    .addHeader("Authorization", "Bearer " + TOKEN)
    .addHeader("Host", "orcaapi.orcasandbox.com")
    .build();

    Response response = client.newCall(request).execute();
                
    {
        "data":{
            "first_name":"John",
            "last_name":"Smith",
            "address_line_1":"123 Spooner St",
            "address_line_2":null,
            "city":"Quahog",
            "state":"Michigan",
            "zip":"12345",
            "email_personal":"[email protected]",
            "email_other":"[email protected]",
            "phone_number_home":"2221112211",
            "phone_number_work":"2223333344",
            "social_network_fb":"\/john.smith",
            "social_network_twitter":"@john.smith",
            "avatar":"https://example.com/john/avatar.jpg",
            "language":"EN"
        }
    }
                

GET /patients/[ID]

Returns the specified patient resource by ID given

using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/patients{id}");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.GetAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
    {
        "data":{
            "first_name":"John",
            "last_name":"Smith",
            "address_line_1":"123 Spooner St",
            "address_line_2":null,
            "city":"Quahog",
            "state":"Michigan",
            "zip":"12345",
            "email_personal":"[email protected]",
            "email_other":"[email protected]",
            "phone_number_home":"2221112211",
            "phone_number_work":"2223333344",
            "social_network_fb":"\/john.smith",
            "social_network_twitter":"@john.smith",
            "avatar":"https://example.com/john/avatar.jpg",
            "language":"EN"
        }
    }
                

PUT/PATCH /patients/[ID]

Updates patient resource by ID given. Fields passed will be updated.

Parameter Type Description
first_name String Required
last_name String Required
address_line_1 String
address_line_2 String
city String
state String
zip String
email_personal String
email_other String
phone_number_home String
phone_number_work String
social_network_fb String
social_network_twitter String
avatar String
language String ISO 639-1
using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/patients{id}");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.PutAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
    {
        "data":{
            "first_name":"John",
            "last_name":"Smith",
            "address_line_1":"123 Spooner St",
            "address_line_2":null,
            "city":"Quahog",
            "state":"Michigan",
            "zip":"12345",
            "email_personal":"[email protected]",
            "email_other":"[email protected]",
            "phone_number_home":"2221112211",
            "phone_number_work":"2223333344",
            "social_network_fb":"\/john.smith",
            "social_network_twitter":"@john.smith",
            "avatar":"https://example.com/john/avatar.jpg",
            "language":"EN"
        }
    }
                        

DELETE /patients/[ID]

Soft deleted patient resource by ID given.

using System.Net.Http;
using System.Net.Http.Headers;

var Client = new HttpClient();
Uri requestUri = new Uri("https://orcaapi.orcasandbox.com/api/patients{id}");
var TOKEN = "xxxxxxxxxxxxxxxxx";

//Add Headers
client.DefaultRequestHeaders.Add("Authorization","Bearer" + TOKEN);
client.DefaultRequestHeaders.Add("Accept","application/json");
try
{
    //Send the GET request
    httpResponse = await Client.DeletetAsync(requestUri);
    httpResponse.EnsureSuccessStatusCode();
    httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
    httpResponseBody = "Error: " + ex.HResult.ToString("X") + " Message: " + ex.Message;
}
                
    {
        "data":{
            "first_name":"John",
            "last_name":"Smith",
            "address_line_1":"123 Spooner St",
            "address_line_2":null,
            "city":"Quahog",
            "state":"Michigan",
            "zip":"12345",
            "email_personal":"[email protected]",
            "email_other":"[email protected]",
            "phone_number_home":"2221112211",
            "phone_number_work":"2223333344",
            "social_network_fb":"\/john.smith",
            "social_network_twitter":"@john.smith",
            "avatar":"https://example.com/john/avatar.jpg",
            "language":"EN"
        }
    }