### Appointments API Source: https://developers.acuityscheduling.com/reference/index This section provides examples for retrieving appointments using various programming languages. ```APIDOC ## Appointments API Example ### Description This endpoint allows you to retrieve appointment data. The examples below demonstrate how to make a request using JavaScript, PHP, and cURL. ### Method GET ### Endpoint `https://acuityscheduling.com/api/v1/appointments` ### Request Example (JavaScript) ```javascript var Acuity = require('acuityscheduling'); var acuity = Acuity.basic({ userId: ACUITY_USER_ID, apiKey: 'ACUITY_API_KEY' }); acuity.request('appointments', function (err, res, appointments) { if (err) return console.error(err); console.log(appointments); }); ``` ### Request Example (PHP SDK) ```php ACUITY_USER_ID, 'apiKey' => 'ACUITY_API_KEY' )); $appointments = $acuity->request('appointments'); print_r($appointments); ?> ``` ### Request Example (PHP cURL) ```php ``` ``` -------------------------------- ### GET /appointments Source: https://developers.acuityscheduling.com/reference/quick-start This example shows how to retrieve a list of appointments using the Acuity Scheduling API with different client libraries and direct cURL requests. ```APIDOC ## GET /appointments ### Description This endpoint retrieves a list of appointments. The examples below demonstrate how to make this request using cURL, the Acuity JavaScript SDK, and PHP. ### Method GET ### Endpoint `https://acuityscheduling.com/api/v1/appointments` ### Request Example (cURL) ```shell curl -u YOUR_USER_ID:YOUR_API_KEY "https://acuityscheduling.com/api/v1/appointments" ``` ### Request Example (JavaScript SDK) ```javascript var Acuity = require('acuityscheduling'); var acuity = Acuity.basic({ userId: YOUR_USER_ID, apiKey: 'YOUR_API_KEY' }); acuity.request('appointments', function (err, res, appointments) { if (err) return console.error(err); console.log(appointments); }); ``` ### Request Example (PHP SDK) ```php YOUR_USER_ID, 'apiKey' => 'YOUR_API_KEY' )); $appointments = $acuity->request('appointments'); print_r($appointments); ?> ``` ### Request Example (PHP cURL) ```php ``` ### Response Example (Success) ```json { "example": "response body" } ``` ``` -------------------------------- ### Authenticate and Fetch Appointments with PHP (PHP-SDK) Source: https://developers.acuityscheduling.com/reference/quick-start This PHP snippet uses the `acuityscheduling` SDK to fetch appointments. Ensure you have installed the SDK using Composer (`vendor/autoload.php`). Replace `ACUITY_USER_ID` and `ACUITY_API_KEY` with your credentials. ```php ACUITY_USER_ID, 'apiKey' => 'ACUITY_API_KEY' )); $appointments = $acuity->request('appointments'); print_r($appointments); ?> ``` -------------------------------- ### Fetch Appointments using Acuity Scheduling JavaScript SDK Source: https://developers.acuityscheduling.com/reference/index This example shows how to retrieve appointments using the Acuity Scheduling JavaScript SDK. It requires initializing the SDK with your User ID and API Key, then making a request to the 'appointments' endpoint. ```javascript var Acuity = require('acuityscheduling'); var acuity = Acuity.basic({ userId: ACUITY_USER_ID, apiKey: 'ACUITY_API_KEY' }); acuity.request('appointments', function (err, res, appointments) { if (err) return console.error(err); console.log(appointments); }); ``` -------------------------------- ### Authenticate and Fetch Appointments with PHP (cURL) Source: https://developers.acuityscheduling.com/reference/quick-start This PHP example uses cURL to authenticate and fetch appointments. It manually sets up the cURL request with HTTP Basic Auth. Replace `ACUITY_USER_ID` and `ACUITY_API_KEY` with your credentials. ```php ``` -------------------------------- ### Fetch Appointments using PHP cURL Source: https://developers.acuityscheduling.com/reference/index This example shows how to fetch appointments using PHP's cURL library. It manually sets up the cURL request with HTTP Basic Authentication and retrieves the JSON response. ```php ACUITY_USER_ID, 'apiKey' => 'ACUITY_API_KEY' )); $appointments = $acuity->request('appointments'); print_r($appointments); ``` -------------------------------- ### OpenAPI Definition for /me Endpoint Source: https://developers.acuityscheduling.com/reference/get-me This is the OpenAPI 3.1.0 definition for the /me endpoint of the Acuity Scheduling API. It specifies the request method (GET), responses (200 and 400), and provides an example of the expected JSON response for successful retrieval of account information. ```json { "openapi": "3.1.0", "info": { "title": "v1", "version": "1.1" }, "servers": [ { "url": "https://acuityscheduling.com/api/v1" } ], "components": { "securitySchemes": { "sec0": { "type": "http", "scheme": "basic" } } }, "security": [ { "sec0": [] } ], "paths": { "/me": { "get": { "summary": "/me", "description": "Get basic account information.", "operationId": "get-me", "responses": { "200": { "description": "200", "content": { "application/json": { "examples": { "Result": { "value": "{\n \"id\": 1,\n \"email\": \"example@acuityscheduling.com\",\n \"timezone\": \"America/New_York\",\n \"firstDayOfWeek\": 0,\n \"timeFormat\": \"ampm\",\n \"currency\": \"USD\",\n \"schedulingPage\": \"https://example.acuityscheduling.com/\",\n \"embedCode\": \"