0

For some reasons I can't print any results from the European Groupon API feeds while the US feed works fine:

The US feed URL can be found on the US Groupon site - see: https://partner-api.groupon.com/help/deal-api (Scroll down to "Location Sample Calls").

See below my PHP code to print the results from the US feed in XML, this works fine i.e. I can print the results from the Groupon API.

<?php
$xml=simplexml_load_file("https://partner-api.groupon.com/deals.xml?tsToken=US_AFF_0_201236_212556_0&division_id=amarillo&offset=0&limit=10") or die("Error: Cannot create object");
print_r($xml);
?>

Now when I try one of the European countries feed with exactly the same code, I cannot print any results and I have the following error: Error: Cannot create object.

For the EU, The feed URL can be found on the EU Groupon site - see: https://partner-int-api.groupon.com/help/deal-api (Scroll down to "Location Sample Calls").

See below my PHP code to print the results from the IE feed in XML, this does not work while the code is exactly the same as the US above, what's strange is that it works in Xampp, and it also works if you call the IE feed URL in a browser. But I can't print any results when I put that piece of code below on my server and call it in my browser while it works fine with the US.

Thanks for your help.

<?php
$xml=simplexml_load_file("https://partner-int-api.groupon.com/deals.xml?country_code=IE&tsToken=IE_AFF_0_200012_212556_0&division_id=dublin&offset=0&limit=20") or die("Error: Cannot create object");
print_r($xml);
?>
Parfait
  • 104,375
  • 17
  • 94
  • 125
Seb
  • 83
  • 1
  • 10
  • Not quite exactly the same as US feed limits to 10 and Ireland feed limits to 20. Nonetheless, both URLs are valid as XMLs. Can you not navigate to them with browser? – Parfait Sep 18 '16 at 13:28
  • Thanks for your time Parfait. I don't have any problems to call the XML URL from Ireland in my browser nor with Xampp. It's just that when I upload the piece of code above on my server, I got not results but this error: Error: Cannot create object. Must be something with my server, a permission or something. But it works with the US feed and we all the API feeds I'm using so I don't understand. – Seb Sep 18 '16 at 15:52
  • Yes, it must be your server as both block of code work. Maybe try on another machine? – Parfait Sep 18 '16 at 19:20

0 Answers0