has offers 文档翻译


入门品牌API

要求

  • 为了使用该API,您的网络必须是对企业定价计划或专用的解决方案。
  • 所有的请求都需要一个API密钥,这是一个随机生成的字符串独特到您的网络。
  • 使请求的IP地址必须被提交到白名单的API访问已。
  • 此外,所有的请求需要您的网络ID。

创建API密钥

  • API密钥可以从应用程序中创建:
    • 登录到应用程序,并悬停在导航栏的支持选项卡,然后单击从下拉列表中选择“API”链接。
    • 如果你不已经有一个API密钥将有导航栏下方的通知的链接来创建一个。
    • 一旦你创建了一个,页面会显示您的私有API密钥。它会以字母“NET”。
  • 您也可以向您的客户经理有关创建和获取您的API密钥

虽然名单IP地址

  • 白名单的IP地址可以从应用程序中加入:
    • 将鼠标悬停在导航栏的支持选项卡,然后单击从下拉列表API链接。
    • 这里将是你的API密钥提交的IP地址白名单下的一个盒子。
  • 附加IP地址可以使用API方法被添加到同时列表: 应用:: whitelistNetworkApiIp

速率限制

  • 网络被限制在50 API调用每10秒。如果您需要更高的限制,请联系您的客户经理。

提出请求

您的网络的API密钥和网络ID用于认证通过API请求。每个API请求必须有一个有效的API密钥和网络ID组合。当进行API请求,用于你的API Key值NetworkToken参数,并为您的网络ID NetworkId参数。

用法示例

  • 网络ID是演示
  • API密钥是 NETabc123
  • 要求是 Offer:: findById
  • 报价ID是42
  • 请求URL:

  • https://api.hasoffers.com/Api/json?NetworkId=demo&NetworkToken=NETabc123&Target=Offer&Method=findById&id=42
  • Sample Response:
    {
      "request": {
        ...collapsed JSON data
      },
      "response": {
        "status": 1,
        "httpStatus": 200,
        "data": {
          "Offer": {
            "id": "42",
            "name": "My Test Offer"
          }
        },
        "errors": [],
        "errorMessage": null
      }
    }
    		









Getting Started with the Brand API

Requirements

  • In order to use the API, your network must be on the Enterprise pricing plan or a Dedicated solution.
  • All requests require an API Key, which is a randomly generated string unique to your network.
  • IP address making request must have been submitted to the white-list for API access.
  • Additionally, all requests require your Network ID.

Creating an API Key

  • API keys can be created from within the application:
    • Log into the application and hover over the Support tab in the Navigation Bar, and click on the "API" link from the drop-down.
    • If you don't already have an API Key there will be a notice underneath the Navigation Bar with a link to create one.
    • Once you've created one, the page will display your private API Key. It will begin with the letters 'NET'.
  • You can also talk to your Account Manager about creating and obtaining your API Key

While-list IP Address

  • White-listing an IP address can be added from within the application:
    • Hover over the Support tab in the Navigation Bar and click on the API link from the drop-down.
    • There will be a box underneath your API Key to submit an IP address to whitelist.
  • Additional IP addresses can be added to the while-list using the API method: Application::whitelistNetworkApiIp

Rate Limiting

  • Networks are limited to 50 API calls every 10 seconds. If you require a higher limit, please contact your account manager.

Making a Request

Your Network's API Key and Network ID are used to authenticate requests through the API. Every API request must have a valid API Key and Network ID combination. When making an API Request, use your API Key value for the NetworkToken parameter, and your Network ID for the NetworkId parameter.

Example Usage

  • Network ID is demo
  • API key is NETabc123
  • Request is Offer::findById
  • Offer ID is 42
  • Request URL:
    https://api.hasoffers.com/Api/json?NetworkId=demo&NetworkToken=NETabc123&Target=Offer&Method=findById&id=42
  • Sample Response:
    {
      "request": {
        ...collapsed JSON data
      },
      "response": {
        "status": 1,
        "httpStatus": 200,
        "data": {
          "Offer": {
            "id": "42",
            "name": "My Test Offer"
          }
        },
        "errors": [],
        "errorMessage": null
      }
    }
    		


上一篇:《 C++程序设计:原理与实践(进阶篇.》导读


下一篇:自制操作系统Antz day11——实现shell(下)命令响应