1/ What is API? Here's A quick story: Developer A develops software A. Developer B is developing software B. One day, the developer B wants to call part of the function function of software A to use, but he does not want to see the source code and function realization process of software A from scratch, how to do? Developer A came up with A good idea: Developer A packaged the function needed by developer B in software A and wrote it as A function. R & D personnel B put this function in software B, can directly call the corresponding function! And the function that developer A packaged was the API and that's how the API was born.Copy the code

In daily life, we have many scenes similar to API, for example: the computer needs to call the information in the phone, at this time you will take a data line to connect the computer and phone, the interface connecting the data line on the computer and phone is equivalent to "API interface". As shown in the figure:Copy the code

2/ What is the SDK? SDK stands for Software Development Kit, which translates as Software Development Kit. This is a fairly broad term, so to speak: the documents, paradigms, and tools that aid in the development of a particular type of software can all be called SDKS. The SDK is developed to reduce the number of programmers work, made the wheels to avoid repetition Such as the company developed a software of a function, to encapsulate it into the SDK SDK is able to implement the data analysis functions such as data analysis of SDK), the company sold to another company for development, other companies if you want to give a certain function to the software development, But they didn't want to start from scratch, so they paid for it. 3/ Now it's time to talk about the difference between API and SDK. In general, there is no difference between the two, because they are related. You can imagine the SDK as a virtual package, in the package there is a good software functions This package is almost totally enclosed, only a small interface can be allied to the outside world, the interface is the API for example, we now want to add a feature in the enterprise ERP system (such as automatic backup, data analysis, cloud storage, etc.), But they didn't want to spend a lot of time and research doing it themselves. At this time, we can choose to use the "SDK" software package, connect the ERP system to the API interface of the SDK, and then use the functions in the SDK software package. Take an example to help understand: [China Railway Bridge Scientific Research Institute] has a self-developed information platform for business data management. However, they were faced with a problem -- although they had an information platform, they had to rely on manual operation in Excel because of the independence of the system and data uploading and backup, which was very inefficient. Due to the long development cycle and high cost of the system, BST focuses on the ready-made functional software. Later, the simplified cloud was directly inserted into the company's database through API, and the data could be automatically uploaded to the information platform and displayed uniformly. Then push the data to the server through Webhook to achieve automatic backup. The following figure shows the API connecting the information platform to the simple cloudCopy the code

In this process, Jiandao Cloud plays the role of SDK, and jiandao Cloud is equipped with API interface, which can connect with external systems, so that THE Bridge Institute of Science and Technology directly realizes the function of automatic data upload and backup without development. Finally, a little closer to life: There's a sealed drink called "SDK." The drink comes with a straw called API. Call you "the XX system." If you want to drink from the SDK (to make the system have the SDK functionality), you must do so through the API straw (to connect your system to the SDK kit via the API), otherwise you won't get the drink. So: SDK = software package with all the functions you want API = only interface on SDK do you really understand this time?Copy the code