new Rest(axiosInstance, accessToken)
This class is used to make REST requests to the TidyHQ API.
Parameters:
Name | Type | Description |
---|---|---|
axiosInstance | AxiosInstance | The Axios instance to use for requests. |
accessToken | string | The access token to use. |
- Source
Methods
(async) delete(path, data, accessToken) → {Promise.<TidyAPI_Response>}
Wrapper for making a DELETE request
Parameters:
Name | Type | Description |
---|---|---|
path | string | The path to request. |
data | Object | The data to send. |
accessToken | string | The access token to use. |
- Source
Returns:
- The response from the request.
- Type:
- Promise.<TidyAPI_Response>
(async) get(path, accessToken) → {Promise.<TidyAPI_Response>}
Wrapper for making a GET request
Parameters:
Name | Type | Description |
---|---|---|
path | string | The path to request. |
accessToken | string | The access token to use. |
- Source
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:
Name | Type | Description |
---|---|---|
path | string | The path to request. |
data | Object | The data to send. |
accessToken | string | The access token to use. |
- Source
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:
Name | Type | Description |
---|---|---|
path | string | The path to request. |
data | Object | The data to send. |
accessToken | string | The access token to use. |
- Source
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:
Name | Type | Description |
---|---|---|
path | string | The path to request. |
data | Object | The data to send. |
accessToken | string | The access token to use. |
- Source
Returns:
- The response from the request.
- Type:
- Promise.<TidyAPI_Response>