Get items from SharePoint List (Model Usage) via SharePoint Rest API (GetItems)

%3CLINGO-SUB%20id%3D%22lingo-sub-2006513%22%20slang%3D%22en-US%22%3EGet%20items%20from%20SharePoint%20List%20(Model%20Usage)%20via%20SharePoint%20Rest%20API%20(GetItems)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2006513%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20Support%2C%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EI%20have%20a%20question%20about%20a%20SharePoint%20list%20%22Model%20Usage%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3CBR%20%2F%3EHere%20are%20my%20questions%3A%3CBR%20%2F%3E1.%20For%20the%20list%20%22Model%20Usage%22%2C%20is%20there%20any%20internal%20issue%20(Sharepoint%20side)%20when%20getting%20the%20items%20via%20SharePoint%20API%3F%20I%20found%20that%20the%20behaviour%20is%20not%20the%20same%20as%20other%20list.%26nbsp%3B%3CBR%20%2F%3E2.%20Can%20you%20suggest%20a%20correct%20way%20to%20get%20the%20items%20from%20this%20%22Model%20Usage%22%20list%20via%20SharePoint%20API%20(GetItems)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20to%20get%20the%20items%20from%20the%20list%20%22Model%20Usage%22%2C%20I%20found%20that%20the%20server%20side%20will%20return%20the%20following%20error%2C%20but%20it's%20normal%20(no%20error)%20for%20other%20list.%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22odata.error%22%3C%2FSPAN%3E%3CSPAN%3E%3A%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22code%22%3C%2FSPAN%3E%3CSPAN%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22-2147024809%2C%26nbsp%3BSystem.ArgumentException%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22message%22%3C%2FSPAN%3E%3CSPAN%3E%3A%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22lang%22%3C%2FSPAN%3E%3CSPAN%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22en-US%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22value%22%3C%2FSPAN%3E%3CSPAN%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22%7B0078DB11-41BB-40C5-B647-18834694F4C2%7D%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3EHere's%20my%20request%20message%3A%3CBR%20%2F%3E-----%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2F%7Btanent_name%7D.sharepoint.com%2Fsites%2Ftrailaddress%2F_api%2Fweb%2Flists('2aa87e02-0df5-44dd-8e42-cfe88aed2dc0')%2FGetItems%3F%24expand%3DFieldValuesAsText%2CFile%2CFile%252fProperties%26amp%3B%24select%3DFileSystemObjectType%2CId%2CFileRef%2CFileLeafRef%2CModified%2CHTML_x0020_File_x0020_Type%2CTitle%2CGUID%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2F%7Btanent_name%7D.sharepoint.com%2Fsites%2Ftrailaddress%2F_api%2Fweb%2Flists('2aa87e02-0df5-44dd-8e42-cfe88aed2dc0')%2FGetItems%3F%24expand%3DFieldValuesAsText%2CFile%2CFile%252fProperties%26amp%3B%24select%3DFileSystemObjectType%2CId%2CFileRef%2CFileLeafRef%2CModified%2CHTML_x0020_File_x0020_Type%2CTitle%2CGUID%3C%2FA%3E%3CBR%20%2F%3E-----%3CBR%20%2F%3E%3CBR%20%2F%3EHere's%20my%20CAML%20query%20in%20the%20request%20body%3CBR%20%2F%3E-----%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3E%7B%22query%22%3A%7B%22ViewXml%22%3A%22%3C%2FSPAN%3E%3CSPAN%3E%26lt%3B%3C%2FSPAN%3E%3CSPAN%3EView%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EScope%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3D%3C%2FSPAN%3E%3CSPAN%3E'RecursiveAll'%26gt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%3EQuery%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%3EWhere%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%3EEq%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%3EFieldRef%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EName%3C%2FSPAN%3E%3CSPAN%3E%3D%5C%22%3C%2FSPAN%3E%3CSPAN%3EFileDirRef%3C%2FSPAN%3E%3CSPAN%3E%5C%22%5C%3C%2FSPAN%3E%3CSPAN%3E%2F%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%3EValue%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EType%3C%2FSPAN%3E%3CSPAN%3E%3D%5C%22%3C%2FSPAN%3E%3CSPAN%3ELookup%3C%2FSPAN%3E%3CSPAN%3E%5C%22%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%3C%2FSPAN%3E%3CSPAN%3E%5C%2Fsites%5C%2Ftrailaddress%5C%2FModelUsage%26lt%3B%5C%2FValue%26gt%3B%26lt%3B%5C%2FEq%26gt%3B%26lt%3B%5C%2FWhere%26gt%3B%26lt%3B%5C%2FQuery%26gt%3B%26lt%3B%5C%2FView%26gt%3B%22%2C%22__metadata%22%3A%7B%22type%22%3A%22SP.CamlQuery%22%7D%7D%7D%3CBR%20%2F%3E%3C%2FSPAN%3E-----%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%3CSPAN%3E%3CBR%20%2F%3E%3D%3D%3D%3CBR%20%2F%3EIn%20fact%2C%20I%20tried%20another%20test%20with%20%22items%22%20API.%20The%26nbsp%3Bbehaviour%20is%20also%26nbsp%3Bstrange.%20Here's%20the%20request%20and%20the%20response%20message.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ERequest%3A%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fahsay.sharepoint.com%2Fsites%2Ftrailaddress%2F_api%2Fweb%2Flists('2aa87e02-0df5-44dd-8e42-cfe88aed2dc0')%2Fitems%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2F%7Btanent_name%7D.sharepoint.com%2Fsites%2Ftrailaddress%2F_api%2Fweb%2Flists('2aa87e02-0df5-44dd-8e42-cfe88aed2dc0')%2Fitems%26nbsp%3B%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EResponse%3A%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22odata.error%22%3C%2FSPAN%3E%3CSPAN%3E%3A%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22code%22%3C%2FSPAN%3E%3CSPAN%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22-2147467259%2C%26nbsp%3BMicrosoft.SharePoint.SPException%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22message%22%3C%2FSPAN%3E%3CSPAN%3E%3A%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22lang%22%3C%2FSPAN%3E%3CSPAN%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22en-US%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22value%22%3C%2FSPAN%3E%3CSPAN%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22Cannot%26nbsp%3Bcomplete%26nbsp%3Bthis%26nbsp%3Baction.%5Cn%5CnPlease%26nbsp%3Btry%26nbsp%3Bagain.%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2006513%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPIs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Dear Support,


