Skip to content

events.list produces an invalid request URL #673

@leebenson

Description

@leebenson

Describe the bug

Attempting to retrieve events as a list throws "Unrecognized request URL".

{
  "error": {
    "message": "Failed to fetch events",
    "details": "Unrecognized request URL (GET: /v3/grants/<grantId>/events%3Fcalendar_id=primary). Please see https://developer.nylas.com/docs/api/v3/ecc/ or we can help at https://support.nylas.com/."
  }
}

I suspect it's the %3F encoding in place of a ? query string separator.

To Reproduce

const queryParams: ListEventQueryParams = { calendarId };

await nylas.events.list({
  identifier: grantId,
  queryParams,
});

Where calendarId and grantId are appropriately defined.

Expected behavior

Only queryParams values should be URL-encoded, and not the path prefix itself.

SDK Version:
7.13.1

Additional context

Downgrading to 7.11.0 throws a different error:

{
  "error": {
    "message": "Failed to fetch events",
    "details": "Invalid response body while trying to fetch https://api.us.nylas.com/v3/grants/<grantId>/events?calendar_id=primary: incorrect header check"
  }
}

But note ? is correctly unencoded in this case.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions