Daniel Fawcett
Member
I am creating a custom app for an API in PC. With the API I am calling, I can add many optional query parameters to different endpoints. The issue I have is that when a parameter is defined, it seems that PC adds it to the http request whether there is data in the parameter or not.
I have tried adding in null and {{skip}} on the default value on the apps backend and also in the front end but the API will not accept the call as there is no data in the parameter. This API works by having any optional parameters NOT in the request.
Is there a way to have a parameter defined in the backend, but if left blank on the front end / no data is entered then it is NOT sent in the API request?
In the images attached, the name field is an optional query parameter. If you want to add to the request then you must add data else you receive an error response, if you do not want to enter a name then the parameter must NOT be in request, it cannot be left blank or null etc. There are other parameters where I need this but this is the simplest parameter to explain as it is just a text field.
I have tried adding in null and {{skip}} on the default value on the apps backend and also in the front end but the API will not accept the call as there is no data in the parameter. This API works by having any optional parameters NOT in the request.
Is there a way to have a parameter defined in the backend, but if left blank on the front end / no data is entered then it is NOT sent in the API request?
In the images attached, the name field is an optional query parameter. If you want to add to the request then you must add data else you receive an error response, if you do not want to enter a name then the parameter must NOT be in request, it cannot be left blank or null etc. There are other parameters where I need this but this is the simplest parameter to explain as it is just a text field.
Attachments
-
Screenshot 2022-02-13 at 14.23.19.png98 KB · Views: 108
-
Screenshot 2022-02-13 at 14.23.31.png235.6 KB · Views: 127
-
Screenshot 2022-02-13 at 14.27.28.png187 KB · Views: 106
-
273503200_669622631048627_7581697573847380884_n.png38.1 KB · Views: 108
-
273675044_5004536149604741_1710394753538844481_n.png159.8 KB · Views: 119