> For the complete documentation index, see [llms.txt](https://dantonia.gitbook.io/test/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dantonia.gitbook.io/test/account/untitled-1.md).

# Account Office Hours

## CreateAccountOfficeHours

<mark style="color:green;">`POST`</mark> `https://api.opentact.org/rest/account/office_hours`

Create new Account office hours entry

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| X-Auth-Token | string | JWT\_TOKEN       |
| Content-Type | string | application/json |

#### Request Body

| Name       | Type    | Description                                                                                                                              |
| ---------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| name       | string  | <p><code>\[ 1 .. 24 ] characters</code><br>Account Office hours - entry name</p>                                                         |
| type       | string  | Enum: `"nonworking"` `"lunchtime"` `"coffeebreak" "weekends"`                                                                            |
| dow        | string  | <p><br>Enum: <code>"sun"</code> <code>"mon"</code> <code>"tue"</code> <code>"wed"</code> <code>"thu"</code> <code>"fri" "sat"</code></p> |
| time\_from | integer | \<int32> `[ 0 .. 235959 ]` time in seconds from 00:00:00                                                                                 |
| time\_to   | integer | <p><br>\<int32> <code>\[ 0 .. 235959 ]</code> time in seconds to 23:59:59</p>                                                            |

{% tabs %}
{% tab title="200 Example 200 response." %}

```javascript
{
  "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": {}
    }
  }
}
```

{% endtab %}

{% tab title="201 201 response returned from code example." %}

```javascript
{
  "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"
  }
}
```

{% endtab %}

{% tab title="401 " %}

```javascript
{
  "success": false,
  "message": "String",
  "status": 401
}
```

{% endtab %}
{% endtabs %}

### Code Example

{% tabs %}
{% tab title="cURL" %}

```bash
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}"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?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);

```

{% endtab %}

{% tab title="Python" %}

```python
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)

```

{% endtab %}

{% tab title="Javascript" %}

```javascript
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})
});

```

{% endtab %}

{% tab title="Go" %}

```go
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)
}

```

{% endtab %}
{% endtabs %}

## GetAccountOfficeHoursList

<mark style="color:blue;">`GET`</mark> `https://api.opentact.org/rest/account/office_hours`

Get account office hours list

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| X-Auth-Token | string | JWT\_TOKEN       |
| Content-Type | string | application/json |

#### Request Body

| Name | Type   | Description                                                                                                                              |
| ---- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| dow  | string | <p><br>Enum: <code>"sun"</code> <code>"mon"</code> <code>"tue"</code> <code>"wed"</code> <code>"thu"</code> <code>"fri" "sat"</code></p> |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "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": {}
  }
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{
  "success": false,
  "message": "String",
  "status": 400
}
```

{% endtab %}
{% endtabs %}

### Code Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET "https://api.opentact.org/rest/account/office_hours?dow=sun" -H  "accept: application/json" -H  "X-Auth-Token: JWT_TOKEN"

```

{% endtab %}

{% tab title="PHP" %}

```php
<?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);

```

{% endtab %}

{% tab title="Python" %}

```python
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)

```

{% endtab %}

{% tab title="Javascript" %}

```javascript
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'
    }
});

```

{% endtab %}

{% tab title="Go" %}

```go
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)
}

```

{% endtab %}
{% endtabs %}

## GetAccountOfficeHours

<mark style="color:blue;">`GET`</mark> `https://api.opentact.org/rest/account/officehours/{uuid}`

Get Account office hours extended info

#### Path Parameters

| Name | Type   | Description                                                      |
| ---- | ------ | ---------------------------------------------------------------- |
| uuid | string | `^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$` |

#### Headers

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| X-Auth-Token | string | JWT\_TOKEN  |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "success": true,
  "payload": {
    "created_on": "2019-08-24T14:15:22Z",
    "modified_on": "2019-08-24T14:15:22Z",
    "uuid": "string",
    "name": "string",
    "owner": {},
    "users": []
  }
}
```

{% endtab %}

{% tab title="400 Forbidden" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 400
}
```

