# Bookwhen

> Read booking events, tickets, venues, attachments, leaders, and class passes.

App · 12 actions. Web page: https://docs.lodol.com/docs/integrations/bookwhen

## Actions

### Get attachment

Returns the attachment for the provided attachment ID.

**Inputs**

- Attachment (`attachment_id`, text, required): ID of attachment to retrieve

**Outputs**

- `data` (object): The response from Bookwhen.

**Example output**

```json
{
  "data": {
    "data": {
      "attributes": {
        "content_type": "example",
        "file_name": "example",
        "file_size_bytes": "example",
        "file_size_text": "example",
        "file_type": "example",
        "file_url": "example",
        "title": "example"
      },
      "id": "example",
      "links": {
        "self": "example"
      },
      "type": "example"
    }
  }
}
```

### Get class pass

Returns the class pass for the provided class pass ID.

**Inputs**

- Class pass ID (`class_pass_id`, text, required): ID of class pass to retrieve

**Outputs**

- `data` (object): The response from Bookwhen.

**Example output**

```json
{
  "data": {
    "data": {
      "attributes": {
        "details": "example",
        "number_available": 1,
        "title": "example",
        "usage_allowance": 1,
        "usage_type": "example",
        "use_restricted_for_days": 1
      },
      "id": "example",
      "links": {
        "self": "example"
      },
      "type": "example"
    }
  }
}
```

### Get event

Returns the event for the provided event ID.

**Inputs**

- Event ID (`event_id`, text, required): ID of account to retrieve
- Include (`include`, list): Include. One or more of: `location`, `attachments`, `tickets`, `tickets.events`, `tickets.class_passes` (Tickets.class passes), `leaders`.

**Outputs**

- `data` (object): The response from Bookwhen.

**Example output**

```json
{
  "data": {
    "data": {
      "attributes": {
        "all_day": false,
        "attendee_count": 1,
        "attendee_limit": 1,
        "details": "example",
        "end_at": "example",
        "event_image": {
          "alt_ratio_16x9_1x_url": "example",
          "alt_ratio_16x9_2x_url": "example",
          "alt_ratio_16x9_3x_url": "example",
          "alt_ratio_1x1_1x_url": "example",
          "alt_ratio_1x1_2x_url": "example",
          "alt_ratio_1x1_3x_url": "example",
          "alt_ratio_4x3_1x_url": "example",
          "alt_ratio_4x3_2x_url": "example",
          "alt_ratio_4x3_3x_url": "example",
          "image_url": "example"
        },
        "max_tickets_per_booking": 1,
        "start_at": "example",
        "tags": [],
        "title": "example",
        "waiting_list": false
      },
      "id": "example",
      "included": [],
      "links": {
        "self": "example"
      },
      "relationships": {
        "attachments": {
          "data": [],
          "links": {
            "related": "example",
            "self": "example"
          }
        },
        "leaders": {
          "data": [],
          "links": {
            "related": "example",
            "self": "example"
          }
        },
        "location": {
          "data": {
            "id": "example",
            "type": "example"
          },
          "links": {
            "related": "example",
            "self": "example"
          }
        },
        "tickets": {
          "data": [],
          "links": {
            "related": "example",
            "self": "example"
          }
        }
      },
      "type": "example"
    }
  }
}
```

### Get leader

Returns the leader for the provided leader ID.

**Inputs**

- Leader (`leader_id`, text, required): ID of leader to retrieve

**Outputs**

- `data` (object): The response from Bookwhen.

**Example output**

```json
{
  "data": {
    "data": {
      "attributes": {
        "avatar_url": "example",
        "bio": "example",
        "contact_email": "example",
        "contact_phone": "example",
        "job_title": "example",
        "location": "example",
        "name": "example",
        "social_feeds": [],
        "website": "example"
      },
      "id": "example",
      "links": {
        "self": "example"
      },
      "type": "example"
    }
  }
}
```

### Get location

Returns the location for the provided location ID.

**Inputs**

