{"id":32486,"date":"2023-03-08T16:31:06","date_gmt":"2023-03-08T15:31:06","guid":{"rendered":"https:\/\/mimolive.com\/?post_type=user-manual&#038;p=32486"},"modified":"2024-10-08T09:55:45","modified_gmt":"2024-10-08T07:55:45","slug":"http-api","status":"publish","type":"user-manual","link":"https:\/\/mimolive.com\/zh\/user-manual\/remote-control-automation\/http-api\/","title":{"rendered":"HTTP API"},"content":{"rendered":"<p>\u4e00\u65b9\u9762\uff0cmimoLive\u53d1\u5e03\u4e86\u4e00\u4e2a <a href=\"https:\/\/mimolive.com\/zh\/%e7%94%a8%e6%88%b7%e6%89%8b%e5%86%8c\/%e9%81%a5%e6%8e%a7%e8%a1%a8%e9%9d%a2\/\">\u8fdc\u7a0b\u63a7\u5236\u7528\u6237\u754c\u9762<\/a> \u4f60\u53ef\u4ee5\u7528\u5b83\u6765\u521b\u5efa\u81ea\u5b9a\u4e49\u7684\u7528\u6237\u754c\u9762\uff0c\u4f60\u53ef\u4ee5\u5728\u5e73\u677f\u7535\u8111\u6216\u7c7b\u4f3c\u8bbe\u5907\u4e0a\u4f7f\u7528\uff0c\u4ee5\u8fdc\u7a0b\u63a7\u5236mimoLive\u3002<\/p>\n\n\n\n<p>\u6b64\u5916\uff0cmimoLive\u63d0\u4f9b\u8bbf\u95ee\u88f8\u9732\u7684 <span class=\"caps\">HTTP<\/span> <span class=\"caps\">API<\/span> \u6240\u4ee5\u4f60\u53ef\u4ee5\u521b\u5efa\u81ea\u5b9a\u4e49\u811a\u672c\uff08\u901a\u8fc7 <strong>bash<\/strong> \u548c <strong>\u5377\u66f2<\/strong>, <strong>\u860b\u679c\u65e5\u5831<\/strong>\uff0c\u5185\u7f6e <a href=\"https:\/\/mimolive.com\/zh\/%e7%94%a8%e6%88%b7%e6%89%8b%e5%86%8c\/%e8%87%aa%e5%8a%a8%e5%8c%96\/\">\u81ea\u52a8\u5316\u5c42<\/a> \u6216\u7c7b\u4f3c\u7684\u4e1c\u897f\uff0c\u53ef\u4ee5\u4e0e\u4e00\u4e2a <span class=\"caps\">HTTP<\/span> \u670d\u52a1\u5668\uff09\u6765\u63a7\u5236mimoLive\u7684\u5404\u65b9\u9762--\u53ef\u80fd\u6027\u51e0\u4e4e\u662f\u65e0\u7a77\u7684\u3002(\u89c1 <a href=\"https:\/\/mimolive.com\/zh\/%e7%94%a8%e6%88%b7%e6%89%8b%e5%86%8c\/%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f%e4%bd%bf%e7%94%a8%e7%a4%ba%e4%be%8b\/\">\u4f8b\u5b50 <span class=\"caps\">API<\/span> \u4f7f\u7528\u65b9\u6cd5<\/a>)<\/p>\n\n\n\n<p>\u5728\u672c\u4e13\u9898\u4e2d\uff0c\u6211\u4eec\u5c06\u91cd\u70b9\u5173\u6ce8\u88f8\u9732\u7684 <span class=\"caps\">HTTP<\/span> <span class=\"caps\">API<\/span>.\u7531\u4e8e <span class=\"caps\">API<\/span> \u662f\u57fa\u4e8e <a href=\"http:\/\/jsonapi.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">json:api\u89c4\u8303<\/a> \u8bf7\u52a1\u5fc5\u5728\u4f7f\u7528 mimoLive \u524d\u719f\u6089\u5b83\u3002 <span class=\"caps\">API<\/span>.<\/p>\n\n\n\n<p>*\u9664\u4e86\u6587\u6863\u4e4b\u5916\uff0c\u4f60\u8fd8\u53ef\u4ee5\u770b\u770b\u6211\u4eec\u5728github\u4e0a\u7684PHP\u6f14\u793a\u811a\u672c\u3002<\/p>\n\n\n\n<p><br>\u6b64\u5916\uff0c\u8fd8\u6709\u4e00\u4e2aShell\u548cApple Script\u7684\u4f8b\u5b50\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"api-endpoint\"><span class=\"caps\">API<\/span> \u8bbf\u95ee<\/h3>\n\n\n\n<p>\u59c6\u96f7\u7279\u7684\u751f\u6d3b <span class=\"caps\">API<\/span> \u53ef\u4ee5\u5728mimoLive\u8fd0\u884c\u7684\u540c\u4e00\u53f0\u673a\u5668\u4e0a\uff08\u901a\u8fc7 \"localhost\"\uff09\u548c\u672c\u5730\u7f51\u7edc\u4e0a\uff08\u901a\u8fc7\".local\"\uff09\u8bbf\u95ee\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u542f\u7528\u4e86mimoLive\uff0c\u5c31\u4f1a\u6709\u4e00\u4e2a <span class=\"caps\">HTTP<\/span> 8989\u7aef\u53e3 \"\u4e0a\u7684\u670d\u52a1\u5668\u3002<\/p>\n\n\n\n<p>\u6240\u6709 <span class=\"caps\">API<\/span> \u8c03\u7528\u7684\u524d\u7f00\u662f\"\/api\/v1\/\"\u7684\u8def\u5f84\uff0c\u6240\u4ee5\u5982\u679c\u4f60\u60f3\u5f97\u5230\u4e00\u4e2a\u5df2\u6253\u5f00\u7684\u6587\u4ef6\u7684\u5217\u8868\uff0c\u4f60\u53ef\u4ee5\u8c03\u7528 \"http:\/\/localhost:8989\/api\/v1\/documents\"\u3002<\/p>\n\n\n\n<p>\u6240\u6709 ID\uff08\u6587\u6863\u3001\u56fe\u5c42\u3001\u6e90\u3001\u8f93\u51fa\u76ee\u7684\u5730\u7b49\uff09\u90fd\u4f1a\u5b58\u50a8\u5e76\u6301\u4e45\u4fdd\u5b58\u5230\u78c1\u76d8\uff0c\u56e0\u6b64\u53ea\u8981\u5728 mimoLive \u5185\u90e8\u4f7f\u7528\u76f8\u540c\u7684\u6587\u6863\uff0c\u786c\u7f16\u7801\u8fd9\u4e9b\u503c\u662f\u5b89\u5168\u7684\u3002<br><br>\u8bf7\u53c2\u9605 <a href=\"https:\/\/mimolive.com\/zh\/%e7%94%a8%e6%88%b7%e6%89%8b%e5%86%8c\/%e5%ae%9a%e5%88%b6\/http-api\/%e7%ab%af%e7%82%b9\/\" data-type=\"user-manual\" data-id=\"32488\">\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3\u7aef\u70b9<\/a> \u4ee5\u8fdb\u4e00\u6b65\u4e86\u89e3\u6240\u63d0\u4f9b\u7684\u6240\u6709\u7ec8\u7aef\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"authentication\">\u8ba4\u8bc1<\/h3>\n\n\n\n<p>\u4ecemimoLive 3.1\u5f00\u59cb\uff0c\u5982\u679c\u7528\u6237\u5728mimoLive\u504f\u597d\u4e2d\u542f\u7528\u4e86\u8ba4\u8bc1\uff0c\u4f60\u9700\u8981\u5728\u6bcf\u6b21\u8bf7\u6c42\u65f6\u63d0\u4f9b\u7528\u6237\u5bc6\u7801\u7ed9 <span class=\"caps\">API<\/span> \u8fd9\u53ef\u4ee5\u901a\u8fc7\u4e24\u79cd\u65b9\u5f0f\u8fdb\u884c\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8bbe\u7f6e\u81ea\u5b9a\u4e49 <span class=\"caps\">HTTP<\/span> header \"X-MimoLive-Password-SHA256: xxxxxxx\"<\/li>\n\n\n\n<li>\u6dfb\u52a0\u67e5\u8be2\u53c2\u6570\"?pwSHA256=xxxxxxx\"<\/li>\n<\/ul>\n\n\n\n<p>\u5728\u8fd9\u4e24\u79cd\u60c5\u51b5\u4e0b\uff0cxxxxxx\u5fc5\u987b\u88ab\u539f\u59cb\u5bc6\u7801\u6240\u53d6\u4ee3\uff08\u5728 <span class=\"caps\">UTF<\/span>-8\u7f16\u7801\uff09\u7684\u6563\u5217\uff0c\u4f7f\u7528 <span class=\"caps\">\u9655\u897f\u7701<\/span>-256\uff0c\u5e76\u7f16\u7801\u4e3a\u4e00\u4e32\u5341\u516d\u8fdb\u5236\u7684\u6570\u5b57\u3002<br>\u4e3a\u4e86\u65b9\u4fbf\u5b9a\u5236\u811a\u672c\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\uff0cmimoLive\u663e\u793a\u4e86\u8fd9\u4e2a <span class=\"caps\">API<\/span> \u952e\uff0c\u5e76\u5141\u8bb8\u5728 \"\u8fdc\u7a0b\u63a7\u5236 \"\u504f\u597d\u9762\u677f\u4e2d\u590d\u5236\u5230\u526a\u8d34\u677f\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1000\" height=\"448\" src=\"https:\/\/mimolive.com\/wp-content\/uploads\/2023\/03\/dddc6bf5-964b-493c-b35e-ee5b37e44e40.png\" alt=\"\" class=\"wp-image-32487\" srcset=\"https:\/\/mimolive.com\/wp-content\/uploads\/2023\/03\/dddc6bf5-964b-493c-b35e-ee5b37e44e40.png 1000w,  https:\/\/mimolive.com\/wp-content\/uploads\/2023\/03\/dddc6bf5-964b-493c-b35e-ee5b37e44e40-300x134.png 300w,  https:\/\/mimolive.com\/wp-content\/uploads\/2023\/03\/dddc6bf5-964b-493c-b35e-ee5b37e44e40-768x344.png 768w,  https:\/\/mimolive.com\/wp-content\/uploads\/2023\/03\/dddc6bf5-964b-493c-b35e-ee5b37e44e40-18x8.png 18w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"deprecated-authentication-method\">\u5e9f\u5f03\u7684\u8ba4\u8bc1\u65b9\u6cd5<\/h4>\n\n\n\n<p>\u5728mimoLive 3.1\u7248\u4e4b\u524d\uff0c\u5bf9\u7740\u8bf7\u6c42\u7684 <span class=\"caps\">API<\/span> \u5c06\u4f7f\u7528\u7279\u6b8a\u7684 <span class=\"caps\">HTTP<\/span> \u5934 \"X-MimoLive-Password: \"\u6216\u6bcf\u4e2a\u8bf7\u6c42\u7684\u67e5\u8be2\u53c2\u6570\"?pw=\"\u3002<br>\u4e0d\u5e78\u7684\u662f\uff0c\u8fd9\u79cd\u65b9\u6cd5\u901a\u8fc7\u4e00\u4e2a\u6f5c\u5728\u7684\u4e0d\u5b89\u5168\u7684\u7f51\u7edc\u8fde\u63a5\u4ee5\u900f\u660e\u65b9\u5f0f\u53d1\u9001\u5bc6\u7801\uff0c\u8fd9\u53ef\u80fd\u4f1a\u66b4\u9732\u654f\u611f\u6570\u636e\uff0c\u5982\u679c <span class=\"caps\">HTTP<\/span> <span class=\"caps\">API<\/span> \u5bc6\u7801\u5728\u5176\u4ed6\u5730\u65b9\u88ab\u91cd\u590d\u4f7f\u7528\u3002<br>\u867d\u7136\u5b83\u7ee7\u7eed\u5de5\u4f5c\uff0c\u4f46\u56e0\u6b64\u4e0d\u9f13\u52b1\u4f7f\u7528\u8fd9\u79cd\u8ba4\u8bc1\u65b9\u6cd5\uff0c\u5e76\u53ef\u80fd\u5728\u5c06\u6765\u88ab\u5220\u9664\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"errors\">\u9519\u8bef<\/h3>\n\n\n\n<p>\u5982\u679c\u5728\u8bf7\u6c42\u671f\u95f4\u53d1\u751f\u9519\u8bef\uff0cmimoLive \u5c06\u505c\u6b62\u5904\u7406\u8be5\u8bf7\u6c42\u5e76\u8fd4\u56de\u4e00\u4e2a <span class=\"caps\">HTTP<\/span> \u54cd\u5e94\uff0c\u5176\u72b6\u6001\u7801\u8868\u793a\u9519\u8bef\u3002\u54cd\u5e94\u8fd8\u5305\u542b\u4e00\u4e2a <span class=\"caps\">JSON<\/span> \u8f7d\u6709\u9519\u8bef\u5bf9\u8c61\u7684\u6570\u7ec4\uff0c\u5305\u542b\u5173\u4e8e\u6bcf\u4e2a\u53d1\u751f\u7684\u9519\u8bef\u7684\u989d\u5916\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\"><code>{\n  \"errors\": &#91;\n    {\n      \"status\": \"404\",\n      \"title\": \"Not Found\",\n      \"description\": \"The requested object could not be found\"\n    }\n  ]\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remote-access\">\u901a\u8fc7\u4e92\u8054\u7f51\u8fdb\u884c\u8fdc\u7a0b\u8bbf\u95ee<\/h3>\n\n\n\n<p>\u7531\u4e8e <span class=\"caps\">HTTP<\/span> <span class=\"caps\">API<\/span> \u662f\u7531mimoLive\u5185\u5efa\u7684\u7f51\u7edc\u670d\u52a1\u5668\u542f\u7528\u7684\uff0c\u8fdc\u7a0b\u8bbf\u95ee\u5230 <span class=\"caps\">HTTP<\/span> <span class=\"caps\">API<\/span> \u901a\u8fc7\u7ed9mimoLive\u7535\u8111\u4e00\u4e2a\u516c\u5171IP\u53f7\u7801\uff0c\u53ef\u4ee5\u4ece\u4e92\u8054\u7f51\u4e0a\u7684\u4efb\u4f55\u5730\u65b9\u542f\u7528\u3002\u7531\u4e8e <span class=\"caps\">HTTP<\/span> <span class=\"caps\">API<\/span> \u8fd9\u4e0d\u662f\u5f88\u597d\u7684\u4fdd\u62a4\uff0c\u8fd9\u662f\u4e00\u4e2a\u574f\u4e3b\u610f\u3002\u4e00\u4e2a\u66f4\u597d\u7684\u65b9\u6cd5\u662f\u4f7f\u8fdc\u7a0b\u8bbf\u95ee <span class=\"caps\">HTTP<\/span> <span class=\"caps\">API<\/span> \u901a\u8fc7\u4e00\u4e2a\u516c\u5171\u7f51\u7edc\u662f\u4e3a\u4e86 <a href=\"https:\/\/mimolive.com\/zh\/%e7%94%a8%e6%88%b7%e6%89%8b%e5%86%8c\/%e8%bf%9c%e7%a8%8b%e8%ae%bf%e9%97%ae%e8%bf%9c%e7%a8%8b%e6%8e%a7%e5%88%b6%e9%9d%a2%e5%92%8c-http-api\/\">\u4f7f\u7528 ngrok \u5efa\u7acb\u4e00\u4e2a\u5b89\u5168\u7684\u96a7\u9053\u5230\u4f60\u7684 mimoLive \u4e3b\u673a\u8ba1\u7b97\u673a<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>On one hand, mimoLive publishes a Remote Control UI which you can use to create custom user interfaces that you can use on a tablet or similar device to remote control mimoLive. Additionally, mimoLive provides access to the bare HTTP API so you can create custom scripts (via bash and curl, AppleScript, build-in Automation Layer [&hellip;]<\/p>","protected":false},"author":3,"featured_media":0,"parent":40865,"menu_order":2,"template":"","meta":{"_acf_changed":false,"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[258],"tags":[],"class_list":["post-32486","user-manual","type-user-manual","status-publish","hentry","category-manual"],"acf":[],"_links":{"self":[{"href":"https:\/\/mimolive.com\/zh\/wp-json\/wp\/v2\/user-manual\/32486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mimolive.com\/zh\/wp-json\/wp\/v2\/user-manual"}],"about":[{"href":"https:\/\/mimolive.com\/zh\/wp-json\/wp\/v2\/types\/user-manual"}],"author":[{"embeddable":true,"href":"https:\/\/mimolive.com\/zh\/wp-json\/wp\/v2\/users\/3"}],"version-history":[{"count":1,"href":"https:\/\/mimolive.com\/zh\/wp-json\/wp\/v2\/user-manual\/32486\/revisions"}],"predecessor-version":[{"id":39706,"href":"https:\/\/mimolive.com\/zh\/wp-json\/wp\/v2\/user-manual\/32486\/revisions\/39706"}],"up":[{"embeddable":true,"href":"https:\/\/mimolive.com\/zh\/wp-json\/wp\/v2\/user-manual\/40865"}],"wp:attachment":[{"href":"https:\/\/mimolive.com\/zh\/wp-json\/wp\/v2\/media?parent=32486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mimolive.com\/zh\/wp-json\/wp\/v2\/categories?post=32486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mimolive.com\/zh\/wp-json\/wp\/v2\/tags?post=32486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}