Tech C**P
14 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
For REST APIs it usually happens to encode client-id and client-secret to send to an endpoint to get access token.
It has been said in API documentation that send data like below:
Basic BASE64_ENCODEDED_VALUE_OF(CLIENT_ID:CLIENT_SECRET)

There is an online tool for exactly that specific purpose (encode, decode base64).

Go to link below:
- https://www.base64encode.org/

#base64 #base64encode #client_id #client_secret #api #rest #webservice
One of the methods to document your API is APIDOC. It uses annotation in variety of languages like Python, PHP, JS, etc. At the below code block you can see an example in Python:

"""
@api {get} /user/:id Request User information
@apiName GetUser
@apiGroup User

@apiParam {Number} id Users unique ID.

@apiSuccess {String} firstname Firstname of the User.
@apiSuccess {String} lastname Lastname of the User.
"""


To read more about the APIDOC itself and the installation process head over to link below:

- http://apidocjs.com/

#javascript #js #python #apidoc #apidocjs #api #documentation #rest #annotation