You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When calling an endpoint like Return a message which is at /v3/grants/{grant_id}/messages/{message_id}, message_id is not correctly encoded by the SDK, which is problematic because the message_id can contain slashes (/)
This results in the API returning a 404 and then a thrown exception by the SDK
To Reproduce
constnylas=newNylas({ ... })// This is close to an actual message Id I received from a webhook `message.created` notification (`data.object.id` in the payload)constmessageId='<!&!AAAAAAAAAAAuAAAAAAAAAPL4NVAlECZImvB/pLie/4YBAMO2jhD3dRHOtM0AqgC7tuYAAAAAAA4AABAAAACZVwwoazxqQKlwtj+kjwWaAQAAAAA=@someaddr.com>'constidentifier='some-grant-id'constmessage=awaitnylas.messages.find({ identifier, messageId })// 👈❌ throws a `NylasApiError` with 'Unrecognized request URL (GET: /v3/grants/some-grant-id/messages/%3C!&!AAAAAAAAAAAuAAAAAAAAAPL4NVAlECZImvB/pLie/4YBAMO2jhD3dRHOtM0AqgC7tuYAAAAAAA4AABAAAACZVwwoazxqQKlwtj+kjwWaAQAAAAA=@someaddr.com%3E). Please see https://devel...' constmessage=awaitnylas.messages.find({ identifier,messageId: encodeURIComponent(messageId)})// 👈 ✅ works and returns the expected message
Expected behavior
I expected the SDK to encode path components and not to have to manually call e.g. encodeURIComponent(someId) when making those kinds of API call
SDK Version:
7.7.2
The text was updated successfully, but these errors were encountered:
Describe the bug
When calling an endpoint like
Return a message
which is at/v3/grants/{grant_id}/messages/{message_id}
,message_id
is not correctly encoded by the SDK, which is problematic because themessage_id
can contain slashes (/
)This results in the API returning a 404 and then a thrown exception by the SDK
To Reproduce
Expected behavior
I expected the SDK to encode path components and not to have to manually call e.g.
encodeURIComponent(someId)
when making those kinds of API callSDK Version:
7.7.2
The text was updated successfully, but these errors were encountered: