docs-v2 icon indicating copy to clipboard operation
docs-v2 copied to clipboard

Describe our different magic parameters

Open danielbachhuber opened this issue 10 years ago • 3 comments

_embed et all deserve some special mention.

danielbachhuber avatar May 02 '15 01:05 danielbachhuber

Others: envelope (will envelope the response headers and status into an object, because some clients don't interpret response headers or status), context sort of (should probably have been an underscore thing, per Daniel), _method

kadamwhite avatar Sep 09 '16 21:09 kadamwhite

Context around context (har): per WP-API/WP-API#2634,

  • Auth controls what you can access
  • Context controls what fields things have when you access them
  • Query parameters control what's included in a collection This will be captured in a docs repo issue to make that handling explicit, and to explain how to handle this case.

This should help clarify the purpose of context, and we should also provide explicit examples of how to query for all protected statuses (as you would commonly do in the admin) since that will not make use of context

kadamwhite avatar Sep 22 '16 14:09 kadamwhite

Note: context is not a magic parameter, just a strong convention in the API. Magic parameters start with _ are relate to the routing/infrastructure layer of the API, and those were documented in 50c22d4abffb57b7dba1720393c60b4e6f4e38d8

rmccue avatar Sep 22 '16 14:09 rmccue