Skip to content

Bot API

Michael edited this page Sep 6, 2017 · 13 revisions

Bot认证

使用Basic Authorization

  • username: bot_name
  • password: bot_access_web_token

示例代码:

import base64
import requests

url = "https://openapi.bixin.com/api/v2/bot.postText"

data = {
'target_id': 'a573e67b760a44259dc0ee29087ade72',
'text': 'text',
'request_id': 'a573e676casa44259dc0ee29081ade013'
}
bot_name = 'bot_test'
bot_access_web_token = '2a734ce13dcb4bb092e35d0ebccb6245'
b = '{}:{}'.format(bot_name, bot_access_web_token)
a = base64.encodestring(b.encode('utf-8')).strip()

headers = {}
headers['Authorization'] = 'Basic {}'.format(a)
headers['User-Agent'] = 'Bot/{}'.format(bot_name)

response = requests.request("POST", url, data=data, headers=headers)
print(response.text)

API

文本消息

POST https://openapi.bixin.com/api/v2/bot.postText

  • Content-Type: application/x-www-form-urlencoded
  • Params:
  • target_id: #发送对象的id
  • text: 发送文本
  • request_id: 请求消息id 用uuid生成
curl -X POST \
https://openapi.bixin.com/api/v2/bot.postText \
-H 'authorization: Basic YnhfYm90X2dob3N0OjJhNzM0Y2UxM2RjYjRiYjA5MmUzNWQwZWJjY2I2MjQ1' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'target_id=a573e67b760a44259dc0ee29087ade72&text=text&request_id=a573e676casa44259dc0ee29087adea23'
{
	"ok": true,
	"data": {
		"created_at": "2017-07-07T03:08:59.871191",
		"content_type": "text",
		"content": {
			"text": "text"
		},
		"sender": {
			"name": "bot_test",
			"nickname": "Ghost bot",
			"avatar_url": "https://openapi.bixin.com.com/res/vendor_fin_dollar2.png",
			"gender": "",
			"menu": [{
				"icon_url": "https://openapi.bixin.com.com/res/faq.png",
				"desc": "Test",
				"action": "bixin://postevent?event=index_view&text=Test&target_id=f2c5609ae91c4a2ab20c4b196aac9b4a&conv_type=bot"
			}],
			"btc_address": "1Har9AL8QyRuQ5DiLfm6kFndscbVR6ctHG",
			"desc": "Bixin Official Service",
			"id": "f2c5609ae91c4a2ab20c4b196aac9b4a",
			"conv_type": "bot"
		},
		"brief": "text",
		"request_id": "a573e676casa44259dc0ee29087adea23",
		"prev_id": 9363,
		"receiver": {
			"name": "echo",
			"nickname": "12555",
			"avatar_url": "https://openapi.bixin.com.com/upload/2017/05/11/6146c20c214745f3b29b73216fe47fd1.png",
			"gender": "male",
			"menu": [],
			"btc_address": "1vkJV6bnJdbjocerXjLJkc3tEsjmEjh94",
			"desc": "",
			"id": "a573e67b760a44259dc0ee29087ade72",
			"conv_type": "private"
		},
		"id": 9364,
		"is_mute": false,
		"conv_type": "bot"
	}
}

图片消息

POST https://openapi.bixin.com/api/v2/bot.postImage

  • Content-Type: multipart/form-data
  • Params:
  • target_id: #发送对象的id
  • request_id: 请求消息id 用uuid生成
  • conv_type: 会话类型, 可选[private,group]
  • file: image文件

请求示例:

curl -X POST \
https://openapi.bixin.com/api/v2/bot.postImage \
-H 'authorization: Basic YnhfYm90X2dob3N0OjJhNzM0Y2UxM2RjYjRiYjA5MmUzNWQwZWJjY2I2MjQ1' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F request_id=a1273e67b760a44259dc0ee29087ade722 \
-F target_id=a573e67b760a44259dc0ee29087ade72 \
-F conv_type=private \
-F file=@/Users/me/Downloads/1937317kkln8miadivzaue.jpg

返回:

