This Article directory: Interface specification interface Sample reference documentation
Recently, in the collation and development of Tpshop Open Source Mall app (including Android and iOS) background interface (API), summed up.
1. Interface Specification
The URL for an interface is generally:
Official website domain name/index.php?m=api&c= Controller &a= method
The return data type is in JSON format, in the form:
{
"status": 1,
"msg": "Get Success",
"result": "Data Sample"
}
Where the "status" and "MSG" fields are generally fixed.
"Status" is normally 1, and other values are not normal or error. The word "MSG" describes the results.
"Result" is typically the dataset returned by the Get method.
Description
M=api is actually a module in the thinkphp framework called the API, and other common modules are home and mobile, the corresponding PC and mobile version of the web,admin and seller corresponding administrator background and sales management backstage.
Methods are generally named in lowercase + underscores, and some still retain the hump-style naming for historical reasons.
2. Interface Example
As follows:
Main reference documents:
Tpshop Mobile API Manual
-end-