这里会显示出您选择的修订版和当前版本之间的差别。
上一修订版 Both sides next revision | |||
story_single_get [2014/12/11 15:10] 112.25.156.122 创建 |
story_single_get [2014/12/11 15:13] 112.25.156.122 |
||
---|---|---|---|
行 3: | 行 3: | ||
===== 故事读取接口(单篇故事) ===== | ===== 故事读取接口(单篇故事) ===== | ||
- | ==== 1、故事读取接口(所有用户上传的故事) ==== | + | ==== 1、故事读取接口(单篇故事,客户端调用) ==== |
''https://m.repai.com/story/story_single_get_api/story_id/162/appkey/100002/appoid/test?access_token=rpat_47be0653fe75e8ae3f3d4fa5de931c24'' | ''https://m.repai.com/story/story_single_get_api/story_id/162/appkey/100002/appoid/test?access_token=rpat_47be0653fe75e8ae3f3d4fa5de931c24'' | ||
行 185: | 行 185: | ||
---- | ---- | ||
+ | |||
+ | ==== 2、故事读取接口(单篇故事,PHP内部引用调用接口) ==== | ||
+ | |||
+ | <?php | ||
+ | require_once("/Data/webapps/m.repai.com/m/phpapi.php"); //PHP引用方式,需要引用的框架入口文件 | ||
+ | $result = phpapi_mvc("story", "story_single_get_phpapi", array("story_id" => "162")); | ||
+ | if (empty($result["error"])) { | ||
+ | var_dump($result); //打印出返回内容,此处输出为PHP数组,格式与客户端调用接口输出的JSON数组json_decode后的内容一样 | ||
+ | } else { | ||
+ | var_dump($result["error"]); //打印出错误内容 | ||
+ | } | ||
+ | ?> | ||
[[start|返回首页]] | [[start|返回首页]] |