Resource

The Resource API is used to access, create, and modify the different resources on your business' account. The Resource API is connected to the Locations, Staff, and Services APIs, as resources are used by both staff and services at particular locations. 

On this page




Resource API Endpoints

These are the endpoints that are available under the /resource path, which lists all the different resources you have added to the services or locations on your business account.

Endpoint

Description

GET /resource

Returns all resource objects on an account in array format.

GET /resource/{resourceId}

Returns a JSON object for specified resource.

GET /resource/{resourceId}/isBusy/{apptDate YYYY-MM-DD}/{Appt startTim HHMM}/{Appt endTime HHMM}

Returns as true or false depending on whether the resource is or isn’t busy during the date and time passed in the call.

POST /resource

Creates a new resource object on an account.

Request body/payload:  Must pass a resource object in the request body/payload.

For these calls, you need to pass a resource object with all required fields and any fields you want to set filled in the body of the payload. We have an example of a resource object in the responses section below and have indicated the required fields in the object values table at the bottom of this page.

PUT /resource

Updates specified resource object. 

Request body/payload: Must pass a resource object with desired changes made in the request body/payload.

For these calls, you need to pass a resource object with all required fields and any fields you want to update filled in the body of the payload. We have an example of a resource object in the responses section below and have indicated the required fields in the object values table at the bottom of this page.

DELETE /resource/{resourceId}Removes a resource object from view by setting its active property to false.




Resource API Parameters


There are no parameters included with resource calls.




Resource API Request Body/Payloads

The objects below represent the minimum viable objects to pass that are needed to create or update a resource object. Check whether or not a property can be written to by looking at the Object Values table below to see if the property is writable.

POST /resource
{
    "bundleResourceIdList": [],
    "locationId": 282639,
    "name": "Hamster Wheel",
    "reasonIdList": [
    "0": 255109,
    "1": 159330
]}
PUT /resource
{
    "active": true,
    "bundleResourceIdList": [],
    "bundleResourceSet": [],
    "bundledResources": null,
    "businessId": 43111,
    "createdDate": 1531934814568,
    "createdUser": "JoeSchmo",
    "isBundledResource": false,
    "locationId": 87877,
    "locationName": "Office 1",
    "modifiedDate": 1531934814568,
    "modifiedUser": "JoeSchmo",
    "name": "Ball",
    "professionalIdList": [],
    "professionalIdListText": "",
    "reasonIdList": [
        "0": 240094,
        "0": 436103
    ],
    "reasonIdListText": "159578,159330,158196",
    "reasonSet": [
         "0": {Reason object for service of resource - for more info, see Services API page
    }],
    "reasons": [
         "0": "Pooch primping"
    ],
    "resourceId": 2985
}




Resource API Responses

GET /resources
[{
    “active”: true,
    "bundleResourceIdList": [
        "0": 2556
    ],
    "bundledResourceSet": null,
    "bundledResources": [
        "0": "Grooming Room"
    ],
    “businessId”: 43111,
    “createdDate”: 1531775107639,
    “createdUser”: "JoeSchmo",
    "locationId": 282639,
    “locationName”: "Green office",
    "modifiedDate": 1531775107639,
    "modifiedUser": "JoeSchmo",
    "name": "Dog Brush",
    "professionalIdList": [],
    "professionalIdListText": "",
    "reasonIdList": [
        "0": 159330,
        "1": 646892
    ],
    "reasonIdListText": "159330,646892",
    "reasons": [
        "0": "Doggy Bath",
        "1": Dog Grooming"
    ],
    "resourceId": 16450
}]
GET /resource/{resourceId}
[{
    “active”: true,
    "bundleResourceIdList": null,
    "bundledResourceSet": null,
    "bundledResources": [],
    “businessId”: 43111,
    “createdDate”: 1528820215670,
    “createdUser”: "JoeSchmo",
    "locationId": 81181,
    “locationName”: "Beach Office",
    "modifiedDate": 1528820215670,
    "modifiedUser": "JoeSchmo",
    "name": "Ball",
    "professionalIdList": [],
    "professionalIdListText": "",
    "reasonIdList": [
    "0": 158196
    ],
    "reasonIdListText": "158196",
    "reasons": [
    "0": "HipHop"
    ],
    "resourceId": 2589
}]
POST /resource
{
    “active”: true,
    "bundleResourceIdList": [],
    "bundleResourceSet": null,
    "bundledResources": null,
    “businessId”: 43111,
    “createdDate”: 1528820215670,
    “createdUser”: "JoeSchmo",
    "locationId": 81181,
    “locationName”: null,
    "modifiedDate": 1528820215670,
    "modifiedUser": "JoeSchmo",
    "name": "Hamster Wheel",
    "professionalIdList": null,
    "professionalIdListText": "",
    "reasonIdList": [158196],
    "reasonIdListText": "158196",
    "reasonSet": null,
    "reasons": ["HipHop"],
    "resourceId": 3612
}
PUT /resource
{
    “active”: true,
    “businessId”: 43111,
    “createdDate”: 1531775107639,
    “createdUser”: "JoeSchmo",
    "locationId": 81181,
    “locationName”: "Beach Office",
    "modifiedDate": 1531775107639,
    "modifiedUser": "JoeSchmo",
    "name": "Surfboard A",
    "reasonIdList": [159578],
    "reasonIdListText": "159578",
    "reasons": ["Bb"],
    "resourceId": 2919
}




Resource Object Values

Property nameTypeRequiredWritableDescription
activebooleanYes
Indicates whether or not specified resource should return on GET calls.
bundleResourceIdListarray

Displays as list of IDs of resources that are bundled with the specified resource.
bundleResourceSetarray

Displays as an array of resource objects for resources in bundle.
bundledResourcesstring

Displays as a string of the names of the resources in bundle.
businessIdintegerYes
Provides unique numeric ID of the business to which the specified resource belongs. 
createdDateinteger

Displays as the date the specified resource was created in milliseconds elapsed since January 1, 1970 00:00:00 UTC form.
createdUserstring

Displays the username of user who created the specified resource.
locationIdintegerYes

Provides unique numeric ID of location of the specified resource.

locationNamestringYesYesProvides the public name of location of the specified resource.

modifiedDate

integer



Displays as date the specified resource was last modified in milliseconds elapsed since January 1, 1970 00:00:00 UTC form.

modifiedUserstring

Displays the username of user who last modified the specified resource.

namestring
YesDisplays as name given to the specified resource on your account.
professionalIdListarray

Displays as list of IDs of staff that are connected to the specified resource.
professionalIdListTextstring

Displays the list of IDs of staff that are connected to the specified resource in text format.
reasonIdListarray
YesDisplays as list of IDs of services that are connected to the specified resource.
reasonIdListTextstring
YesDisplays the list of IDs of services that are connected to the specified resource in text format.
reasonSetarray

Displays as an array of reasons that the specified resource is connected to.
reasonsarray
YesDisplays as list of service names that use the specified resource in array format.
resourceIdintegerYes, on PUT calls
Provides unique numerical ID of the specified resource.