Account Office Hours
CreateAccountOfficeHours
POST
https://api.opentact.org/rest/account/office_hours
Create new Account office hours entry
Headers
X-Auth-Token
string
JWT_TOKEN
Content-Type
string
application/json
Request Body
name
string
[ 1 .. 24 ] characters
Account Office hours - entry name
type
string
Enum: "nonworking"
"lunchtime"
"coffeebreak" "weekends"
dow
string
Enum: "sun"
"mon"
"tue"
"wed"
"thu"
"fri" "sat"
time_from
integer
<int32> [ 0 .. 235959 ]
time in seconds from 00:00:00
time_to
integer
<int32> [ 0 .. 235959 ]
time in seconds to 23:59:59
{
"success": true,
"payload": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"type": "nonworking",
"dow": "sun",
"time_from": 0,
"time_to": 0,
"account": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"email": "string",
"level": "ServiceAccount",
"balance": 0,
"class4_id": 0,
"deleted_on": "2019-08-24T14:15:22Z",
"time_zone": {},
"users": [],
"admin": {},
"messaging_profile_default": {},
"messaging_profiles": [],
"addresses": []
},
"created_by": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"email": "string",
"password": "string",
"phone_number": "string",
"first_name": "string",
"last_name": "string",
"avatar": "string",
"gender": "Agender",
"dob": "2019-08-24T14:15:22Z",
"role": "Admin",
"gmail_user_id": "string",
"facebook_user_id": "string",
"apple_user_id": "string",
"wechat_user_id": "string",
"deleted_on": "2019-08-24T14:15:22Z",
"token": "string",
"account": {}
},
"modified_by": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"email": "string",
"password": "string",
"phone_number": "string",
"first_name": "string",
"last_name": "string",
"avatar": "string",
"gender": "Agender",
"dob": "2019-08-24T14:15:22Z",
"role": "Admin",
"gmail_user_id": "string",
"facebook_user_id": "string",
"apple_user_id": "string",
"wechat_user_id": "string",
"deleted_on": "2019-08-24T14:15:22Z",
"token": "string",
"account": {}
}
}
}
{
"success": true,
"payload": {
"name": "string",
"type": "nonworking",
"dow": "sun",
"time_from": 0,
"time_to": 0,
"uuid": "0783760a-73a1-4659-8e2f-d9a54e438d8a",
"created_on": "2020-11-05T10:56:41.377Z",
"modified_on": "2020-11-05T10:56:41.377Z"
}
}
{
"success": false,
"message": "String",
"status": 401
}
Code Example
curl -X POST "https://api.opentact.org/rest/account/office_hours" /
-H "accept: application/json" -H "X-Auth-Token: JWT_TOKEN" /
-H "Content-Type: application/json" /
-d "{\"name\":\"string\",\"type\":\"nonworking\",\"dow\":\"sun\",\"time_from\":0,\"time_to\":0}"
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
'accept' => 'application/json',
'X-Auth-Token' => 'JWT_TOKEN',
'Content-Type' => 'application/json'
);
$data = '{"name":"string","type":"nonworking","dow":"sun","time_from":0,"time_to":0}';
$response = Requests::post('https://api.opentact.org/rest/account/office_hours', $headers, $data);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json',
}
data = '{"name":"string","type":"nonworking","dow":"sun","time_from":0,"time_to":0}'
response = requests.post('https://api.opentact.org/rest/account/office_hours', headers=headers, data=data)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/account/office_hours', {
method: 'POST',
headers: {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({"name":"string","type":"nonworking","dow":"sun","time_from":0,"time_to":0})
});
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{"name":"string","type":"nonworking","dow":"sun","time_from":0,"time_to":0}`)
req, err := http.NewRequest("POST", "https://api.opentact.org/rest/account/office_hours", data)
if err != nil {
log.Fatal(err)
}
req.Header.Set("accept", "application/json")
req.Header.Set("X-Auth-Token", "JWT_TOKEN")
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
GetAccountOfficeHoursList
GET
https://api.opentact.org/rest/account/office_hours
Get account office hours list
Headers
X-Auth-Token
string
JWT_TOKEN
Content-Type
string
application/json
Request Body
dow
string
Enum: "sun"
"mon"
"tue"
"wed"
"thu"
"fri" "sat"
{
"success": true,
"payload": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"type": "nonworking",
"dow": "sun",
"time_from": 0,
"time_to": 0,
"account": {},
"created_by": {},
"modified_by": {}
}
}
{
"success": false,
"message": "String",
"status": 400
}
Code Example
curl -X GET "https://api.opentact.org/rest/account/office_hours?dow=sun" -H "accept: application/json" -H "X-Auth-Token: JWT_TOKEN"
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
'accept' => 'application/json',
'X-Auth-Token' => 'JWT_TOKEN'
);
$response = Requests::get('https://api.opentact.org/rest/account/office_hours?dow=sun', $headers);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
}
params = (
('dow', 'sun'),
)
response = requests.get('https://api.opentact.org/rest/account/office_hours', headers=headers, params=params)
#NB. Original query string below. It seems impossible to parse and
#reproduce query strings 100% accurately so the one below is given
#in case the reproduced version is not "correct".
# response = requests.get('https://api.opentact.org/rest/account/office_hours?dow=sun', headers=headers)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/account/office_hours?dow=sun', {
headers: {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN'
}
});
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.opentact.org/rest/account/office_hours?dow=sun", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("accept", "application/json")
req.Header.Set("X-Auth-Token", "JWT_TOKEN")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
GetAccountOfficeHours
GET
https://api.opentact.org/rest/account/officehours/{uuid}
Get Account office hours extended info
Path Parameters
uuid
string
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Headers
X-Auth-Token
string
JWT_TOKEN
{
"success": true,
"payload": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"owner": {},
"users": []
}
}
{
"success": false,
"message": "string",
"status": 400
}
{
"success": false,
"message": "string",
"status": 404
}
Code Example
curl -X GET "https://api.opentact.org/rest/account/office_hours/{uuid}" -H "accept: application/json" -H "X-Auth-Token: JWT_TOKEN"
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
'accept' => 'application/json',
'X-Auth-Token' => 'JWT_TOKEN'
);
$response = Requests::get('https://api.opentact.org/rest/account/office_hours/{uuid}', $headers);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
}
response = requests.get('https://api.opentact.org/rest/account/office_hours/%7Buuid%7D', headers=headers)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/account/office_hours/{uuid}', {
headers: {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN'
}
});
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.opentact.org/rest/account/office_hours/{uuid}", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("accept", "application/json")
req.Header.Set("X-Auth-Token", "JWT_TOKEN")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
UpdateAccountOfficeHours
PATCH
https://api.opentact.org/rest/account/office_hours/{uuid}
Update Account Office hours
Headers
Content-Type
string
application/json
X-Auth-Token
string
JWT_TOKEN
Request Body
name
string
[ 1 .. 24 ] characters
Account Office hours - entry name
type
string
Enum: "nonworking"
"lunchtime"
"coffeebreak" "weekends"
dow
string
Enum: "sun"
"mon"
"tue"
"wed"
"thu"
"fri" "sat"
time_from
integer
<int32> [ 0 .. 235959 ]
time in seconds from 00:00:00
time_to
integer
<int32> [ 0 .. 235959 ]
time in seconds to 23:59:59
{
"success": true,
"payload": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"type": "nonworking",
"dow": "sun",
"time_from": 0,
"time_to": 0,
"account": {},
"created_by": {},
"modified_by": {}
}
}
{
"success": false,
"status": 401,
"message": "String"
}
{
"success": false,
"status": 404,
"message": "String"
}
Code Example
curl -X PATCH "https://api.opentact.org/rest/account/office_hours/{uuid}" -H "accept: application/json" -H "X-Auth-Token: JWT_TOKEN" -H "Content-Type: application/json" -d "{\"name\":\"string\",\"type\":\"nonworking\",\"dow\":\"sun\",\"time_from\":0,\"time_to\":0}"
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
'accept' => 'application/json',
'X-Auth-Token' => 'JWT_TOKEN',
'Content-Type' => 'application/json'
);
$data = '{"name":"string","type":"nonworking","dow":"sun","time_from":0,"time_to":0}';
$response = Requests::patch('https://api.opentact.org/rest/account/office_hours/{uuid}', $headers, $data);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json',
}
data = '{"name":"string","type":"nonworking","dow":"sun","time_from":0,"time_to":0}'
response = requests.patch('https://api.opentact.org/rest/account/office_hours/%7Buuid%7D', headers=headers, data=data)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/account/office_hours/{uuid}', {
method: 'PATCH',
headers: {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({"name":"string","type":"nonworking","dow":"sun","time_from":0,"time_to":0})
});
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{"name":"string","type":"nonworking","dow":"sun","time_from":0,"time_to":0}`)
req, err := http.NewRequest("PATCH", "https://api.opentact.org/rest/account/office_hours/{uuid}", data)
if err != nil {
log.Fatal(err)
}
req.Header.Set("accept", "application/json")
req.Header.Set("X-Auth-Token", "JWT_TOKEN")
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
RemoveAccountOfficeHoursByUUID
DELETE
https://api.opentact.org/rest/account/office_hours/{uuid}
Delete account office hours
Path Parameters
uuid
string
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Headers
Content-Type
string
application/json
X-Auth-Token
string
JWT_TOKEN
{
"success": true,
"payload": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"type": "nonworking",
"dow": "sun",
"time_from": 0,
"time_to": 0,
"account": {},
"created_by": {},
"modified_by": {}
}
}
{
"success": false,
"status": 401,
"message": "String"
}
{
"success": false,
"status": 404,
"message": "String"
}
Code Example
curl -X DELETE "https://api.opentact.org/rest/account/office_hours/{uuid}" -H "accept: application/json" -H "X-Auth-Token: JWT_TOKEN" -H "Content-Type: application/json" -d "{\"name\":\"string\",\"type\":\"nonworking\",\"dow\":\"sun\",\"time_from\":0,\"time_to\":0}"
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
'accept' => 'application/json',
'X-Auth-Token' => 'JWT_TOKEN',
'Content-Type' => 'application/json'
);
$data = '{"name":"string","type":"nonworking","dow":"sun","time_from":0,"time_to":0}';
$response = Requests::delete('https://api.opentact.org/rest/account/office_hours/{uuid}', $headers, $data);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json',
}
data = '{"name":"string","type":"nonworking","dow":"sun","time_from":0,"time_to":0}'
response = requests.delete('https://api.opentact.org/rest/account/office_hours/%7Buuid%7D', headers=headers, data=data)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/account/office_hours/{uuid}', {
method: 'DELETE',
headers: {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({"name":"string","type":"nonworking","dow":"sun","time_from":0,"time_to":0})
});
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{"name":"string","type":"nonworking","dow":"sun","time_from":0,"time_to":0}`)
req, err := http.NewRequest("DELETE", "https://api.opentact.org/rest/account/office_hours/{uuid}", data)
if err != nil {
log.Fatal(err)
}
req.Header.Set("accept", "application/json")
req.Header.Set("X-Auth-Token", "JWT_TOKEN")
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
Last updated
Was this helpful?