RiskIQ/python_api

implement new landing page create API params

johannestaas opened this issue · 1 comments

Three new landing page create (and bulk create) API parameters were added.
device.ua - an optional user agent. We will determine the platform of the user agent and use the browser type that matches that platform. If we aren't able to determine the platform of the user agent, then we fallback to normal browser type selection based on the project.
device.ip - an optional ipv4 address. We will determine which country the ip address is located in, and select a proxy for crawling in that country. Only standard and residential proxies are included right now. If we can't find a proxy in the country the IP was submitted for, we fail gracefully with a relevant error message.
site.page - an optional url indicating the page the creative is displayed on. We will use this as the referrer. If the url is not valid, we fail gracefully with a relevant error message.

Example of how new parameters can be passed to API:

ENDPOINT=https://ws.riskiq.net/v1

curl -v -H 'Accept: application/json' --basic -u ${TOKEN}:${PRIVATE_KEY} \
  "${ENDPOINT}/landingPage" -H "Content-Type: application/json" \
  -d '{ "url": "http://xkcd.com/1687/", "site" : {"page" : "http://www.ref.com"}, "device": { "ua" : "Mozilla/5.0 (Linux; U; Android 1.5; de-de; Galaxy Build/CUPCAKE) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1" , "ip" : "207.141.11.26" } }'