{
	"ok": true,
	"data": {
		"content_type": "image",
		"conv_type": "bot",
		"sender": {
			"nickname": "Ghost bot",
			"avatar_url": "https://openapi.bixin.com.com/res/vendor_fin_dollar2.png",
			"conv_type": "bot",
			"name": "bot_test",
			"id": "f2c5609ae91c4a2ab20c4b196aac9b4a",
			"btc_address": "1Har9AL8QyRuQ5DiLfm6kFndscbVR6ctHG",
			"gender": "",
			"menu": [{
				"icon_url": "https://openapi.bixin.com.com/res/faq.png",
				"desc": "Test",
				"action": "bixin://postevent?event=index_view&text=Test&target_id=f2c5609ae91c4a2ab20c4b196aac9b4a&conv_type=bot"
			}],
			"desc": "Bixin Official Service"
		},
		"id": 10560,
		"request_id": "a1273e67b760a44259dc0ee29087ade722",
		"content": {
			"image_url": "https://openapi.bixin.com.com/upload/2017/07/07/a75955a4165e4b5990ea9559ce794f94.png",
			"image_height": 768,
			"thumb_height": 112,
			"thumb_url": "https://openapi.bixin.com.com/upload/2017/07/07/a75955a4165e4b5990ea9559ce794f94.png",
			"thumb_width": 200,
			"image_width": 1366
		},
		"prev_id": 10558,
		"receiver": {
			"nickname": "Echo",
			"avatar_url": "https://openapi.bixin.com.com/upload/2017/07/07/1adf8b1675e84435aa5e3c6a2202a825.png",
			"conv_type": "private",
			"name": "echo",
			"id": "a573e67b760a44259dc0ee29087ade72",
			"btc_address": "1vkJV6bnJdbjocerXjLJkc3tEsjmEjh94",
			"gender": "male",
			"menu": [],
			"desc": ""
		},
		"brief": "Image",
		"created_at": "2017-07-07T08:18:45.487664",
		"is_mute": false
	}
}

select 消息

POST https://openapi.bixin.com.com/api/v2/bot.postSelect

请求http示例:

POST /api/v2/bot.postSelect HTTP/1.1
Host: openapi.bixin.com
Authorization: Basic YnhfYm90X2dob3N0OjJhNzM0Y2UxM2RjYjRiYjA5MmUzNWQwZWJjY2I2MjQ1
Content-Type: application/json

{
	"request_id": "a573a17a0asess251dc0ee29087adea23",
	"target_id": "a573e67b760a44259dc0ee29087ade72",
	"conv_type": "private",
	"text": "text",
	"select": [{
			"desc": "desc",
			"image_url": "image_url",
			"image_width": "image_width",
			"image_height": "image_height",
			"action": "action"
		},
		{
			"desc": "desc2",
			"image_url": "imgae_url2",
			"image_width": "image_width2",
			"image_height": "image_height2",
			"action": "action2"
		}
	]
}

返回:

{
	"ok": true,
	"data": {
		"created_at": "2017-07-07T03:51:23.330868",
		"content_type": "select",
		"content": {
			"text": "text",
			"select": [{
					"desc": "desc",
					"image_url": "image_url",
					"image_width": "image_width",
					"image_height": "image_height",
					"action": "bixin://postevent/?target_id=f2c5609ae91c4a2ab20c4b196aac9b4a&conv_type=bot&text=desc&event=action"
				},
				{
					"desc": "desc2",
					"image_url": "imgae_url2",
					"image_width": "image_width2",
					"image_height": "image_height2",
					"action": "bixin://postevent/?target_id=f2c5609ae91c4a2ab20c4b196aac9b4a&conv_type=bot&text=desc2&event=action2"
				}
			]
		},
		"sender": {
			"name": "bot_test",
			"nickname": "Ghost bot",
			"avatar_url": "https://openapi.bixin.com.com/res/vendor_fin_dollar2.png",
			"gender": "",
			"menu": [{
				"icon_url": "https://openapi.bixin.com.com/res/faq.png",
				"desc": "Test",
				"action": "bixin://postevent?event=index_view&text=Test&target_id=f2c5609ae91c4a2ab20c4b196aac9b4a&conv_type=bot"
			}],
			"btc_address": "1Har9AL8QyRuQ5DiLfm6kFndscbVR6ctHG",
			"desc": "Bixin Official Service",
			"id": "f2c5609ae91c4a2ab20c4b196aac9b4a",
			"conv_type": "bot"
		},
		"brief": "text",
		"request_id": "a573a17a0asess251dc0ee29087adea23",
		"prev_id": 9369,
		"receiver": {
			"name": "echo",
			"nickname": "12555",
			"avatar_url": "https://openapi.bixin.com.com/upload/2017/05/11/6146c20c214745f3b29b73216fe47fd1.png",
			"gender": "male",
			"menu": [],
			"btc_address": "1vkJV6bnJdbjocerXjLJkc3tEsjmEjh94",
			"desc": "",
			"id": "a573e67b760a44259dc0ee29087ade72",
			"conv_type": "private"
		},
		"id": 9370,
		"is_mute": false,
		"conv_type": "bot"
	}
}

