harsh-harlequin
harsh-harlequin16mo ago

Failed to filter multiple parameters in GET API

Hi all, When I input ANY one single parameter, It works well and filter the result successfully. However, it always arise error when I give it multiple parameters. I am pretty sure it is not data structure problem. Thanks Regards
No description
No description
No description
No description
2 Replies
Tico | Voiceflow Assistant
To filter multiple parameters in a GET API request, you need to ensure that the parameters are correctly formatted and separated. Here’s a general approach to help you troubleshoot and resolve the issue: 1. Check Parameter Syntax: Ensure that each parameter is correctly formatted and separated by an ampersand (&). For example:
GET /api/documents?type=pdf&limit=10&page=2

GET /api/documents?type=pdf&limit=10&page=2

2. Verify Parameter Names: Make sure that the parameter names match exactly what the API expects. Even a small typo can cause the request to fail. 3. Encode Parameters: If your parameters include special characters, ensure they are URL-encoded. For example, spaces should be encoded as %20. 4. API Documentation: Refer to the API documentation to confirm the correct usage of multiple parameters. Here’s an example from the Voiceflow API documentation:
GET /v3alpha/knowledge-base/docs?documentType=url&limit=10&page=1

GET /v3alpha/knowledge-base/docs?documentType=url&limit=10&page=1

5. Example Request: Here’s an example of how to filter documents by type and limit the number of results per page:
GET /v3alpha/knowledge-base/docs?documentType=pdf&limit=10&page=1

GET /v3alpha/knowledge-base/docs?documentType=pdf&limit=10&page=1

6. Error Handling: If you encounter errors, check the error message returned by the API. It often provides clues about what went wrong. If you follow these steps and still encounter issues, it might be helpful to share the exact error message you are receiving for more specific troubleshooting. For more detailed information, you can refer to the Voiceflow API Documentation.
W. Williams (SFT)
You can't enter multiple filterByFormula params. You only enter it once and have to use the AND or OR operators.

Did you find this page helpful?