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
In designing API SDKs and documentation it is really annoying to put a whole lot of time to design the documentation and/or designing SDKs in different languages! How do you create SDKs for C#, python, Go, .NET, etc when you are limited in resources? IT world has gone so far, that creation of SDKs for the API or creation of documentation (with great web UI) have been made automatic. No one need to interfere in between.

As well as other programs or languages it needs some specification that all needs to follow. OpenAPI is the thing!

What is OpenAPI?
The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined, a consumer can understand and interact with the remote service with a minimal amount of implementation logic.

One of the great editors for designing the spec is swagger live editor:
- https://editor.swagger.io/

The full open specification of OpenAPI 3.0:
- https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md

I should again note that this is a wonderful spec and makes your life easier if you master the specification. A sample documentation of OpenAPI is Alopayk:
- https://docs.alopeyk.com/

#openapi #swagger #spec #restful #api #alopayk
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