- Location ID (`location_id`, text, required): ID of location to retrieve

**Outputs**

- `data` (object): The response from Bookwhen.

**Example output**

```json
{
  "data": {
    "data": {
      "attributes": {
        "additional_info": "example",
        "address_text": "example",
        "latitude": 1.0,
        "longitude": 1.0,
        "map_url": "example",
        "zoom": 1
      },
      "id": "example",
      "links": {
        "self": "example"
      },
      "type": "example"
    }
  }
}
```

### Get ticket

Returns the ticket for the provided ticket ID.

**Inputs**

- Ticket ID (`ticket_id`, text, required): ID of ticket to retrieve
- Include (`include`, list): Include. One or more of: `class_passes` (Class passes), `events`, `events.location`, `events.tickets`, `events.attachments`.

**Outputs**

- `data` (object): The response from Bookwhen.

**Example output**

```json
{
  "data": {
    "data": {
      "attributes": {
        "available": false,
        "available_from": "example",
        "available_to": "example",
        "built_basket_iframe_url": "example",
        "built_basket_url": "example",
        "cost": {
          "currency_code": "example",
          "face_value_net": 1.0,
          "net": 1.0,
          "tax": 1.0
        },
        "course_ticket": false,
        "details": "example",
        "group_max": 1.0,
        "group_min": 1.0,
        "group_ticket": false,
        "number_issued": 1.0,
        "number_taken": 1.0,
        "title": "example"
      },
      "id": "example",
      "included": [],
      "links": {
        "self": "example"
      },
      "relationships": {
        "class_passes": {
          "data": [],
          "links": {
            "related": "example",
            "self": "example"
          }
        },
        "events": {
          "data": [],
          "links": {
            "related": "example",
            "self": "example"
          }
        }
      },
      "type": "example"
    }
  }
}
```

### List attachments

Fetch attachments for the given query params.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Bookwhen.

**Example output**

```json
{
  "data": {
    "data": [],
    "links": {
      "first": "example",
      "next": "example",
      "prev": "example",
      "self": "example"
    }
  }
}
```

### List class passes

Fetch class passes for the given query params.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Bookwhen.

**Example output**

```json
{
  "data": {
    "data": [],
    "links": {
      "first": "example",
      "next": "example",
      "prev": "example",
      "self": "example"
    }
  }
}
```

### List events

List events.

**Inputs**

- Include (`include`, list): Include. One or more of: `location`, `attachments`, `tickets`, `tickets.events`, `tickets.class_passes` (Tickets.class passes), `leaders`.
- Offset (`offset`, number): Offset. At least 0.
- Start date (`start_date`, date): Start date.
- End date (`end_date`, date): End date.

**Outputs**

- `data` (object): The response from Bookwhen.

**Example output**

```json
{
  "data": {
    "data": [],
    "links": {
      "first": "example",
      "next": "example",
      "prev": "example",
      "self": "example"
    }
  }
}
```

### List leaders

Fetch leaders with published profiles accessible by the API token.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Bookwhen.

**Example output**

```json
{
  "data": {
    "data": [],
    "links": {
      "first": "example",
      "next": "example",
      "prev": "example",
      "self": "example"
    }
  }
}
```

### List locations

Fetch locations for the given query params.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Bookwhen.

**Example output**

```json
{
  "data": {
    "data": [],
    "links": {
      "first": "example",
      "next": "example",
      "prev": "example",
      "self": "example"
    }
  }
}
```

### List tickets

Fetch tickets for the given event.

**Inputs**

- Event (`event`, text, required): The ID of the event to list tickets for.
- Include (`include`, list): Include. One or more of: `class_passes` (Class passes), `events`, `events.location`, `events.tickets`, `events.attachments`.
- Offset (`offset`, number): Offset. At least 0.

**Outputs**

- `data` (object): The response from Bookwhen.

**Example output**

```json
{
  "data": {
    "data": [],
    "links": {
      "first": "example",
      "next": "example",
      "prev": "example",
      "self": "example"
    }
  }
}
```
