Online bookings/appointments/calendars in C# using the SuperSaaS scheduling platform - https://supersaas.com
The SuperSaaS API provides services that can be used to add online booking and scheduling functionality to an existing website or CRM software.
- Register for a (free) SuperSaaS account, and
- get your account name and generate an API key on the Account Info page.
.NET Framework 3.5 or greater, with NuGet.
Json.NET.
From within Visual Studio you can use the NuGet GUI to search for and install the SuperSaaS SDK NuGet package. Alternatively, type the following command into the Package Manager Console:
Install-Package SuperSaaS.API.Client
Initialize the SuperSaaS Client
with authorization credentials:
using SuperSaaS.API.Client;
Client client = new Client("accnt", "pwd", "usr");
client.AccountName; //=> 'accnt'
client.ApiKey; //=> 'xxxxxxxxxxxxxxxxxxxxxx'
If the client isn't configured explicitly, it will use default ENV
variables for the account name and API key.
Set these ENV
variables before calling the client.
ENV['SSS_API_ACCOUNT_NAME'] = 'accnt'
ENV['SSS_API_KEY'] = 'xxxxxxxxxxxxxxxxxxxxxx'
using SuperSaaS.API.Client;
Client client = new Client()
client.AccountName; //=> 'accnt'
client.ApiKey; //=> 'xxxxxxxxxxxxxxxxxxxxxx'
Details of the data structures, parameters, and values can be found on the developer documentation site:
https://www.supersaas.com/info/dev
Get all account schedules:
client.Schedules.List #=> SuperSaaS.CSharp.Models.Schedule[]
Get all services/resources by schedule_id
:
client.Schedules.Resources(12345) #=> SuperSaaS.CSharp.Models.Resource[]
Note: does not work for capacity type schedules.
Create a user with user attributes params:
client.Users.Create(
new Dictionary<string, string>
{
{ "full_name", "Example Name" },
{ "email", "example@example.com" }
}
); //=> SuperSaaS.CSharp.Models.User
Update a user by user_id
with user attributes params:
client.Users.Update(12345,
new Dictionary<string, string>
{
{ "full_name", "New Name" }
}
); //=> SuperSaaS.CSharp.Models.User
Delete a single user by user_id
:
client.Users.Delete(12345);
Get a single user by user_id
:
client.Users.Get(12345); //=> SuperSaaS.CSharp.Models.User
Get all users with optional form
and limit
/offset
pagination params:
client.Users.List(true, 10, 15); //=> SuperSaaS.CSharp.Models.User[]
Create an appointment by schedule_id
and user_id
with appointment attributes and form
and webhook
params:
client.Appointments.Create(12345, 67890,
new Dictionary<string, string>
{
{ "full_name", "New Name" },
{ "email", "example@example.com" }
{ "slot_id", "12345" }
}, true, true
); //=> SuperSaaS.CSharp.Models.Appointment
Update an appointment by schedule_id
and appointment_id
with appointment attributes params:
client.Appointments.Update(1234, 9876,
new Dictionary<string, string>
{
{ "full_name", "New Name" },
{ "email", "example@example.com" }
{ "slot_id", "12345" }
}
); //=> SuperSaaS.CSharp.Models.Appointment
Delete a single appointment by schedule_id
and appointment_id
:
client.Appointments.Delete(12345, 67890);
Get a single appointment by schedule_id
and appointment_id
:
client.Appointments.Get(12345, 67890); //=> SuperSaaS.CSharp.Models.Appointment
Get agenda (upcoming) appointments by schedule_id
and user_id
, with form
and slot
view params:
client.Appointments.List(12345, 67890, true, true); //=> SuperSaaS.CSharp.Models.Appointment[]
Get agenda (upcoming) appointments by schedule_id
and user_id
, with form
view params:
client.Appointments.Agenda(12345, 67890, true); //=> SuperSaaS.CSharp.Models.Appointment[]
Get agenda slots for a capacity schedule by schedule_id
and user_id
, with form
view param:
client.Appointments.AgendaSlots(12345, 67890, true); //=> SuperSaaS.CSharp.Models.Slot[]
Get available appointments by schedule_id
, with from
time and length_minutes
and resource
params:
client.Appointments.Available(12345, DateTime.Now, 15, 'My Class'); //=> SuperSaaS.CSharp.Models.Appointment[]
Get recently changed appointments by schedule_id
, with from
time:
client.Appointments.Changes(12345, DateTime.Now.AddDays(-7), true); //=> SuperSaaS.CSharp.Models.Appointment[]
Get recently changed slots for a capacity schedule by schedule_id
, with from
time:
client.Appointments.ChangesSlots(12345, DateTime.Now.AddDays(-7), true); //=> SuperSaaS.CSharp.Models.Slot[]
Get all forms by template superform_id
, with from
time param:
client.Forms.List(12345, DateTime.Now.AddDays(-7)); //=> SuperSaaS.CSharp.Models.Form[]
Get a single form by form_id
:
client.Forms.Get(12345); //=> SuperSaaS.CSharp.Models.Form
The Examples project contains a configurable app demonstrating how to use the API Client for common requests.
The examples will require your account name, api key, and some of the examples will require a schedule id and/or user id and/or form id.
IMPORTANT: some of the example API requests are destructive or may incur a cost, such as deleting or adding appointments, respectively.
The HTTP requests can be stubbed by setting the client's Test
property, e.g.
using SuperSaaS.API.Client;
Client client = new Client();
client.Test = true;
Or by constructing the client with the test
param, e.g.
Client client = new Client("accnt", "pwd", null, null, true);
Note, stubbed requests always return null
.
The Client
also provides a LastRequest
attribute containing the HttpWebRequest
object from the last performed request, e.g.
client.LastRequest; //=> System.Net.HttpWebRequest
The headers, body, path, etc. of the last request can be inspected for assertion in tests, or for troubleshooting failed API requests.
- SuperSaaS Registration
- Product Documentation
- Developer Documentation
- Python API Client
- PHP API Client
- NodeJS API Client
- Ruby API Client
- Objective-C API Client
- Go API Client
Contact: support@supersaas.com
The package follows semantic versioning, i.e. MAJOR.MINOR.PATCH
The SuperSaaS C# API Client is available under the MIT license. See the LICENSE file for more info.