Sort records from API Call

1
0
-1

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

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.BuildLis...
http://localhost:8080/bonita/API/bdm/businessData/com.gft.model.BuildLis...
http://localhost:8080/bonita/API/bdm/businessData/com.gft.model.BuildLis...

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

Thanks for your help!

1 answer

1
0
-1

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

Comments

Submitted by cmyers on Wed, 10/12/2016 - 01:38

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!

Notifications