02-20-2023 03:34 AM
Hello,
I want to pull data with contains filter in /config/policies/ in netbackup api. but I am getting the following error. can you help me?
{ "errorCode": 9401, "errorMessage": "The OData filter criteria is invalid.", "attributeErrors": {}, "fileUploadErrors": [], "errorDetails": [ "The filter is invalid." ] }
Solved! Go to Solution.
02-21-2023 05:20 AM
Hello again,
I think I found the mistake I made while writing to you.
1- contains (filterName, 'x')
I noticed that I am getting an error because there is a space between contains and parenthesis. Thank you for your support.
02-20-2023 01:23 PM
Hi @ef_akyazan
The error is reasonably clear and the syntax for the API call is quite particular as to case etc. You will need to post the API call you actually make for us to be able to help (remove any auth information from what you post).
Have you looked at the OData syntax requirements - the link is provided on the getting started page http://docs.oasis-open.org/odata/odata/v4.01/csprd01/part2-url-conventions/odata-v4.01-csprd01-part2...
Happy to try and help, but I need more information (getting the API call correct can be a challenge as the documentation isn't always 100% accurate).
Also provide the NetBackup version you are using - as the calls have some variationbetween versions.
Cheers
David
02-20-2023 01:36 PM
Hi @ef_akyazan
Also - if you can perform a similar filter operation via the WebUI, you should be able to use Chrome's Dev tools screen (F12) on the page to view the Network payload etc for the calls you make (it has helped me in the past to get the API syntax correct).
David
02-21-2023 05:12 AM
Hello @davidmoline ,
Firstly, thank you for your reply. I checked the standards you mentioned. I tried the following way but it always showed the same error:
1- contains (filterName, 'x')
2-contains ('x, 'filterName )
3-keyword contains 'x'
4-contains keyword 'x'
Thanks.
02-21-2023 05:20 AM
Hello again,
I think I found the mistake I made while writing to you.
1- contains (filterName, 'x')
I noticed that I am getting an error because there is a space between contains and parenthesis. Thank you for your support.