Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 1.03 KB

README.md

File metadata and controls

19 lines (15 loc) · 1.03 KB

Pol.is API Proxy

This app proxies API calls in order to experiment with alternative API design choices.

These alternatives include:

  • CORS support as required by Swagger dynamic docs.
  • Token authentication (ie headers) rather than BasicAuth.
    • Before: curl $BASE_URL/api/v3/conversations?conversation_id=5mnfxu85hx -u xxxxxxxx:
    • After: curl $BASE_URL/api/v3/conversations?conversation_id=5mnfxu85hx -H Authorization:xxxxxxxx
  • Primary resource ID in path param rather than query param.
    • Before: curl $BASE_URL/api/v3/conversations?conversation_id=5mnfxu85hx -H Authorization:xxxxxxxx
    • After: curl $BASE_URL/api/v3/conversations/5mnfxu85hx -H Authorization:xxxxxxxx
  • Sub-resource rather than top-level resources.
    • Before: curl $BASE_URL/api/v3/participants?conversation_id=5mnfxu85hx -H Authorization:xxxxxxxx
    • After: curl $BASE_URL/api/v3/conversations/5mnfxu85hx/participants -H Authorization:xxxxxxxx