googleapis / googleapis/google-api-nodejs-client
Freebusy API returning Bad Request when specifying timezone
- Dominant language
- TypeScript
- Stars
- 12.2k
- Forks
- 2k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 24
Description
1) Is this a client library issue or a product issue?
Library issue
2) Did someone already solve this?
No
3) Do you have a support contract?
No
#### Environment details
- OS: MacOs 13.0.1, Apple M1
- Node.js version: 16.17.1
- npm version: 8.15.0
- `googleapis` version: @googleapis/calendar: "^3.0.0",
#### Steps to reproduce
1. Request freebusy with timezone, Bad Request
The following _**works**_
```
const resp = await calendar.freebusy.query({
requestBody: {
calendarExpansionMax: 1,
items: [{ id: calendarId }],
timeMax: '2023-02-01T10:00:00Z',
timeMin: '2023-02-01T05:00:00Z',
},
});
```
This also **_works_**
```
const resp = await calendar.freebusy.query({
requestBody: {
calendarExpansionMax: 1,
items: [{ id: calendarId }],
timeMax: '2023-02-01T10:00:00-05:00',
timeMin: '2023-02-01T05:00:00-05:00',
},
});
```
The following does _**NOT**_ work
```
const resp = await calendar.freebusy.query({
requestBody: {
calendarExpansionMax: 1,
items: [{ id: calendarId }],
timeMax: '2023-02-01T10:00:00',
timeMin: '2023-02-01T05:00:00',
timeZone: 'EST',
},
});
```
The following also does _**NOT**_ work
```
const resp = await calendar.freebusy.query({
requestBody: {
calendarExpansionMax: 1,
items: [{ id: calendarId }],
timeMax: '2023-02-01T10:00:00',
timeMin: '2023-02-01T05:00:00',
timeZone: 'America/Toronto',
},
});
```
Error:
```
Error: Bad Request
at Gaxios._request (.../node_modules/google-auth-library/node_modules/gaxios/src/gaxios.ts:158:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async JWT.requestAsync (.../node_modules/google-auth-library/build/src/auth/oauth2client.js:382:18)
```
Contributor guide
Assessment
This issue has not been assessed yet.