I am building a sports app as a side project to help learn Ruby on Rails and about API's, but after a lot of searching around, I haven't found any clear instructions on where (or what) I am supposed to paste the API request in Rails.
The sample link for the API I want to use looks like this..
https://soccer.sportmonks.com/api/v2.0/leagues?api_token={API_TOKEN}
"data": [
{
"id": 271,
"active": true,
"type": "domestic",
"legacy_id": 43,
"country_id": 320,
"logo_path": "https://cdn.sportmonks.com/images/soccer/leagues/271.png",
"name": "Superliga",
"is_cup": false,
"current_season_id": 17328,
"current_round_id": 199450,
"current_stage_id": 77447994,
"live_standings": true,
"coverage": {
"predictions": true,
"topscorer_goals": true,
"topscorer_assists": true,
"topscorer_cards": true
}
}
]
I understand a lot of what I'm looking at there, the need for the API token, and how it can be customized, but I'm confused as to where in my Rails files this would be posted? In the HTML structure? In the Javascript folder? How do I take this from the source API website and put it on mine?
I've been looking around for a while but all I see are instructions on how to build your own API, not use someone else's on your webpage.
Any resources or help would be greatly appreciated. I love the idea of the flexibility of API's from a theoretical perspective and look forward to working with them, I just need to figure out where or what I should be looking to cut/paste.
Edit: here is an example github of what it's supposed to look like, but I still don't see where I actually input the exact location of the link. https://github.com/vnnoder/sportmonks-ruby