调用示例


所有接口请求时,在请求头中需包含 apiKey、accessToken这几个字段(登录接口例外,不需要accessToken)。

步骤1.通过身份验证,获得有效的Access Token;

调用 clientLogin接口,请求头中需包含apiKey字段,提交正文内容为点睛账号的账户名和密码(加密后),如下代码示例(本文档中的示例均为curl命令行):

curl --header "apiKey:40abcddafdf53323123213323" https://api.e.360.cn/account/clientLogin --data "username=test&passwd=f18dfadsf123d123dadbc7878f2f"

如果上述请求正确的话,服务端会返回如下的信息:

{
    "uid": "2563420133",
    "accessToken": "04128023d48837ecaee4e15367c1cc7c4e65f0ecea5a747db"
}

注:此处uid为转码后的uid

步骤2.利用上一步拿到的Access Token调用其他接口;

其他接口的请求头中,需至少包含apiKey、accessToken字段,如下方示例(获取账户信息 account/getInfo):

curl --header "apiKey:axxxxxxxxxx67d0d0f" --header "accessToken:1sgmenxxxxxxxzw7zp2sp7hnhtu56hpv2gjsenj" https://api.e.360.cn/uc/account/getInfo

如果上述请求正确的话,服务端会返回如下的信息:

{
    "uid": "160185657",
    "userName": "点睛广告测试",
    "email": "wangxintong11@360.com",
    "category": "KA一户通",
    "agency": "qd深圳市力玛",
    "companyName": "奇虎科技股份有限公司",
    "industry1": "医疗健康",
    "industry2": "专科-其他",
    "balance": 28407.76,
    "budget": "0.00",
    "mvBudget": "300.00",
    "appBudget": "920.00",
    "resources": "search",
    "status": "1",
    "allowDomain": "https: //www.lou.com,dartsearch.net,24k.hk,123.COM2",
    "allowMobileDomain": "http: //site.mvad.com,http: //sina.cn,http: //site.yfjianzhan.com",
    "allowDevice": "3",
    "isMedical": "1"
}

注:此处uid为不转码的真实uid

results matching ""

    No results matching ""