REST API - Search a resource
Hi,
i'm having problems with the search function.
If i search a process with two conditions, the second it's not applied.
For example, if i find by version like this it's works:
http://localhost:8080/bonita/API/bpm/process?p=0&c=10&s=version%202
Or if i find by name like this it's works:
http://localhost:8080/bonita/API/bpm/process?p=0&c=10&s=name%20ClickAgre...
But if find by version and name like this, the second condition not applies:
http://localhost:8080/bonita/API/bpm/process?p=0&c=10&s=version%202&s=na...
Can help me with the sintaxis or somebody knows why it doesn't work?
Thanks
Hi,
I think according to the documentation that only one parameter can be used in the Search option.
Cheers
Hi josemaria.arbesu!
Have you tried your URL without the encode you put for "=" (%20)?
Can you try the URL like this:
http://localhost:8080/bonita/API/bpm/process?p=0&c=10&s=version=2&s=name...
?
Cheers,
Marcos Vinícius Pinto
Comments
Thanks, Marcos!
Yes, and it's not working.
I use postman to make the test. If i use a browser, iExplorer, for example, i got an empty json with the single filters (http://localhost:8080/bonita/API/bpm/process?p=0&c=10&s=version%202)
Yes, in postman (and iExplorer) the json comes filled when i try the single filters:
http://localhost:8080/bonita/API/bpm/process?p=0&c=10&s=version%202 or
http://localhost:8080/bonita/API/bpm/process?p=0&c=10&s=name%20ClickAgre...
When i try the multiple filter, the json is exactly the same as the single query. Doesn't apply the second filter.
The json of
http://localhost:8080/bonita/API/bpm/process?p=0&c=10&s=version%202
is equal as the json of
http://localhost:8080/bonita/API/bpm/process?p=0&c=10&s=version%202&s=na...
Thanks!
Thanks, Marcos!
I'm using the 7.4.1 version.
Cheers
Comments
May be, altought there is no clear indication about if it suports more than one search parameter. Only one example, and it's using just one 's' parameter.
Look in the documentation, on this link, section "Search for a resource"
http://documentation.bonitasoft.com/?page=rest-api-overview
Cheers,
Marcos Vinícius Pinto
Yeah I agree it could be clearer. That being said, in the documentation, only the options filter (f=) can be multiple and therefore shown multiple in the example: http://.../API/{API_name}/{resource_name}?p={page}&c={count}&o={order}&s={query}&f={filter_name}={filter_value}&f=...
Yes! The documentation is very faulty, something that I haver veem saying to Bonitasoft since aí started using its software four years ago.
Thanks,
I saw it in some example on the internet. The use of more than one "s" filter.
I got it! :-D
I have tried different combinations with "s" and "f" filters. I was confused that for the "s" filter, the scape character is %20 or " " and for the "f" filter the scape character is %3d or =
The correct combination is:
http://localhost:8080/bonita/API/bpm/process?p=0&c=10&s=name ClickAgreemen&f=activationState=Enabled
or
http://localhost:8080/bonita/API/bpm/process?p=0&c=10&s=name%20ClickAgre...
Thank you all
Cheers
Great, josemaria.arbesu!
Glad It worked to you.
Cheers,
Marcos Vinícius Pinto