I have a question about a SharePoint list "Model Usage".

 

=============
Here are my questions:
1. For the list "Model Usage", is there any internal issue (Sharepoint side) when getting the items via SharePoint API? I found that the behaviour is not the same as other list. 
2. Can you suggest a correct way to get the items from this "Model Usage" list via SharePoint API (GetItems)

=============

 

I tried to get the items from the list "Model Usage", I found that the server side will return the following error, but it's normal (no error) for other list.

{
    "odata.error": {
        "code""-2147024809, System.ArgumentException",
        "message": {
            "lang""en-US",
            "value""{0078DB11-41BB-40C5-B647-18834694F4C2}"
        }
    }
}



Here's my request message:
-----

https://{tanent_name}.sharepoint.com/sites/trailaddress/_api/web/lists('2aa87e02-0df5-44dd-8e42-cfe8...
-----

Here's my CAML query in the request body
-----

{"query":{"ViewXml":"<View Scope ='RecursiveAll'><Query><Where><Eq><FieldRef Name=\"FileDirRef\"\/><Value Type=\"Lookup\">\/sites\/trailaddress\/ModelUsage<\/Value><\/Eq><\/Where><\/Query><\/View>","__metadata":{"type":"SP.CamlQuery"}}}
-----


===
In fact, I tried another test with "items" API. The behaviour is also strange. Here's the request and the response message.

Request: 

https://{tanent_name}.sharepoint.com/sites/trailaddress/_api/web/lists('2aa87e02-0df5-44dd-8e42-cfe8...

Response:

{
    "odata.error": {
        "code""-2147467259, Microsoft.SharePoint.SPException",
        "message": {
            "lang""en-US",
            "value""Cannot complete this action.\n\nPlease try again."
        }
    }
}

 








0 Replies