Current location - Quotes Website - Signature design - What is an interface document, how to write an interface, and what are the specifications?
What is an interface document, how to write an interface, and what are the specifications?

First of all, there must be a document title, XXX interface document, description of the current document, production date of the document, and company name, etc. Now start writing a dubbo interface document, define the title, and date, the company is omitted here. Edit online using Confluence, which provides a collaborative environment for your team. Team members work collaboratively to write documentation and manage projects. Since then, Confluence has broken the deadlock of information islands between different teams, departments and individuals, and realized the ultimate sharing of resources.

The next step is to have the version revision information of the current document, which is the historical revision information. It should include basic information: version number, revision date, revision person, revision description, etc.

Start writing the directory structure of the document, pay attention to the use of major titles and subtitles, and require reasonable usage instructions. The first is of course the document description, then some preparation information and process information, then the interface description, and finally there can be examples, FAQs, precautions, response code descriptions, etc.

The following will start with a detailed introduction one by one according to the directory structure of the document, such as the introduction of the document description. Use efficient and concise language to clearly explain the document information. Note that the large titles in the document should have the same font size and style, and the small titles should have the same font size and style. Titles should also be consistent in font size.

A brief explanation of the acquisition and preparation of technical data. It is more important to confirm the calling system information. It is necessary to confirm the encoding format to prevent garbled characters and confirm whether the current document version is the version to be used. Otherwise, the work will be in vain. The project Just a simple explanation of how to set up the environment.

Start to explain the calling process of the interface, how to call the interface, some preparations required, introduction of corresponding dependencies and configuration files that need to be configured.

Now you can start the description of the interface. The description information of the interface should include the name of the interface, the address of the interface, the protocol of the interface, and then describe the methods under the current interface.

The description of the method should include a description of the method, that is, its function, a description of the request parameters of the method, and a description of the response parameters. The parameter description should include the type of the parameter, the name of the parameter, the meaning of the parameter, and the parameter remarks. Whether it must be passed.

9

After the interface is explained, it is at the end of the document. If there are any precautions, add some notes, or appendix descriptions, and add notes.

The interface document is generally an instruction document or API provided to merchants for reference and help when docking.

It contains explanations such as excuse description, interface list, interface parameter list, signature/signature verification rules, merchant response rules, etc. Generally, security must be considered first for interfaces. For payment signatures, please refer to the interface documents of Alipay and WeChat Pay. Business The signature of the class can refer to the interface API of the WeChat public platform; signing is to assemble the parameters according to the rules according to the merchant number, business parameters, random string or timestamp, merchant key/public key and private key, etc., and then generate a signature according to a signature rule , to ensure the security of the interface;