This API provides access to public holiday data, including region-specific holidays. It supports retrieving holiday lists and checking if a specific date is a holiday in a given region. More countries and regions will be added in the future.
The app service finds and connects to the right Service API:
class IService* service = NULL;
class AppSession* session = NULL;
for (auto pbxsession : app->pbxSessions) { //Look for the right app service
if (pbxsession->services) {
service = pbxsession->services->GetService("com.innovaphone.publicholidays");
session = pbxsession;
if (service) break;
}
}
//If found then connect the appwebsocket client
if (service) this->awsClient->Connect(service->GetWebsocketUrl(), service->GetName(), session->services->CreateAuthenticator(), false);
else this->awsClient->Close();
Callback when the appwebsocket client has been connected, so you can start sending messages.
void App::AppWebsocketClientConnectComplete(class IAppWebsocketClient* appWebsocketClient)
{
char sb[200];
class json_io send(sb);
word base = send.add_object(JSON_ID_ROOT, 0);
send.add_string(base, "mt", "GetCountries");
send.add_string(base, "api", "innovaphone-publicholidays-serviceapi");
this->awsClient->MessageSend(send, sb);
this->awsClient->MessageComplete();
}
Function where the answers from the Working Client API are received.
void App::AppWebsocketClientMessage(class IAppWebsocketClient* appWebsocketClient, class json_io& msg, word base, const char* mt, const char* src)
{
if (!strcmp(mt, "GetCountriesResult")) { //Manage the answers from the Publicholidays API
...
}
...
}
Gets all supported Countries of PublicHolidays
string api | "innovaphone-publicholidays-serviceapi" |
Answer to the start of the working time of an user.
string result | ["DE","AT","CH"] |
Gets all supported Countries of PublicHolidays
string country | "DE" |
string api | "innovaphone-publicholidays-serviceapi" |
Gets all supported Countries of PublicHolidays
string result | ["BW","BY","BE","BB","HB","HH","HE","MV","NI","NW","RP","SL","SN","ST","SH","TH"] |
Retrieves all public holidays for a given year, country and, optionally, a specific state. If no state is specified, only nationwide holidays (valid in all states) are returned.
You will get an array with an object for each day:
string year | "2025" |
string country | "DE" |
string state | "BW" |
string api | "innovaphone-publicholidays-serviceapi" |
Retrieves all public holidays
string result | [{"date": "2025-01-01","international": "New Year's Day","name": "Neujahr"},{...}] |
Allows you to check whether a given date is a public holiday in a specified country, optionally, a specific state.
The date has to be in the format YY-MM-DD.
You will get an object as result:
string date | "2025-12-25" |
string country | "DE" |
string state | "BW" |
string api | "innovaphone-publicholidays-serviceapi" |
Allows you to check whether a given date is a public holiday
string result | [{"date":"2025-12-25","name":"1. Weihnachtstag","international":"Christmas Day","isholiday":true}] |