Get business hours
curl --request GET \
--url https://api.initdesk.com/organizations/{organization_id}/business-hours/ \
--header 'X-Initdesk-Token: <api-key>'import requests
url = "https://api.initdesk.com/organizations/{organization_id}/business-hours/"
headers = {"X-Initdesk-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Initdesk-Token': '<api-key>'}};
fetch('https://api.initdesk.com/organizations/{organization_id}/business-hours/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.initdesk.com/organizations/{organization_id}/business-hours/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Initdesk-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.initdesk.com/organizations/{organization_id}/business-hours/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Initdesk-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.initdesk.com/organizations/{organization_id}/business-hours/")
.header("X-Initdesk-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.initdesk.com/organizations/{organization_id}/business-hours/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Initdesk-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"timezone": null,
"weekly_hours": {},
"is_open_now": true,
"next_open": null,
"next_open_display": ""
}
]Get business hours
One schedule for the organization. timezone is an IANA name such as America/Sao_Paulo. weekly_hours is an object whose keys are mon, tue, wed, thu, fri, sat, and sun. Each value is null when that day is closed, or one range {"opens_at": "09:00", "closes_at": "18:00"}. Times are 24-hour HH:MM with no seconds (not HH:MM:SS). The opening minute is inside the range. A close earlier than the open continues overnight. Omitted weekdays are stored as closed. A list of ranges is rejected. Date exceptions are a separate list. No saved schedule means open 24/7 and weekly_hours is {}. is_open_now, next_open (ISO UTC), and next_open_display (organization working language) are read-only.
GET
/
organizations
/
{organization_id}
/
business-hours
/
Get business hours
curl --request GET \
--url https://api.initdesk.com/organizations/{organization_id}/business-hours/ \
--header 'X-Initdesk-Token: <api-key>'import requests
url = "https://api.initdesk.com/organizations/{organization_id}/business-hours/"
headers = {"X-Initdesk-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Initdesk-Token': '<api-key>'}};
fetch('https://api.initdesk.com/organizations/{organization_id}/business-hours/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.initdesk.com/organizations/{organization_id}/business-hours/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Initdesk-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.initdesk.com/organizations/{organization_id}/business-hours/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Initdesk-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.initdesk.com/organizations/{organization_id}/business-hours/")
.header("X-Initdesk-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.initdesk.com/organizations/{organization_id}/business-hours/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Initdesk-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"timezone": null,
"weekly_hours": {},
"is_open_now": true,
"next_open": null,
"next_open_display": ""
}
]Authorizations
Path Parameters
Response
200 - application/json
IANA time zone, for example America/Sao_Paulo. Required when saving. Null only when no schedule is saved.
Keys mon, tue, wed, thu, fri, sat, sun. null means closed. One range is {"opens_at": "09:00", "closes_at": "18:00"} (24-hour HH:MM, no seconds). Omit a key to store that day as closed.
Show child attributes
Show child attributes
Example:
{
"mon": { "opens_at": "09:00", "closes_at": "18:00" },
"tue": { "opens_at": "09:00", "closes_at": "18:00" },
"wed": { "opens_at": "09:00", "closes_at": "18:00" },
"thu": { "opens_at": "09:00", "closes_at": "18:00" },
"fri": { "opens_at": "09:00", "closes_at": "18:00" },
"sat": null,
"sun": null
}
True when the organization is open at the current time.
Start of the next opening after the current stretch, as ISO-8601 UTC. Null when there is no next opening.
next_open in the organization working language. Empty when there is no next opening.
Was this page helpful?

