Module: Wxapi::Misc
- Included in:
- Wxapi
- Defined in:
- lib/wxapi/misc.rb
Instance Method Summary collapse
Instance Method Details
#api_quota(cgi_path) ⇒ Object
3 4 5 6 7 |
# File 'lib/wxapi/misc.rb', line 3 def api_quota(cgi_path) access_token = get_access_token response = RestClient.post("#{prefix}/cgi-bin/openapi/quota/get?access_token=#{access_token}", {cgi_path: cgi_path}.to_json, {content_type: :json, accept: :json}) JSON.parse(response) end |
#code2session(code) ⇒ Object
9 10 11 12 13 |
# File 'lib/wxapi/misc.rb', line 9 def code2session(code) response = RestClient.get("#{prefix}/sns/jscode2session?appid=#{@app_id}&secret=#{@app_secret}&js_code=#{code}&grant_type=authorization_code") resp = JSON.parse(response) test_resp resp end |