PHP Apidoc Build Interface Documentation sample

Source: Internet
Author: User
Tags documentation json save file

API Generation Interface Documentation Example:

{

"Name": "September premium sharing activity Micro-communication Interface",

"Version": "1.0.0",

"description": "September Gift insurance receive share activity Micro-interface document (T=1)",

"Sampleurl": "http://www.phpernote.com/"

}

Save file Name: Apidoc.json

Apidoc-i The build directory of the project directory-O interface file to generate documents

The interface code file code is as follows:

<?php
/**
 * @api {post}/news/lists news information list
 * @apiVersion 1.0.0
 * @apiName lists
 * @apiGroup user
 * @apiPermission logged-in user
 *
 * @apiDescription The user logs on to the page and displays a list of news messages
 *
 * @apiSampleRequest/v1/news/lists
 *
 * @apiSuccess (return value) {string} ID primary key ID
& nbsp;* @apiSuccess (return value) {string} name Customer name
 * @apiSuccess (return value) {string} user_head_img client head
 * @apiSucc ESS (return value) {integer} sex Sex: 0-not set, 1-male, 2-female
 * @apiSuccess (return value) {string} Demand customer demand
 *
 * @apiSu Ccessexample {JSON} success example:
 * {"Code": 1, "MSG": "," Data ": {" id ":" 57b3cdb46b787 "," name ":" Yu Hao Miao "," user_head_img " : "Userhead/2016-08-18/1034587522576.jpg", "Sex": "1", "demand": "I want to buy insurance, please contact quickly!" "}}
 *
 * @apiErrorExample (JSON) Error Example:
 *     {" Code ":-1," MSG ":" Password Error " , "Data": {}}
 */

///////////////////////////////////////

/**
* @api {post}/news/rob Rob customers
* @apiVersion 1.0.0
* @apiName Rob
* @apiGroup User
* @apiPermission logged in user
*
* @apiDescription Rob Customers
*
* @apiParam {string} ID primary Key ID
*
* @apiSampleRequest/v1/news/rob
*
* @apiSuccessExample {JSON} success example:
* {"Code": 1, "MSG": "", "Data": {}}
*
* @apiErrorExample (JSON) Error Example:
* {"Code":-1, "MSG": "Error Message", "Data": {}}
*/

///////////////////////////////////////
More about Apidoc usage please refer to: http://apidocjs.com/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.