Sort records from API Call

The documentation shows the ‘o’ parameter in the API call to order multiple resources records (http://documentation.bonitasoft.com/?page=rest-api-overview&hash=resource_search).

Is this overruled by the Ordered By part of the BDM’s query? Or perhaps I just have the syntax wrong?

Here are some of the API calls I’ve tried:
http://localhost:8080/bonita/API/bdm/businessData/com.gft.model.BuildList?q=findByUserId&p=0&c=100&o=Order_ID%20DESC&f=userId=33

http://localhost:8080/bonita/API/bdm/businessData/com.gft.model.BuildList?q=findByUserId&p=0&c=100&o=Order_ID&f=userId=33

http://localhost:8080/bonita/API/bdm/businessData/com.gft.model.BuildList?q=findAll&p=0&c=100&o=Order_ID%20DESC

The findAll query is a custom one I created that doesn’t have any ordered by section.

Thanks for your help!

You forgot to encode the “order part”.
As the documentation says:
o: order of presentation of values in response: must be either attributeName ASC or attributeName DESC. The final order parameter value must be URL encoded. The order attributeNames are the same as those you get in the object representation returned in the response.

So in your case it should be probably …&o=Order_ID%20DESC…

EDIT:
I’m not sure if you did or did not encode the order part in url as it is cutted in your post, I’ve dig a little deeper. BDS API documentation doesn’t say anything about order parameter, so probably you will have to write your own BDS query and different API method (see "Call a business data named query: part in documentation )

Best regards,
bpms.help

Thank you for the help. I tried it both ways (encoded and with just a space; and it encoded it for me when I just used the space). Regardless, the order of the values did not change.

I’ll try a new query. Thanks!