> ## 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 transcription by Message ID

> Get the recording transcription for a message by passing the message id

Get the recording transcription for a message by passing the message id

```http theme={null}
GET https://services.leadconnectorhq.com/conversations/locations/{locationId}/messages/{messageId}/transcription
```

## 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="locationId" type="string" required default="tDtDnQdgm2LXpyiqYvZ6">
  Account ID as string
</ParamField>

<ParamField path="messageId" type="string" required default="tDtDnQdgm2LXpyiqYvZ6">
  Message ID as string
</ParamField>

## Respuestas

<Accordion title="200 - Gives the attached recording transcription to the message">
  <ResponseField name="mediaChannel" type="number" required default="1">
    Media channel describes the user interaction channel
  </ResponseField>

  <ResponseField name="sentenceIndex" type="number" required default="1">
    Index of the sentence in the transcription
  </ResponseField>

  <ResponseField name="startTime" type="number" required default="34">
    Start time of the sentence in milliseconds
  </ResponseField>

  <ResponseField name="endTime" type="number" required default="45">
    End time of the sentence in milliseconds
  </ResponseField>

  <ResponseField name="transcript" type="string" required default="This call may be recorded for quality assurance purposes.">
    Transcript of the sentence
  </ResponseField>

  <ResponseField name="confidence" type="number" required default="0.5">
    Confidence of the transcription
  </ResponseField>

  ```json theme={null}
  {
    "mediaChannel": "1",
    "sentenceIndex": "1",
    "startTime": "34",
    "endTime": "45",
    "transcript": "This call may be recorded for quality assurance purposes.",
    "confidence": "0.5"
  }
  ```
</Accordion>

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

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

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://services.leadconnectorhq.com/conversations/locations/YOUR_locationId/messages/YOUR_messageId/transcription' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

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