# Episodes_LocateEpisode

`GET /v1/accounts/{account}/datasets/{dataset}/episodes/{episode}:locate`

Where one episode sits in a filtered, ordered list of its dataset: its
position and neighbours, for "12 / 340" and prev / next in the studio. NOT_FOUND when the filter excludes it.

- Base URL: `https://junction-api.qualiastudios.dev`
- Authentication: an API key in the `X-API-Key` header

## Parameters

- `account` (path, string, required): The account id.
- `dataset` (path, string, required): The dataset id.
- `episode` (path, string, required): The episode id.
- `filter` (query, string): Same language as ListEpisodes.filter.
- `orderBy` (query, string): Same values as ListEpisodes.order_by.
- `pageSize` (query, integer (int32)): The page size the returned page_token is for; same rules as
  ListEpisodes.page_size. Pass the same value to ListEpisodes.
- `version` (query, string): Locate it in the list as this version froze it, the one
  ListEpisodes.version reads: that version's episodes, in its order. Same
  values as ListEpisodes.version; pass the same value to ListEpisodes.

## Responses

- `200` OK: `application/json` `qualia.v1.LocateEpisodeResponse`
- `default` Default error response: `application/json` `google.rpc.Status`

## Schemas

```yaml
qualia.v1.LocateEpisodeResponse:
  type: object
  properties:
    position:
      type: integer
      description: Its index in the filtered order, from 0.
      format: int32
    totalSize:
      type: integer
      description: Episodes the filter leaves.
      format: int32
    previousEpisode:
      type: string
      description: The episode before it; empty at the start.
    nextEpisode:
      type: string
      description: The episode after it; empty at the end.
    pageToken:
      type: string
      description: A ListEpisodes page_token that starts the page containing it.
  description: Response for Episodes.LocateEpisode.
google.rpc.Status:
  oneOf:
    - $ref: "#/components/schemas/ApiError"
    - $ref: "#/components/schemas/GatewayError"
  description: "The body of a failed call: one of the two shapes below."
ApiError:
  title: API error
  type: object
  required:
    - code
    - message
    - retryable
    - details
  properties:
    code:
      type: string
      description: The gRPC code name in upper case, e.g. `NOT_FOUND`.
    message:
      type: string
    retryable:
      type: boolean
      description: Whether the same call may succeed if retried.
    details:
      type: array
      items:
        type: object
      description: "Empty, except when a dataset copy or move is refused: then one `google.rpc.ErrorInfo` with the refusal's `reason` code, its `domain` and, in `metadata`, the datasets it names."
  description: A refusal from the API itself.
GatewayError:
  title: Gateway error
  type: object
  required:
    - detail
  properties:
    detail:
      type: string
      description: What went wrong.
  description: A refusal from the gateway before the call reaches the API, for example `401` bad or missing API key, `403` key lacks the scope or environment closed, `413` body too large.
```
