#odata 14 articles
POST /views takes an SP.View body — ViewTypeKind fails, and @odata.type passes only under OData v4 gotchas / rest-api ViewTypeKind from the creation-information docs 400s, and an @odata.type annotation passes only with OData-Version: 4.0; measured recipe for view + scope + column order $filter on /groups/{id}/members needs $count=true, not just ConsistencyLevel gotchas / graph The header is only half the recipe; a permanently failing call hid behind a best-effort catch as a "temporary outage" A $filter literal encoded twice finds nothing — with a 200 gotchas / rest-api If a helper already percent-encodes the quoted literal, wrapping the whole $filter in encodeURIComponent encodes the value a second time (/ → %252F, @ → %2540); SharePoint then compares against the escaped text and… A field you write is never read back — $select is an allowlist and a ?? fallback hides the gap gotchas / rest-api $select is an allowlist; a snapshot ?? live fallback silently erases the feature the snapshot exists for An unencoded # in a $filter value cuts the URL — SharePoint gets half a query and answers 400 gotchas / rest-api The browser drops everything after # as a fragment, SharePoint gets an unterminated literal and answers 400; guest UPNs (#EXT#) always hit it; & cuts the expression and a raw + arrives as a space, so a valid literal… Calling SharePoint REST like a pro guides The client landscape, headers that matter, safe writes, reading well, field/list creation quirks, and a ten-minute diagnosis routine directoryObject collections reject $select of user fields — and $top is a separate, per-endpoint trap gotchas / graph User fields on /members//transitiveMembers = 400; OData cast cures $select everywhere, $top stays per-endpoint (probe both) Drop __metadata from write bodies — odata=verbose needs OData v3, and SPHttpClient sends v4 gotchas / rest-api Old-tutorial payloads 400 as plain JSON, and switching to odata=verbose 400s again under SPHttpClient, which sends odata-version: 4.0; write plain JSON without the type hint, or blank odata-version where the verbose… encodeURIComponent won't save you from apostrophes in OData literals gotchas / rest-api encodeURIComponent leaves ' alone; double it File upload via /Files/add: nometadata works under OData v4 — an empty OData-Version breaks SPFx when you leave out Content-Type gotchas / rest-api nometadata + octet-stream under the default OData v4; an empty OData-Version without Content-Type throws inside SPHttpClient; plus the empty-filename mobile camera trap FirstUniqueAncestorSecurableObject has no type in odata=nometadata — tell web, list and item apart by the shape of the answer gotchas / permissions The endpoint returns a web, a list or a list item depending on where inheritance breaks, and with odata=nometadata nothing names the type; classify by properties (FileSystemObjectType = item, BaseTemplate = list… Microsoft To Do rejects $select on lists and tasks — 400 invalidRequest (RequestBroker--ParseUri) gotchas / graph Since Oct 2026 /me/todo/lists and /tasks return 400 for any $select except id; drop $select, keep $top/$filter, and measure 400s call by call before trusting a docs-based theory Per-user data vanishes for admin accounts: pageContext.user.email is empty and eq '' matches nothing gotchas / spfx Mailbox-less accounts get an empty pageContext.user.email; rows save under an empty key, SharePoint stores empty text as NULL, and $filter=Field eq '' never matches it again The Microsoft Graph JS client sends $filter values unencoded — & splits the query, # cuts it off gotchas / graph .filter(), .query() and .api('…?…') pass the value into the URL as-is (SDK 3.0.2, also under SPFx MSGraphClientV3): # cuts the query, & splits it and .api() even moves $top into the filter; double apostrophes, then…