Wednesday, September 26, 2018

API convention to follow while wrting API.

API Convention
While creating API and providing it to the user please take care of following.
  1. Create or Update the documentation for the API.
  2. While adding new API documentation make sure it covers the following. 
    1. Request URL. Ex.  https://api.abc.com/admin
    2. Method: (get/post/put/delete/patch)
    3. Input parameters Ex.  {'firstname': firstname, 'lastname': lastname, 'email': email,  'password' : password}
    4. Encoding details if application. For ex. for few APIs the input parameters are URL encoded.
    5. API response. This could be pasted in the same page if not too big. Else can be posted in the form of jsonblob url (https://jsonblob.com/).
  3. Please consider the API development as completed only once the API is documented with above details in respective technical documentation
  4. For live products you should use api.domain.com .

No comments: