-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Category
- Question
- Typo
- Bug
- Additional article idea
Expected or Desired Behavior
The SharePoint ALM APIs should follow generally accepted REST practices / OData protocols and at the very least, mirror what has already been adopted with existing SharePoint REST APIs.
I love the ALM APIs, but these inconsistencies are disappointing and frustrating. IMHO, it feels like a rogue team built these APIs without taking into account the established APIs that came before them... this will hurt adoption of the ALM APIs... many of the choices by engineering are confusing.
Observed Behavior
-
Inconsistencies when working with items in collections
to get a specific app, you use the endpoint
../_api/web/tenantappcatalog/AvailableApps/GetById('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx')- Feedback-1: Why have a
GetById()method? Existing SharePoint REST APIs use the pattern/collection(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx) - Feedback-2: When passing GUIDs, we've always had to specify the type... why the omission of the "guid" word... even using the current endpoint, it should be
../_api/web/tenantappcatalog/AvailableApps/GetById(guid'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx')to match what other endpoints use
- Feedback-1: Why have a
-
Presence of
X-RequestDigestWhy do we have to pass the
X-RequestDigestwhen doing certain operations when we are already authenticated and passing a valid access token?BTW, this isn't shown in the docs
-
HTTP Header
CONTENT-TYPErequires charsetEven though the docs don't show it, when you send data sometimes you have to specify the
CONTENT-TYPE... but simply passing in a valid OData 4 value such asapplication/json;odata=nometadatadoesn't work... it requires the extracharset=utf-8... WHY?BTW, this isn't shown in the docs
-
Inconsistencies when working properties on operators
In the case of adding a package to the app catalog, you specify if you want to overwrite it and the name of the file in the endpoint:
../_api/web/tenantappcatalog/Add(overwrite=true, url='test.txt').Yet, when you want to deploy, you use the endpoint
../_api/web/tenantappcatalog/Deploywhich has an option where you can skip feature deployment... however you don't specify that option like a method call asAdddoes... instead you have to pass it in as a JSON object as part of the body in the request. Why is this inconsistent?Please pick one... while I'd prefer submitting a JSON object in the body, I'll accept the way the
Addoperator does it, just be consistent. -
Non-Standard Header when Uploading Packages
When uploading a package using the
Addoperator, you tell the API that binary data is in the body, but not using the standardCONTENT-TYPE: multipart/form-dataoption when uploading data... you have to use the custom headerbinaryStringRequestBody:truethat doesn't even have theX_prefix to indicate it is custom. I get this has history with SharePoint APIs, but why not follow standards?