文章消息

POST https://openapi.bixin.com.com/api/v2/bot.postArticle

  • Content-Type: application/x-www-form-urlencoded
  • Params:
  • target_id: #发送对象的id
  • text: 发送文本
  • request_id: 请求消息id 用uuid生成
  • conv_type: 会话类型, 可选[private,group]
  • title: artilce 消息标题
  • desc: artilce 消息标描述
  • image_url: 背景图片url 如: https://bixin.com/static/images/logo_scroll@2x.21af7c9605c2.png
  • action: 跳转连接或者 event 如: https://bixin.com
curl -X POST \
https://openapi.bixin.com.com/api/v2/bot.postArticle \
-H 'authorization: Basic YnhfYm90X2dob3N0OjJhNzM0Y2UxM2RjYjRiYjA5MmUzNWQwZWJjY2I2MjQ1' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'user-agent: Bot/bot_test' \
-d 'target_id=a573e67b760a44259dc0ee29087ade72&text=text&request_id=a573e4760as144259dc0ee29087adea23&conv_type=private&title=title%E6%A0%87%E9%A2%98&desc=desc%E6%8F%8F%E8%BF%B0&image_url=https%3A%2F%2Fbixin.com%2Fstatic%2Fimages%2Flogo_scroll%402x.21af7c9605c2.png&action=https%3A%2F%2Fbixin.com'
{
	"ok": true,
	"data": {
		"created_at": "2017-07-07T03:35:44.246799",
		"content_type": "article",
		"content": {
			"desc": "desc描述",
			"image_url": "https://bixin.com/static/images/logo_scroll@2x.21af7c9605c2.png",
			"background": "https://bixin.com/static/images/logo_scroll@2x.21af7c9605c2.png",
			"title": "title标题",
			"action": "bixin://webview_auth/?url=https://bixin.com&bot_id=f2c5609ae91c4a2ab20c4b196aac9b4a"
		},
		"sender": {
			"name": "bot_test",
			"nickname": "Ghost bot",
			"avatar_url": "https://openapi.bixin.com.com/res/vendor_fin_dollar2.png",
			"gender": "",
			"menu": [{
				"icon_url": "https://openapi.bixin.com.com/res/faq.png",
				"desc": "Test",
				"action": "bixin://postevent?event=index_view&text=Test&target_id=f2c5609ae91c4a2ab20c4b196aac9b4a&conv_type=bot"
			}],
			"btc_address": "1Har9AL8QyRuQ5DiLfm6kFndscbVR6ctHG",
			"desc": "Bixin Official Service",
			"id": "f2c5609ae91c4a2ab20c4b196aac9b4a",
			"conv_type": "bot"
		},
		"brief": "Article",
		"request_id": "a573e4760as144259dc0ee29087adea23",
		"prev_id": 9366,
		"receiver": {
			"name": "echo",
			"nickname": "12555",
			"avatar_url": "https://openapi.bixin.com.com/upload/2017/05/11/6146c20c214745f3b29b73216fe47fd1.png",
			"gender": "male",
			"menu": [],
			"btc_address": "1vkJV6bnJdbjocerXjLJkc3tEsjmEjh94",
			"desc": "",
			"id": "a573e67b760a44259dc0ee29087ade72",
			"conv_type": "private"
		},
		"id": 9369,
		"is_mute": false,
		"conv_type": "bot"
	}
}

广播文本

POST https://openapi.bixin.com/api/v2/bot.broadcastText

  • Content-Type: application/x-www-form-urlencoded
  • Params:
  • text: 发送文本
curl -X POST \
https://openapi.bixin.com/api/v2/bot.broadcastText \
-H 'authorization: Basic YnhfYm90X2dob3N0OjJhNzM0Y2UxM2RjYjRiYjA5MmUzNWQwZWJjY2I2MjQ1' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'user-agent: Bot/bot_test' \
-d text=text%20broadcast
返回:
{"ok": true}

