def create_menu(menu): logger.info(json.dumps(menu)) rsp = HTTP.post(WX_URL_CREATE_MENU, json.dumps(menu, ensure_ascii=False), access_token=get_access_token()) return json.loads(rsp)
def get_unlimit_qrcode_ticket(arg): args = { 'action_name': 'QR_LIMIT_SCENE', 'action_info': { 'scene': { 'scene_id': arg } } } rsp = HTTP.post(WX_URL_CREATE_QRCODE, json.dumps(args), access_token=get_access_token()) logger.info('get a unlimit qrcode, arg: %s, ret: %s', arg, rsp) rsp = json.loads(rsp) return rsp['ticket']
def url_to_short(url): data = dict(action='long2short', long_url=url) rsp = HTTP.post(WX_URL_SHORTURL, json.dumps(data), access_token=get_access_token()) return json.loads(rsp)
def make_order(order): result = HTTP.post(WX_URL_MAKE_ORDER, order.xml()) return Message(result)