Forums / Developer Forum
Order: Newest / Oldest
REQUEST: PHP Sample Classes
Lee (Kidderminster Harriers) 4 years ago
Hey Guys,

A few of our API users have asked for PHP sample classes for accessing the API. If any of you have put together a robust framework for accessing some of our methods, it would be super lovely if you could consider 'donating' them to the developer community here.

Cheers!
Barryrlmurphy (Liverpool) 4 years ago
I would if I could get an API key? But I can't get any response?
GarfLloydell (FC København) 3 years ago
These are the request/response classes I'm using to interact w/ the OpenFooty API. They're still pretty bare bones, but they get the job done. You can look at the comments in the request class for a bit more detail on usage, there's no comments for the response class since it doesn't do much but parse and return data.

OpenFooty_Request Class : Link: pastie.org/2220179
OpenFooty_Response Class : Link: pastie.org/2220187

Note that you'll need to update the request class with your personal API key and useragent string, otherwise you won't get anywhere.

Basic Usage :

$response = OpenFooty_Request::execute('team', 'getInjuredPlayers', array('team_id' => 600));
$data = $response->getData();

Let me know if you run into any issues using these, I'll do what I can to help ya out
Tr4ssj2 (Arsenal) 2 years ago
I'm getting the following error:

Fatal error: Class 'HttpRequest' not found in

I think it's because the class requires PECL_http. Do you have a more PHP friendly way of send the requests?



   
Kick4Life - changing lives through football