OnCaller
  • OnCaller Developer Document
  • API
    • Authentication
    • Blacklist Number Management
    • Business Hour Management
    • Caller Setting
    • Call Actions
    • Call Logs
  • SDK
    • Javascript SDK
      • OnCallerCall
      • OnCallerCallState
      • OnCallerClient
      • OnCaller Error Code
      • Example
    • OnCaller Call Widget
    • Android SDK
    • iOS SDK
    • React Native SDK
    • Cordova/IONIC SDK
Powered by GitBook
On this page
  • Get all Business hours
  • Get a Business hour by ID
  • Create new Business hour
  • Delete Business hour

Was this helpful?

  1. API

Business Hour Management

APIs for managing business hour

Get all Business hours

GET https://{yoursubdomain}.oncaller.asia/api/v1/setting/business-hour

This endpoint allows you to get all business hours.

Query Parameters

Name
Type
Description

search

string

Name of business hour to search

limit

number

Limit result per page

asc

boolean

Order by ASC mode or not

Headers

Name
Type
Description

Authentication

string

Bearer + {token}

{
    "success": true,
    "code": 200,
    "locale": "en",
    "message": "OK",
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 1,
                "name": "Bussiness Hours 111",
                "enable": 1,
                "provider_business_hour_id": null,
                "created_at": "2020-10-13T06:18:08.000000Z",
                "updated_at": "2020-10-13T06:18:08.000000Z",
                "days": [
                    {
                        "day": "mon",
                        "open": "08:00:00",
                        "close": "17:00:00"
                    },
                    {
                        "day": "tue",
                        "open": "08:00:00",
                        "close": "17:00:00"
                    },
                    {
                        "day": "wed",
                        "open": "08:00:00",
                        "close": "17:00:00"
                    },
                    {
                        "day": "thu",
                        "open": "08:00:00",
                        "close": "17:00:00"
                    }
                ]
            }
        ],
        "first_page_url": "https:\/\/subdomain.oncaller.asia\/api\/v1\/setting\/business-hour?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "https:\/\/subdomain.oncaller.asia\/api\/v1\/setting\/business-hour?page=1",
        "next_page_url": null,
        "path": "https:\/\/subdomain.oncaller.asia\/api\/v1\/setting\/business-hour",
        "per_page": 20,
        "prev_page_url": null,
        "to": 1,
        "total": 1
    }
}

Get a Business hour by ID

GET https://{yoursubdomain}.oncaller.asia/api/v1/setting/business-hour/:id

Get a business hour by id

Path Parameters

Name
Type
Description

id

number

Id of Business. Ex: 1

Headers

Name
Type
Description

Authentication

string

Bearer + {token}

{
    "success": true,
    "code": 200,
    "locale": "en",
    "message": "OK",
    "data": {
        "id": 1,
        "name": "Bussiness Hours 111",
        "enable": 1,
        "provider_business_hour_id": null,
        "created_at": "2020-10-13T06:18:08.000000Z",
        "updated_at": "2020-10-13T06:18:08.000000Z",
        "days": [
            {
                "day": "mon",
                "open": "08:00:00",
                "close": "17:00:00"
            },
            {
                "day": "tue",
                "open": "08:00:00",
                "close": "17:00:00"
            },
            {
                "day": "wed",
                "open": "08:00:00",
                "close": "17:00:00"
            },
            {
                "day": "thu",
                "open": "08:00:00",
                "close": "17:00:00"
            }
        ]
    }
}

Create new Business hour

POST https://{yoursubdomain}.oncaller.asia/api/v1/setting/business-hour

Path Parameters

Name
Type
Description

Authentication

string

Bearer + {token}

Request Body

Name
Type
Description

name

string

Name of Business hour. Ex: Working day

enabled

boolean

Is enabled or not. Default is true

days.*.day

string

Name of day. Ex: mon, tue, wed,thu,fri,sat,sun

days.*.open

string

The value of open hour, must valid format H:i. Ex: 07:30

days.*.close

string

The value of close hour, must valid format H:i. Ex: 17:30

{
    "success": true,
    "code": 200,
    "locale": "en",
    "message": "OK",
    "data": {
        "name": "Bussiness Hours 12",
        "enable": true,
        "updated_at": "2020-10-13T06:39:13.000000Z",
        "created_at": "2020-10-13T06:39:13.000000Z",
        "id": 2
    }
}

Delete Business hour

DELETE https://{yoursubdomain}.oncaller.asia/api/v1/setting/business-hour/:id

Delete a business hour

Path Parameters

Name
Type
Description

id

number

ID of business hour

{
    "success": true,
    "code": 0,
    "locale": "en",
    "message": "OK",
    "data": null
}
PreviousBlacklist Number ManagementNextCaller Setting

Last updated 4 years ago

Was this helpful?