The pipedream error I keep getting is Expected ',' or '}' after property value in JSON at position 125
When testing the code above with out the &custom_fields=${field_payload} parameter, the API request works fine.In Postman & with cURL, the API call works fine.
Does anyone have any input on resolving this error message? Again, see screen recording above for visuals.
Can you double check that the custom_fields query param accepts JSON? That seems like a non-standard implementation. Usually JSON is accepted as part of the body of a POST request
Thanks for the insight! I’ve revised the code to use the package directly instead. I do not receive the error any longer, so thank you!
At the moment, I’m wrestling with a timeout error produced from using **import** axios **from** "axios"; as opposed to the original means above.
Do you happen to know why my call is consistently timing out after this change? There is no issue making the API call via Postman with axios or via cURL. The server is sound.
, I figured out the original way of doing it. encodeURIComponent() is needed around the JSON object, as the Axios wrapper pipedream uses decodeURIComponent to clean up the URL query params.
Can you please share how you came to this conclusion? Obviously, I need to RTFM about encodeURIComponent , but I’m dying to know how you realized this.
https://github.com/PipedreamHQ/pipedream/blob/master/platform/lib/axios.ts#L16…L38
This is the axios wrapper for pipedream and the highlighted lines is the function which caused the error as it needed the query parameters to be in this format field_id=99ae89a6-cfff-4729-aae1-620b9ef3dc25&operator==&value=86b010jfwso it can turn it into a json object and put into the params object array but it got a json object already. Lines 25 to 29 is where it would always fail as it was given a JSON object and not a string as it requires causing an error.