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
I have been attempting to integrate with the Basiq API (v3) by following the documentation provided at https://api.basiq.io/reference/posttoken. My goal is to generate a new token. While I was successful in achieving this using tools like Postman and curl, I encountered consistent errors when trying to implement the same functionality using the provided Node.js example with the api package.
The primary issue is that regardless of the data I provided in the request body, I received errors indicating that the body was missing. This is perplexing since I ensured that the request body was formatted according to the documentation.
Upon closer investigation, I discovered that the issue lies within the api package's implementation, specifically in the prepareParams function located at https://github.com/readmeio/api/blob/main/packages/api/src/core/prepareParams.ts#L269. This function expects a schema entry with the type body. However, for the /token endpoint, the content type is set to application/x-www-form-urlencoded, resulting in the schema being generated with formData instead of body. Consequently, the body information is being removed from the request.
Interestingly, this problem seems to be isolated to the /token endpoint. Other endpoints function as expected, using the application/json content type and interacting well with the api package.
The text was updated successfully, but these errors were encountered:
I have been attempting to integrate with the Basiq API (v3) by following the documentation provided at https://api.basiq.io/reference/posttoken. My goal is to generate a new token. While I was successful in achieving this using tools like Postman and curl, I encountered consistent errors when trying to implement the same functionality using the provided Node.js example with the api package.
The primary issue is that regardless of the data I provided in the request body, I received errors indicating that the body was missing. This is perplexing since I ensured that the request body was formatted according to the documentation.
Upon closer investigation, I discovered that the issue lies within the api package's implementation, specifically in the prepareParams function located at https://github.com/readmeio/api/blob/main/packages/api/src/core/prepareParams.ts#L269. This function expects a schema entry with the type body. However, for the /token endpoint, the content type is set to application/x-www-form-urlencoded, resulting in the schema being generated with formData instead of body. Consequently, the body information is being removed from the request.
Interestingly, this problem seems to be isolated to the /token endpoint. Other endpoints function as expected, using the application/json content type and interacting well with the api package.
The text was updated successfully, but these errors were encountered: