0

I have decided to create public APIs in my application. What is the best practice for that?

Let's say Github uses github.com to serve html pages and api.github.com for APIs.

  • Do both share same Backend code? (App has to render html pages and APIs has to send JSON response)
  • Are there two separate authentication modules for App and APIs?
  • How should I implement API versioning?

Thanks.

Jaynti Kanani
  • 557
  • 6
  • 23

1 Answers1

2

There is not a one size fits all for what you are asking. The way github does it may not be what you want to do. I recommend doing a lot of research on this subject before building your api as this will save you much time and headache.

Here are some good reads:

versioning:

Best practices for API versioning?

authentication

REST API Authentication

Again, you have to decide how your API will be built based on your consumers needs, your current application and skillset. It would be worth while to research how the big guys do it as well (facebook, google, stackoverflow, twitter)

Community
  • 1
  • 1
schmoopy
  • 6,419
  • 11
  • 54
  • 89