0

I am trying to get all the files created by a specific user using userid.

The below REST url is what I am trying:

https://mydomain.sharepoint.com/_api/files?$select=Title,CreatedBy&$expand=CreatedBy&$filter=CreatedBy/Id eq '10'

But I am getting the below error:

{
    "odata.error": {
        "code": "-1, System.NotSupportedException",
        "message": {
            "lang": "en-US",
            "value": "Specified method is not supported."
        }
    }

}

When I use only $select and $filter I get the expected result.

But when I use $expand I am getting the above error.

Any help would be appreciated.

2 Answers 2

0

The $expand columns must also be included in $select

Marc has a sample: http://sympmarc.com/2014/01/21/getting-user-information-with-the-sharepoint-2013-rest-api/

4
  • I tried this, _api/files?$select=Title,CreatedBy/Id&$expand=CreatedBy/Id&$filter=CreatedBy/Id eq '12' but still i am getting the same error
    – user31420
    Commented Jul 10, 2014 at 12:55
  • Try substituting CreatedBy with Author as this is the underlying field name.
    – GavinB
    Commented Jul 11, 2014 at 1:32
  • Which is exactly what Marc's sample shows... Commented Jul 11, 2014 at 15:48
  • The URLs in Marc's sample are based on User Information List( /_api/web/lists) but here I am working on _api/files
    – user31420
    Commented Jul 14, 2014 at 10:22
0

Finally I got the expected output using the below url.

https://mydomain.sharepoint.com/_vti_bin/ListData.svc/Documents?$select=CreatedById&$filter=CreatedById eq 12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.