Rest

new Rest(axiosInstance, accessToken)

This class is used to make REST requests to the TidyHQ API.
Parameters:
NameTypeDescription
axiosInstanceAxiosInstanceThe Axios instance to use for requests.
accessTokenstringThe access token to use.

Methods

(async) delete(path, data, accessToken) → {Promise.<TidyAPI_Response>}

Wrapper for making a DELETE request
Parameters:
NameTypeDescription
pathstringThe path to request.
dataObjectThe data to send.
accessTokenstringThe access token to use.
Returns:
- The response from the request.
Type: 
Promise.<TidyAPI_Response>

(async) get(path, accessToken) → {Promise.<TidyAPI_Response>}

Wrapper for making a GET request
Parameters:
NameTypeDescription
pathstringThe path to request.
accessTokenstringThe access token to use.
Returns:
- The response from the request.
Type: 
Promise.<TidyAPI_Response>

(async) patch(path, data, accessToken) → {Promise.<TidyAPI_Response>}

Wrapper for making a PATCH request
Parameters:
NameTypeDescription
pathstringThe path to request.
dataObjectThe data to send.
accessTokenstringThe access token to use.
Returns:
- The response from the request.
Type: 
Promise.<TidyAPI_Response>

(async) post(path, data, accessToken) → {Promise.<TidyAPI_Response>}

Wrapper for making a POST request
Parameters:
NameTypeDescription
pathstringThe path to request.
dataObjectThe data to send.
accessTokenstringThe access token to use.
Returns:
- The response from the request.
Type: 
Promise.<TidyAPI_Response>

(async) put(path, data, accessToken) → {Promise.<TidyAPI_Response>}

Wrapper for making a PUT request
Parameters:
NameTypeDescription
pathstringThe path to request.
dataObjectThe data to send.
accessTokenstringThe access token to use.
Returns:
- The response from the request.
Type: 
Promise.<TidyAPI_Response>