> ## 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 association by ID

> Using this api you can get SYSTEM_DEFINED / USER_DEFINED association by id

Using this api you can get SYSTEM\_DEFINED / USER\_DEFINED association by id

```http theme={null}
GET https://services.leadconnectorhq.com/associations/{associationId}
```

## 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="associationId" type="string" required />

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="locationId" type="string" required default="string" />

  <ResponseField name="id" type="string" required default="ve9EPM428h8vShlRW1KT" />

  <ResponseField name="key" type="string" required default="student">
    First Objects Association Label (custom\_objects.children)
  </ResponseField>

  <ResponseField name="firstObjectLabel" type="object" required default="student">
    First Objects Association Label (custom\_objects.children)
  </ResponseField>

  <ResponseField name="firstObjectKey" type="object" required default="custom_objects.children">
    First Objects Key
  </ResponseField>

  <ResponseField name="secondObjectLabel" type="object" required default="Teacher">
    Second Object Association Label (contact)
  </ResponseField>

  <ResponseField name="secondObjectKey" type="object" required default="contact">
    Second Objects Key
  </ResponseField>

  <ResponseField name="associationType" type="object" required default="USER_DEFINED">
    Association Type can be USER\_DEFINED or SYSTEM\_DEFINED
  </ResponseField>

  ```json theme={null}
  {
    "locationId": "string",
    "id": "ve9EPM428h8vShlRW1KT",
    "key": "student",
    "firstObjectLabel": "student",
    "firstObjectKey": "custom_objects.children",
    "secondObjectLabel": "Teacher",
    "secondObjectKey": "contact",
    "associationType": "USER_DEFINED"
  }
  ```
</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/associations/YOUR_associationId' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/associations/YOUR_associationId', {
    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/associations/YOUR_associationId',
      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/associations/YOUR_associationId');
  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>