广播图片

POST https://openapi.bixin.com/api/v2/bot.broadcastImage

  • Content-Type: multipart/form-data
  • Params:
  • file: image文件
curl -X POST \
https://openapi.bixin.com/api/v2/bot.broadcastImage \
-H 'authorization: Basic YnhfYm90X2dob3N0OjJhNzM0Y2UxM2RjYjRiYjA5MmUzNWQwZWJjY2I2MjQ1' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-H 'user-agent: Bot/bot_test' \
-F file=@/Users/michael/Downloads/1937317kkln8miadivzaue.jpg
返回:
{"ok": true}

广播文章

POST https://openapi.bixin.com.com/api/v2/bot.broadcastArticle

curl -X POST \
https://openapi.bixin.com/api/v2/bot.broadcastArticle \
-H 'authorization: Basic YnhfYm90X2dob3N0OjJhNzM0Y2UxM2RjYjRiYjA5MmUzNWQwZWJjY2I2MjQ1' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'user-agent: Bot/bot_test' \
-d 'text=text&title=title%E6%A0%87%E9%A2%98&desc=desc%E6%8F%8F%E8%BF%B0&image_url=https%3A%2F%2Fbixin.com%2Fstatic%2Fimages%2Flogo_scroll%402x.21af7c9605c2.png&action=https%3A%2F%2Fbixin.com'
返回:
{"ok": true}

广播置顶消息

POST https://openapi.bixin.com/api/v2/bot.broadcastSticky

  • Content-Type: application/x-www-form-urlencoded
  • Params:
  • text: 文本
  • action_text: action文本
  • action: 跳转连接或者 event 如: https://bixin.com
  • closable: 是否关闭 取值为0(False),1(True)
curl -X POST \
https://openapi.bixin.com/api/v2/bot.broadcastSticky \
-H 'authorization: Basic YnhfYm90X2dob3N0OjJhNzM0Y2UxM2RjYjRiYjA5MmUzNWQwZWJjY2I2MjQ1' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'text=text&action=bixin%3A%2F%2Fwebview%2Furl%3Dwww.baidu.com&action_text=View&closable=1'
返回:
{"ok": true}

广播select消息

POST https://openapi.bixin.com/api/v2/bot.broadcastSelect

请求http示例:

POST /api/v2/bot.broadcastSelect HTTP/1.1
Host: openapi.bixin.com
Content-Type: application/json
Authorization: Basic YnhfYm90X2dob3N0OjJhNzM0Y2UxM2RjYjRiYjA5MmUzNWQwZWJjY2I2MjQ1

{
	"text": "测试select消息",
	"select":[
		{
			"desc": "主站",
			"image_url": "https://bixin.com/static/images/mobile_dl.f626af696794.png",
			"image_width": 230,
			"image_height": 120,
			"action": "https://bixin.com"
		},
		{
			"desc": "点击选择",
			"image_url": "",
			"image_width": "",
			"image_height": "",
			"action": "event"
		}
		]
}

获取粉丝用户信息

GET https://openapi.bixin.com/api/v2/bot.getFollowers

  • Params: 无需参数

返回示例:

{
    "ok": true,
    "data": {
        "followers": [
            {
                "username": "echo",
                "id": "a573e67b760a44259dc0ee29087ade72",
                "nickname": "heid"
            },
            {
                "username": "ttttt",
                "id": "c94aa4caa38444f6bd7b4c86e10e5c3e",
                "nickname": "wqfas"
            }
        ]
    }
}

收款消息

POST https://openapi.bixin.com/api/v2/bot.postPaymentRequest

  • Content-Type: application/x-www-form-urlencoded
  • Params:
  • target_id: #发送对象的id
  • request_id: 请求消息id 用uuid生成
  • conv_type: 会话类型, 可选[private,group]
  • btc_address: vendor的比特币地址
  • message: 备注内容
  • amount_btc: 收款BTC数量
  • arg0: arg[0-9]自定义参数

请求示例:

