How to programmatically get a list of my LinkShare merchants domains

早过忘川 提交于 2019-12-06 13:27:38

问题


I would like to know if there is an API I can use to get a LinkShare merchant domain URL. The merchant search endpoint only returns their uid and name.


回答1:


According to the Linkshare help docs you can get a list of default URLs for all advertisers in your program (by joining data from two APIs), but those will still be affiliate links on Linkshare redirect domains. You would then need to write a script to visit those links and return the final destination URL, then grab the root domain of the URL.

Steps:

  1. Follow the instructions here: http://helpcenter.linkshare.com/publisher/questions.php?questionid=1030
  2. Write a script in your language of choice to cURL the affiliate link and grab curl_getinfo(curl_init(), CURLINFO_EFFECTIVE_URL); to see where it's redirecting to.
  3. Parse the response with a RegExp to grab just the root domain like http[s]?://([^/]+)



回答2:


This is a duplicate of this Stack Overflow question this is what worked for me:

The following URL will allow you to get a list of merchants with data that you have permission to access without the need to login. It will return an XML list of your merchants:

http://findadvertisers.linksynergy.com/merchantsearch?token=YOUR_LINKSHARE_ACCESS_TOKEN


来源:https://stackoverflow.com/questions/18160456/how-to-programmatically-get-a-list-of-my-linkshare-merchants-domains

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!