二维码生成
州讯互联 官方文档
按照设定的参数、生成二维码
基本说明:
接口地址:http://zhouxunwang.cn/data/?id=72
返回格式:json
请求方式:get
请求示例:http://zhouxunwang.cn/data/?id=72&key=SR5RTF4G5F5Ha&text=输入的内容&type=1
请求参数说明:
名称 类型 必填 说明
type int 必填 返回模式,1:二维码图片以base64encode编码返回 2:直接返回二维码图像,默认1
key string 必填 api接口来源出key 扫码关注公众号
text string 必填 二维码内容 ,汉字,数字,字母
返回参数说明:
名称 类型 说明
error_code int 返回码
reson string 返回说明
result string 返回结果集
province string 省份
city string 城市, (北京、上海、重庆、天津直辖市可能为空)
areacode string 区号(部分记录可能为空)
zip string 邮编(部分记录可能为空)
company string 运营商
JSON返回示例:
{
	"reason": "success",
	"result": {
		"base64_image": "iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAIAAAC2BqGFAAAPPElEQVR4nO1dW2icxRefbWNM4hqpVTeNTVNLpHippCjW1FQipaUK4otBWlBIhT6IVZ+KF7D6EFsQCq19yEsi6IurtBjFC8aHEASVFi9BtE202hKi26alJlpzc8eH+fd4MpczZ2Z3P9d\/9\/ewfJczM2fOd75zmZlvNiWlFBWUHov+bQYuFVQEnRAqgk4IFUEnhIqgE0JF0AmhIuiEUBF0QqgIOilIEgkwkM1m8\/m8tfWRkRGiYG9vL8084K233kqgIzQP5aLRcY8W6M2y5Ta0UPVvMyCEEKlUqpCCUspUKqVJNrrOEqFcNFoBC4uvkkrKIGv8G1pV6RCg0fX19bfddlvhTY6Pj584ccJ194svvpidnVXHZ8+ebW9vh1u5XG50dBQTK\/mq4yNHjkxPT6vj6urqO++8UyMArFq1qrGxseB+iOHh4cnJSS41bcIxZXt7O3itfD5vejB1BW5hYnywf\/9+XG02m8U0DQ0NcKulpQUX7O3txQWVM4SCLS0tcKuhoQFzks1mccH9+\/cT\/ENBKwG+jpXAK8kwGw3aYdpEuItpXAdEzaF3ObesNOZFMEGuOvF1s\/s04m10KbyNyb00DG5QQddduK69uJqhN3mA39Du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Cy\/A6QMPPMD8CnjJkiX42ezYsQO2mhVCPPHEE8PDw5x6RJCgJycntb1IigVN3QjVwxdHR0e9\/KiqJiYmMGVnZ6e2JMPraRSam5ubm5uBnhhQNVEug0pgzaUtUDUpORUSNtqaweNwXtpCbyCIsP5lsdwAFNlrQFPGd8J0ncRdV1XmMwAybK9DbX25aLQo6gA0k0xTYdBiM3YqPKws8kfeFbhQFqbjUkBF0AmhIuiEUBF0QqgIOiFUBJ0QKoJOCBVBJ4SKoBPC3\/yPLjUTDMW6AAAAAElFTkSuQmCC"
	},
	"error_code": 0
}
服务级错误码参照
错误码 说明
00000 没有该接口
00001 参数有空
00002 key错误
00003 未办理过该业务
00004 条数不够
00005 已到期
00006 今天条数已用光
00007 您的账号不存在
10001 错误的请求KEY
10002 该KEY无请求权限
10003 KEY过期
10004 错误的OPENID
10005 应用未审核超时,请提交认证
10007 未知的请求源
10008 被禁止的IP
10009 被禁止的KEY
10011 当前IP请求超过限制
10012 请求超过次数限制
10013 测试KEY超过请求限制
10014 系统内部异常
10020 接口维护
10021 接口停用
完整教学代码示例
<?php
/**
 * Created by PhpStorm.
 * User: FZS
 * Time: 2020/07/04 22:26
 */
class freeApi
{
    private $apiUrl;

    public function __construct()
    {
        $this->apiUrl = 'http://zhouxunwang.cn/data/?id=72&key=SR5RTF4G5F5Ha&text=输入的内容&type=1';
    }

    /**
     * 获取结果
     * @return array
     */
    public function getResult()
    {
        return file_get_contents($this->apiUrl);
    }
}
package main

import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
)

const (
	APIURL   = "http://zhouxunwang.cn/data/?id=72&key=SR5RTF4G5F5Ha&text=输入的内容&type=1"
)

func main() {
	queryUrl := fmt.Sprintf("%s",APIURL)
	resp, err := http.Get(queryUrl)
	if err != nil {
		log.Println(err)
		return
	}

	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)

	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}