curl -X POST \
  https://openapi.bixin.com/api/v2/bot.postPaymentRequest \
  -H 'authorization: Basic Ym90MTIzNDU2Nzg6ZDMzOWQ5YmJjMTg0NGZlOWIzMjI2Njk3NTFlNjM0NjU=' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d 'target_id=a573e67b760a44259dc0ee29087ade72&request_id=acs32cs23casa44259dc0sas29081ccs232&btc_address=1248bTMWvsKyetnw9LZ9bH6XSnjCTA3YUD&message=hello%26msg&amount_btc=0.1&conv_type=private&arg1=12342342&arg9=13112999'

返回示例:

{
    "ok": true,
    "data": {
        "is_mute": false,
        "brief": "Payment Request",
        "content": {
            "content_type": "payment_request",
            "target_id": "a573e67b760a44259dc0ee29087ade72",
            "action": "bitcoin:1248bTMWvsKyetnw9LZ9bH6XSnjCTA3YUD?amount=0.1&message=hello%26msg&arg1=12342342&arg9=13112999",
            "conv_type": "private",
            "desc": "100,000 Bits",
            "comment": "Bixin Payment Request"
        },
        "created_at": "2017-08-14T08:40:47.984493",
        "content_type": "payment_request",
        "request_id": "acs32cs23casa44259dc0sas29081ccs232",
        "id": 83093,
        "sender": {
            "gender": "",
            "nickname": "bot nickname",
            "desc": "",
            "id": "53b0e04dfaf749c3939c3c6614fa41de",
            "menu": [],
            "conv_type": "bot",
            "name": "bot12345678",
            "avatar_url": "https://bixin.com/media/openplatform/2017/07/17/pECXyQZz7u8SuvFr.png",
            "btc_address": "1PgwDda8KuhyZJDeypm94WbDhoz4b7GJqi"
        },
        "conv_type": "bot",
        "prev_id": 83089,
        "receiver": {
            "gender": "male",
            "nickname": "heid",
            "desc": "",
            "id": "a573e67b760a44259dc0ee29087ade72",
            "menu": [],
            "conv_type": "private",
            "name": "echo",
            "avatar_url": "https://bixin.com/upload/2017/07/14/348c0df261ff487698f797d416b4a847.png",
            "btc_address": "1vkJV6bnJdbjocerXjLJkc3tEsjmEjh94"
        }
    }
}

form消息

POST https://openapi.bixin.com/api/v2/bot.postForm

  • Content-Type: application/json
  • Params:
  • target_id: #发送对象的id
  • request_id: 请求消息id 用uuid4生成
  • conv_type: 会话类型, 可选[private,bot]
  • form: 详见form wiki
  • category: 类型(用于显示账单, 可选)

请求示例:

curl -X POST \
  https://openapi.bixin.com/api/v2/bot.postForm \
  -H 'authorization: Basic YnhfYm90X2dob3N0OjJhNzM0Y2UxM2RjYjRiYjA5MmUzNWQwZWJjY2I2MjQ1' \
  -H 'content-type: application/json' \
  -d '{
  "request_id": "1473e3b718asaasdfa123e290872322",
  "target_id": "a573e67b760a44259dc0ee29087ade72",
  "conv_type": "bot",
  "id": "put-any-id-in-it",
  "title": "A title as you see",
  "form": [
      {
          "name": "field-1",
          "label": "Im Label",
          "prefix": "desc1",
          "type": "num",
          "suffix": "Bits",
          "placeholder": "Im placeholder"
      },
      {
          "name": "field-6",
          "label": "field3",
          "type": "select",
          "options": { 
             "opt1":  "Alice",
             "opt2":  "Bob"
          },
          "required": true
      },
      {
          "name": "field-2",
          "prefix": "desc2",
          "type": "text",
          "value": "Im Default"
      },
      {
          "name": "field-3",
          "prefix": "Im toggle",
          "type": "bool",
          "value": "true"
      },
      {
          "name": "field-4",
          "prefix": "Im toggle",
          "type": "date",
          "value": "2011-03-98"
      }
      
  ]
}'

返回示例:

