Question by thevinylhub · May 11, 2015 at 12:33 AM · ebayPHPebay-api
Implementing API in ebay live listing template
I have finally mastered the ebay finding api call using php but am stumped on actually implementing it into ebay itself, I just can find any information on using the calls live within the site
any pointers would really be appreciated.
thanks
Answer by clickimusprime · May 11, 2015 at 06:13 AM
You can't inject PHP into eBay's pages. You can use limited Javascript depends on what the site supports.
People who like this
Answer by helios825 · May 11, 2015 at 10:11 AM
I agree with clickprime. While I'm no JS expert, it would be my guess that you'd need to use JS in some form within eBay pages to display data returned from the eBay API.
And to hide your AppID there, you'd probably want to setup a server on your end to act as a proxy to relay requests from the JavaScript in the listings on to the eBay API. That way you could keep your AppID and related keys/tokens private on your server-side, while still serving the JS client software you write.
You'd also want to implement some amount of intermediary monitoring and security layers at your server, so you don't relay each and every proxy call to API, opening your eBay Dev account to vicarious abuse. You'd want to cache data, block certain bots and other user-agents, perhaps throttle request by time window and IP address, etc.
People who like this
Answer by thevinylhub · May 11, 2015 at 06:21 PM
I have seen listings using js to link to a php page I have tried this using doc write function in php to no avail im completely stumped but thanks for the replies.
People who like this
Answer by clickimusprime · May 11, 2015 at 07:08 PM
I have seen listings using js to link to a php page I have tried this using doc write function in php to no avail im completely stumped but thanks for the replies.
A typical model would be: include JS in the page. The JS does Ajax calls to your server where a PHP script handles the requests and returns data/HTML to the JS. The JS receives, formats and displays the results.
Trying to use document.write in PHP (which doesn't exist) in not a valid approach.
some examples here: http://stackoverflow.com/questions/1280767/how-do-i-run-php-code-when-a-user-clicks-on-a-link
People who like this
Answer by thevinylhub · May 11, 2015 at 07:56 PM
Hi clickprime thanks for that I will give it a try now
People who like this
Your answer
