Forums / Developer Forum
Order: Newest / Oldest
[Question] Using API & Retrieve ID
Tezcor (Real Madrid) 4 years ago
Hello,

First, I want to know how to use the API functions in PHP code (how do you call the functions?).
Could I have an example?

Then do I know where is the list of id_league, id_player, team_id, etc....

Thank you very much,

Ps: Forgive the mistakes, I do not speak English (Google Translation).
Matt (Footytube Staff) 4 years ago
The ID's that you list are retuned in the appropiate methods. We will be putting up an example PHP case shortly
Tezcor (Real Madrid) 4 years ago
Hi,

Can you explan me how I use the API functions. How is the appeal? It's PHP? Javascript? For a link?

If you have a small example, a few lines to understand the appeal. Fits me, because I do not understand at all.... Thank you
Matt (Footytube Staff) 4 years ago
All the API methods work on a web pull basis so you simply need to have the ability to get the response to the listed method url. Then you simply need to break down the return and display as you see fit.
For example in PHP:

$return = file_get_contents(method_url+required PARAMETERs);
Echo $return;

The above will print out the raw return from any given valid method url
Tezcor (Real Madrid) 4 years ago
I want to retrieve the i'd of championships (English, French, Spanish, German) etc....

I use league. GetIdents but I do think that the cup, there are no championships (Ligue 1 (FRA) Premier League (ENG), Liga (ESP), etc....)
What should I do to get them?

Thank you
Matt (Footytube Staff) 4 years ago
Getidents will return a list of all the leagues we support in the format shown here Link: www.footytube.com/openfooty/service.php?package=Le...
Tezcor (Real Madrid) 4 years ago
GetIdents returns me 50 results, but there are many more in your database. How to get the others?    Thx,
Matt (Footytube Staff) 4 years ago
The results are paged at 50 per page so you will need to move through the pages to get all the ID's.

To do so simply use the GET variable &page=1 and increase the page number. In the element leagues there are the attributes hasMorePages and nextPage these will tell you if there are more pages and what the next page number is



   
Kick4Life - changing lives through football