{"id":185526,"date":"2023-08-28T04:22:07","date_gmt":"2023-08-27T20:22:07","guid":{"rendered":"http:\/\/www.idc.net\/help\/185526\/"},"modified":"2023-08-28T04:22:07","modified_gmt":"2023-08-27T20:22:07","slug":"%e5%90%8e%e6%b5%aa%e4%ba%91%e5%b0%8f%e7%a8%8b%e5%ba%8f%e6%95%99%e7%a8%8b%ef%bc%9a%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f-%e5%9b%9e%e4%bc%a0%e5%b9%bf%e5%91%8a%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/185526\/","title":{"rendered":"\u540e\u6d6a\u4e91\u5c0f\u7a0b\u5e8f\u6559\u7a0b\uff1a\u5fae\u4fe1\u5c0f\u7a0b\u5e8f \u56de\u4f20\u5e7f\u544a\u6570\u636e"},"content":{"rendered":"<h2>ad.addUserAction<\/h2>\n<blockquote><p>\n  \u672c\u63a5\u53e3\u5e94\u5728\u670d\u52a1\u5668\u7aef\u8c03\u7528\uff0c\u8be6\u7ec6\u8bf4\u660e\u53c2\u89c1 \u670d\u52a1\u7aefAPI\u3002\n<\/p><\/blockquote>\n<blockquote><p>\n  \u672c\u63a5\u53e3\u652f\u6301 \u4e91\u8c03\u7528\u3002\u9700\u5f00\u53d1\u8005\u5de5\u5177\u7248\u672c &gt;=&nbsp;1.02.1904090\uff08\u6700\u65b0 \u7a33\u5b9a\u7248\u4e0b\u8f7d\uff09<br \/>\n <br \/>wx-server-sdk&nbsp;&gt;=&nbsp;0.4.0\n<\/p><\/blockquote>\n<p>\u56de\u4f20\u5e7f\u544a\u6570\u636e<\/p>\n<h3>\u8bf4\u660e<\/h3>\n<p>\u5fae\u4fe1\u5e7f\u544a\u6587\u6863\uff1ahttps:\/\/ad.weixin.qq.com\/guide\/457<\/p>\n<p>\u5bf9\u5e94\u63a5\u53e3&nbsp;https:\/\/api.weixin.qq.com\/marketing\/user_actions\/add<\/p>\n<h3>\u4e91\u8c03\u7528\u4f7f\u7528\u8bf4\u660e<\/h3>\n<p>\u5916\u94fe\u6587\u6863\u4e2d\u53ef\u80fd\u53ea\u6709 HTTP \u5f62\u5f0f\u7684\u5b9a\u4e49\uff0c\u5bf9\u4e91\u8c03\u7528\u65b9\u5f0f\uff0c\u8c03\u7528\u65f6\u53c2\u6570\u4e0e HTTP \u9700\u6c42\u7684\u53c2\u6570\u4e00\u81f4\uff0c\u4f46\u662f\u65e0\u9700\u4f20\u5165&nbsp;access_token\uff0c\u540c\u65f6\u6240\u6709\u7684\u53c2\u6570\u65e0\u8bba get\/post \u90fd\u53ea\u9700\u4f5c\u4e3a\u63a5\u53e3\u53c2\u6570 JS \u5bf9\u8c61\u4e2d\u7684\u4e00\u4e2a\u5b57\u6bb5\u4f20\u5165\u5373\u53ef\u3002<\/p>\n<p>\u800c\u5bf9\u4e8e FormData \u7684\u8bf7\u6c42\uff0c\u5982\u679c\u4e00\u4e2a\u53c2\u6570\u7684\u7c7b\u578b\u662f Buffer\uff0c\u5219\u5176\u5b57\u6bb5\u5e94\u4f20\u5165\u6709\u5982\u4e0b\u5b57\u6bb5\u7684\u5bf9\u8c61\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u5c5e\u6027<\/th>\n<th>\u7c7b\u578b<\/th>\n<th>\u9ed8\u8ba4\u503c<\/th>\n<th>\u5fc5\u586b<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>contentType<\/td>\n<td>string<\/td>\n<td><\/td>\n<td>\u662f<\/td>\n<td>\u6570\u636e\u7c7b\u578b\uff0c\u4f20\u5165 MIME Type<\/td>\n<\/tr>\n<tr>\n<td>value<\/td>\n<td>Buffer<\/td>\n<td><\/td>\n<td>\u662f<\/td>\n<td>\u6587\u4ef6 Buffer<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u793a\u4f8b<\/p>\n<p>\u5047\u8bbe\u5916\u94fe\u6587\u6863\u8981\u6c42\u662f POST \u65b9\u6cd5\uff0c\u8981\u6c42\u4f20\u5165\u5982\u4e0b\u53c2\u6570<\/p>\n<table>\n<thead>\n<tr>\n<th>\u5c5e\u6027<\/th>\n<th>\u7c7b\u578b<\/th>\n<th>\u4f4d\u7f6e<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>xxx<\/td>\n<td>string<\/td>\n<td>URL \u53c2\u6570<\/td>\n<td>...<\/td>\n<\/tr>\n<tr>\n<td>yyy<\/td>\n<td>number<\/td>\n<td>JSON body<\/td>\n<td>...<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5219\u8c03\u7528\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<pre><code>cloud.openapi.ad.addUserAction({\n  xxx: '\u5b57\u7b26\u4e32',\n  yyy: 100,\n})\n<\/code><\/pre>\n<p>\u5047\u8bbe\u5916\u94fe\u6587\u6863\u8981\u6c42\u662f POST FormData\uff0c\u8981\u6c42\u4f20\u5165\u5982\u4e0b\u53c2\u6570<\/p>\n<table>\n<thead>\n<tr>\n<th>\u5c5e\u6027<\/th>\n<th>\u7c7b\u578b<\/th>\n<th>\u4f4d\u7f6e<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>xxx<\/td>\n<td>string<\/td>\n<td>URL \u53c2\u6570<\/td>\n<td>...<\/td>\n<\/tr>\n<tr>\n<td>media<\/td>\n<td>buffer<\/td>\n<td>FormData<\/td>\n<td>\u56fe\u7247 buffer<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5219\u8c03\u7528\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<pre><code>cloud.openapi.ad.addUserAction({\n  xxx: '\u5b57\u7b26\u4e32',\n  media: {\n    contentType: 'image\/png',\n    value: Buffer\n  },\n})<\/code><\/pre>\n<p> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>ad.addUserAction \u672c\u63a5\u53e3\u5e94\u5728\u670d\u52a1\u5668\u7aef\u8c03\u7528\uff0c\u8be6\u7ec6\u8bf4\u660e\u53c2\u89c1 \u670d\u52a1\u7aefAPI\u3002 \u672c\u63a5\u53e3\u652f\u6301 \u4e91\u8c03\u7528\u3002\u9700 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[182398],"tags":[],"class_list":["post-185526","post","type-post","status-publish","format-standard","hentry","category-mini-program"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/185526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=185526"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/185526\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=185526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=185526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=185526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}