1. 程式人生 > >微信搖一搖公眾號開發

微信搖一搖公眾號開發

1. 首先查詢公眾號是否存在
https://api.weixin.qq.com/cgi-bin/token?
grant_type=client_credential&appid=APPID&secret=APPSECRET

**2. 如果獲得訪問 token ,則建立 model ,收集頁面的資料,並驗證過濾
假如 model 是 Shakeround ,提交表單的資料是陣列格式:**
shakeround_form[‘userName’],shakeround_form[‘userMobile’]
model=newShakearound();model->attributes = $_POST[‘shakeround_form’];

3. 如果經營行業需要資質證書,那麼此時呼叫素材管理介面,先將圖片上傳至微信伺服器
https://api.weixin.qq.com/shakearound/material/add?
access_token=ACCESS_TOKEN&type=TYPE
Icon :搖一搖頁面展示的 icon 圖; License :申請開通搖一搖周邊功能時需上傳的資質檔案;若不傳
type ,則預設 type=icon