{% endtab %}

{% tab title="404 uuid not found" %}

```javascript
{
    "success": false,
  "message": "string",
  "status": 404
}
```

{% endtab %}
{% endtabs %}

### Code Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET "https://api.opentact.org/rest/account/office_hours/{uuid}" -H  "accept: application/json" -H  "X-Auth-Token: JWT_TOKEN"

```

{% endtab %}

{% tab title="PHP" %}

```php
<?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);

```

{% endtab %}

{% tab title="Python" %}

```python
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)

```

{% endtab %}

{% tab title="Javascript" %}

```javascript
var fetch = require('node-fetch');

fetch('https://api.opentact.org/rest/account/office_hours/{uuid}', {
    headers: {
        'accept': 'application/json',
        'X-Auth-Token': 'JWT_TOKEN'
    }
});

```

{% endtab %}

{% tab title="Go" %}

```go
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)
}

```

{% endtab %}
{% endtabs %}

## UpdateAccountOfficeHours

<mark style="color:purple;">`PATCH`</mark> `https://api.opentact.org/rest/account/office_hours/{uuid}`

Update Account Office hours

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |
| X-Auth-Token | string | JWT\_TOKEN       |

#### Request Body

| Name       | Type    | Description                                                                                                                              |
| ---------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| name       | string  | <p><code>\[ 1 .. 24 ] characters</code><br>Account Office hours - entry name</p>                                                         |
| type       | string  | Enum: `"nonworking"` `"lunchtime"` `"coffeebreak" "weekends"`                                                                            |
| dow        | string  | <p><br>Enum: <code>"sun"</code> <code>"mon"</code> <code>"tue"</code> <code>"wed"</code> <code>"thu"</code> <code>"fri" "sat"</code></p> |
| time\_from | integer | \<int32> `[ 0 .. 235959 ]` time in seconds from 00:00:00                                                                                 |
| time\_to   | integer | <p><br>\<int32> <code>\[ 0 .. 235959 ]</code> time in seconds to 23:59:59</p>                                                            |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "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": {}
  }
}
```

{% endtab %}

{% tab title="401 " %}

```javascript
{
  "success": false,
  "status": 401,
  "message": "String"
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
  "success": false,
  "status": 404,
  "message": "String"
}
```

{% endtab %}
{% endtabs %}

### Code Example

{% tabs %}
{% tab title="cURL" %}

```bash
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}"

```

{% endtab %}

{% tab title="PHP" %}

```php
<?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);

```

{% endtab %}

{% tab title="Python" %}

```python
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)

```

{% endtab %}

{% tab title="Javascript" %}

```javascript
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})
});

```

{% endtab %}

{% tab title="Go" %}

```go
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)
}

```

{% endtab %}
{% endtabs %}

## RemoveAccountOfficeHoursByUUID

<mark style="color:red;">`DELETE`</mark> `https://api.opentact.org/rest/account/office_hours/{uuid}`

Delete account office hours

#### Path Parameters

| Name | Type   | Description                                                      |
| ---- | ------ | ---------------------------------------------------------------- |
| uuid | string | `^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$` |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |
| X-Auth-Token | string | JWT\_TOKEN       |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "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": {}
  }
}
```

{% endtab %}

{% tab title="401 " %}

```javascript
{
  "success": false,
  "status": 401,
  "message": "String"
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
  "success": false,
  "status": 404,
  "message": "String"
}
```

{% endtab %}
{% endtabs %}

### Code Example

{% tabs %}
{% tab title="cURL" %}

```bash
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}"

```

{% endtab %}

{% tab title="PHP" %}

```php
<?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);

```

{% endtab %}

{% tab title="Python" %}

```python
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)

```

{% endtab %}

{% tab title="Javascript" %}

```javascript
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})
});

```

{% endtab %}

{% tab title="Go" %}

```go
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)
}

```

{% endtab %}
{% endtabs %}
