Empty return for GET /api/v1/group/search RESTAPI

Hi,

I'd like to use the GET /api/v1/group/search RESTAPI When I do this call, it does return success but without no entry.

example using the Nuxeo playground:

http://nuxeo.github.io/api-playground/#/resources/group/1/GET

I try - as it is advised - “Admin” as the query. It results success (status=200) but with an empty list of entries.

Can you help?

Thanks Christian

0 votes

0 answers

1235 views

ANSWER

Hi, What is your full request? What headers did you pass?
09/08/2015

Hi,

these calls work for me in order to retrieve group information:

curl -X GET 'http://nuxeo/nuxeo/api/v1//group/search?q=administrators' -u Administrator:** -H 'Nuxeo-Transaction-Timeout: 8' -H 'X-NXDocumentProperties: ' -H 'X-NXRepository: default' -H 'Accept: /'

{"entity-type":"groups","isPaginable":true,"resultsCount":1,"pageSize":50,"maxPageSize":1000,"currentPageSize":1,"currentPageIndex":0,"numberOfPages":1,"isPreviousPageAvailable":false,"isNextPageAvailable":false,"isLastPageAvailable":false,"isSortable":false,"hasError":false,"errorMessage":null,"pageIndex":0,"pageCount":1,"entries":[{"entity-type":"group","groupname":"administrators","grouplabel":"Administrators group","memberUsers":["Administrator","***"],"memberGroups":[]}]}

curl -X GET 'http://NUXEO/nuxeo/api/v1//group/administrators' -u Administrator: -H 'Nuxeo-Transaction-Timeout: 8' -H 'X-NXDocumentProperties: ' -H 'X-NXRepository: default' -H 'Accept: /' {"entity-type":"group","groupname":"administrators","grouplabel":"Administrators group","memberUsers":["Administrator","*"],"memberGroups":[]}

So, as stated above, it might be an issue with the headers.

The strange thing though is, that searching for the "administrators" group does not work on the API playground, while the get group case does.

curl -X GET 'http://demo.nuxeo.com/nuxeo/api/v1//group/search?q=administrators' -H 'Accept: /' -H 'Authorization: Basic QWRtaW5pc3RyYXRvcjpBZG1pbmlzdHJhdG9y' -H 'Nuxeo-Transaction-Timeout: 8' -H 'X-NXDocumentProperties: *' -H 'X-NXRepository: default' -H 'content-type: application/json'

{ "entity-type": "groups", "isPaginable": true, "resultsCount": 0, "pageSize": 50, "maxPageSize": 1000, "currentPageSize": 0, "currentPageIndex": 0, "numberOfPages": 1, "isPreviousPageAvailable": false, "isNextPageAvailable": false, "isLastPageAvailable": false, "isSortable": false, "hasError": false, "errorMessage": null, "pageIndex": 0, "pageCount": 1, "entries": [] }

curl -X GET 'http://demo.nuxeo.com/nuxeo/api/v1//group/administrators?' -H 'Accept: /' -H 'Authorization: Basic QWRtaW5pc3RyYXRvcjpBZG1pbmlzdHJhdG9y' -H 'Nuxeo-Transaction-Timeout: 8' -H 'X-NXDocumentProperties: *' -H 'X-NXRepository: default' -H 'content-type: application/json'

{ "entity-type": "group", "groupname": "administrators", "grouplabel": "Administrators group", "memberUsers": [

"Administrator"

], "memberGroups": [] }

Best

Stefan

09/09/2015

Hi

OK things work now both using curl or coded in python. But it does not in the playground !!! Regards Christian

09/10/2015