{
    "data": {
        "request_id": "1473e3b718asaasdfa123e290872322",
        "id": 83100,
        "sender": {
            "id": "f2c5609ae91c4a2ab20c4b196aac9b4a",
            "avatar_url": "https://openapi.bixin.com/res/vendor_fin_dollar2.png",
            "nickname": "Ghost bot",
            "btc_address": "1Har9AL8QyRuQ5DiLfm6kFndscbVR6ctHG",
            "gender": "",
            "desc": "",
            "conv_type": "bot",
            "name": "bx_bot_ghost",
            "menu": []
        },
        "created_at": "2017-08-15T03:46:34.895666",
        "receiver": {
            "id": "a573e67b760a44259dc0ee29087ade72",
            "avatar_url": "https://openapi.bixin.com/upload/2017/07/14/348c0df261ff487698f797d416b4a847.png",
            "nickname": "heid",
            "btc_address": "1vkJV6bnJdbjocerXjLJkc3tEsjmEjh94",
            "gender": "male",
            "desc": "",
            "conv_type": "private",
            "name": "echo",
            "menu": []
        },
        "prev_id": 83097,
        "content": {
            "id": "put-any-id-in-it",
            "title": "A title as you see",
            "form": [
                {
                    "placeholder": "Im placeholder",
                    "type": "num",
                    "name": "field-1",
                    "prefix": "desc1",
                    "label": "Im Label",
                    "suffix": "Bits"
                },
                {
                    "type": "text",
                    "value": "Im Default",
                    "name": "field-2",
                    "prefix": "desc2"
                },
                {
                    "type": "bool",
                    "value": "true",
                    "name": "field-3",
                    "prefix": "Im toggle"
                },
                {
                    "type": "date",
                    "value": "2011-03-98",
                    "name": "field-4",
                    "prefix": "Im toggle"
                },
                {
                    "options": {
                        "opt2": "Bob",
                        "opt1": "Alice"
                    },
                    "type": "select",
                    "required": true,
                    "label": "field3",
                    "name": "field-6"
                }
            ]
        },
        "brief": "form",
        "conv_type": "bot",
        "is_mute": false,
        "content_type": "form"
    },
    "ok": true
}

用户提交消息内容示例:

{
    "data": {
        "content": {
            "id": "put-any-id-in-it",
			"desc": "hello, I am desc",
            "form": [
                {
                    "name": "field-1",
                    "value": "1234"
                },
                {
                    "name": "field-6",
                    "value": "opt1"
                },
                {
                    "name": "field-2",
                    "value": "Im Default"
                },
                {
                    "name": "field-3",
                    "value": true
                },
                {
                    "name": "field-4",
                    "value": "2011-03-98"
                }
            ]
        },
        "conv_type": "private",
        "is_mute": false,
        "id": 83102,
        "sender": {
            "gender": "",
            "id": "3ec336fa1e5b4df68e5967e397235eaa",
            "menu": [],
            "desc": "",
            "conv_type": "private",
            "avatar_url": "http://127.0.0.1:9999/res/user_profile_default2.png",
            "name": "tw123456",
            "nickname": "tw123456",
            "btc_address": "1Hwbb4xdtcuvMVUCZuecGKqMcB6wDyJ6HP"
        },
        "brief": "submit_form",
        "request_id": "1573e3b718a1aasdfa123e290872322",
        "created_at": "2017-08-15T04:02:04.353991",
        "content_type": "submit_form",
        "prev_id": 83099,
        "receiver": {
            "gender": "male",
            "id": "a573e67b760a44259dc0ee29087ade72",
            "menu": [],
            "desc": "",
            "conv_type": "private",
            "avatar_url": "https://openapi.bixin.com/upload/2017/07/14/348c0df261ff487698f797d416b4a847.png",
            "name": "echo",
            "nickname": "heid",
            "btc_address": "1vkJV6bnJdbjocerXjLJkc3tEsjmEjh94"
        }
    },
    "ok": true
}

设置Menu

POST https://openapi.bixin.com/api/v2/bot.setMenu

  • Content-Type: application/json
  • Params:
  • desc: 描述字典(支持多语言: en_US, zh_Hans)
  • action: 跳转连接或者 event 如: https://bixin.com
  • icon_url: 图标url

请求http示例:

POST /api/v2/bot.setMenu HTTP/1.1
Host: openapi.bixin.com
Content-Type: application/json
Authorization: Basic YnhfYm90X2dob3N0OjJhNzM0Y2UxM2RjYjRiYjA5MmUzNWQwZWJjY2I2MjQ1

[
	{
	 "desc": {
		"en_US": "App Site",
		"zh_Hans": "应用网站"
	 },
	 "action": "https://bixin.com",
	 "icon_url": "https://app.bixin.com/res/default_bot_action_icon.png"
	}
]

Clone this wiki locally