POST api/common/getad

获取广告或友情链接,缓存1小时

默认返回json数据,若要返回xml格式数据在访问地址后加上xml=true

Request 信息

URI 参数

None.

Body 参数

参数

AdModel
名称说明数据类型附加信息
AdCode

广告编码

string

None.

IsShowHtml

是否显示HtmlCode

boolean

None.

City

城市

string

Required

Token

token

string

Required

Platform

string

None.

Request 数据格式

application/json, text/json

示例:
{
  "AdCode": "sample string 1",
  "IsShowHtml": true,
  "City": "sample string 3",
  "Token": "sample string 4",
  "Platform": "sample string 5"
}

application/xml, text/xml

示例:
<AdModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models.API.Common">
  <Platform xmlns="http://schemas.datacontract.org/2004/07/API.Models.API">sample string 5</Platform>
  <Token xmlns="http://schemas.datacontract.org/2004/07/API.Models.API">sample string 4</Token>
  <City xmlns="http://schemas.datacontract.org/2004/07/API.Models.API">sample string 3</City>
  <AdCode>sample string 1</AdCode>
  <IsShowHtml>true</IsShowHtml>
</AdModel>

application/x-www-form-urlencoded

示例:

Response 信息

输出返回说明

结果

AdResult
名称说明数据类型附加信息
Ads

获取到的广告

Collection of Ad

None.

ErrorCode

API错误码

APIErrorCode

None.

Msg

附带消息

string

None.

Response 返回数据格式

application/json, text/json

示例:
{
  "Ads": [
    {
      "Name": "sample string 1",
      "Link": "sample string 2",
      "ImgSrc": "sample string 3",
      "Id": 4,
      "HTMLCode": "sample string 5",
      "PositionCode": "sample string 6"
    },
    {
      "Name": "sample string 1",
      "Link": "sample string 2",
      "ImgSrc": "sample string 3",
      "Id": 4,
      "HTMLCode": "sample string 5",
      "PositionCode": "sample string 6"
    }
  ],
  "ErrorCode": 0,
  "Msg": "sample string 1"
}

application/xml, text/xml

示例:
<AdResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.Models.API.Common">
  <ErrorCode xmlns="http://schemas.datacontract.org/2004/07/API.Models.API">SUCCESS</ErrorCode>
  <Msg xmlns="http://schemas.datacontract.org/2004/07/API.Models.API">sample string 1</Msg>
  <Ads>
    <AdResult.Ad>
      <HTMLCode>sample string 5</HTMLCode>
      <Id>4</Id>
      <ImgSrc>sample string 3</ImgSrc>
      <Link>sample string 2</Link>
      <Name>sample string 1</Name>
      <PositionCode>sample string 6</PositionCode>
    </AdResult.Ad>
    <AdResult.Ad>
      <HTMLCode>sample string 5</HTMLCode>
      <Id>4</Id>
      <ImgSrc>sample string 3</ImgSrc>
      <Link>sample string 2</Link>
      <Name>sample string 1</Name>
      <PositionCode>sample string 6</PositionCode>
    </AdResult.Ad>
  </Ads>
</AdResult>