> ## Documentation Index
> Fetch the complete documentation index at: https://developers.leadwaycrm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Appointments for Contact

> Get Appointments for Contact

Get Appointments for Contact

```http theme={null}
GET https://services.leadconnectorhq.com/contacts/{contactId}/appointments
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="contactId" type="string" required default="sx6wyHhbFdRXh302LLNR">
  Contact Id
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="events" type="object[]">
    <Expandable title="cada item">
      <ResponseField name="id" type="string" default="YS3jaqqeehkR2Is80miy" />

      <ResponseField name="calendarId" type="string" default="YlWd2wuCAZQzh2cH1fVZ" />

      <ResponseField name="status" type="string" default="booked" />

      <ResponseField name="title" type="string" default="Test" />

      <ResponseField name="assignedUserId" type="string" default="YlWd2wuCAZQzh2cH1fVZ" />

      <ResponseField name="notes" type="string" default="test" />

      <ResponseField name="startTime" type="string" default="2021-07-16 11:00:00" />

      <ResponseField name="endTime" type="string" default="2021-07-16 11:30:00" />

      <ResponseField name="address" type="string" default="Address" />

      <ResponseField name="locationId" type="string" default="YlWd2wuCAZQzh2cH1fVZ" />

      <ResponseField name="contactId" type="string" default="YlWd2wuCAZQzh2cH1fVZ" />

      <ResponseField name="groupId" type="string" default="YlWd2wuCAZQzh2cH1fVZ" />

      <ResponseField name="appointmentStatus" type="string" default="booked" />

      <ResponseField name="users" type="string[]" />

      <ResponseField name="dateAdded" type="string" default="2021-07-16 11:00:00" />

      <ResponseField name="dateUpdated" type="string" default="2021-07-16 11:30:00" />

      <ResponseField name="assignedResources" type="string[]" />
    </Expandable>
  </ResponseField>

  ```json theme={null}
  {
    "events": [
      {
        "id": "YS3jaqqeehkR2Is80miy",
        "calendarId": "YlWd2wuCAZQzh2cH1fVZ",
        "status": "booked",
        "title": "Test",
        "assignedUserId": "YlWd2wuCAZQzh2cH1fVZ",
        "notes": "test",
        "startTime": "2021-07-16 11:00:00",
        "endTime": "2021-07-16 11:30:00",
        "address": "Address",
        "locationId": "YlWd2wuCAZQzh2cH1fVZ",
        "contactId": "YlWd2wuCAZQzh2cH1fVZ",
        "groupId": "YlWd2wuCAZQzh2cH1fVZ",
        "appointmentStatus": "booked",
        "users": [
          "YlWd2wuCAZQzh2cH1fVZ",
          "YlWd2wuCAZQzh2cH1fVZ"
        ],
        "dateAdded": "2021-07-16 11:00:00",
        "dateUpdated": "2021-07-16 11:30:00",
        "assignedResources": [
          "YlWd2wuCAZQzh2cH1fVZ",
          "YlWd2wuCAZQzh2cH1fVZ"
        ]
      }
    ]
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://services.leadconnectorhq.com/contacts/YOUR_contactId/appointments' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/contacts/YOUR_contactId/appointments', {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
    },
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'GET',
      'https://services.leadconnectorhq.com/contacts/YOUR_contactId/appointments',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
      },
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/contacts/YOUR_contactId/appointments');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'GET',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
      ],
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
