EUNSports offers different API's through a set of REST based web services, which are delivered in JSON and XML formats.Authentication of client is first step before hitting any end point.
List of API's:
1. Fixtures Api.
2. Head2Head Api.
3. Leagues Api.
4. LiveScore Api.
5. PlayerStats Api.
6. StandingTable Api.
Authentication
Authentication is based on JSON Web Token implementation.
Here are steps to get JWT token:
1. Client sends username/password (recommended : over SSL) in Authorization header with Basic auth scheme to AuthenticationService (its details can be found in the respective section of this document).
2. AuthenticationService validates the username/password, generates the jwt-token and sends back in the response body. Client receives the jwt-token and saves it.
3. Received jwt-token will be sent with each request to stats api in the Authorization header with Bearer auth scheme. All stats api services validates the jwt-token in the Authorization header and serves the required data.
4. Every jwt-token expires after 12 hours but its refresh time is 48 hours which means you need to give a call to AuthenticationService to get the new jwt-token through refresh token or you can hit again AuthenticationService to get new access token.
Authentication Service Response Example:
{"access_token":
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NTkyNDI2OTYsInVzZXJfbmFtZSI6Imhhc2VlYiIsImF1dGhvcml0aWVzIjpbIlVzZXJNYW5hZ2VtZW50IiwiUmVPcGVuTWF0Y2giLCJSZXN1bHRBZGRpdGlvbiIsIkZpeHR1cmUiLCJXYXRjaERvZyJdLCJqdGkiOiI3NjliNjFiYy04NzJiLTRiMzktOTEzMy0xNGFlMTZmZTIyYWIiLCJjbGllbnRfaWQiOiJjbGllbnQiLCJzY29wZSI6WyJyZWFkIiwid3JpdGUiXX0.VhulwpvqgU1_HJ3lKqEcd0ZFAoR1_bWxxpC2Z95e6MU",
"token_type" : "bearer",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NTkzNzIyOTYsInVzZXJfbmFtZSI6Imhhc2VlYiIsImF1dGhvcml0aWVzIjpbIlVzZXJNYW5hZ2VtZW50IiwiUmVPcGVuTWF0Y2giLCJSZXN1bHRBZGRpdGlvbiIsIkZpeHR1cmUiLCJXYXRjaERvZyJdLCJqdGkiOiI2MTkwMmMwZi0wNDg2LTQyYWUtOWUzZi1iMzBlODkyOGYwMWYiLCJjbGllbnRfaWQiOiJjbGllbnQiLCJzY29wZSI6WyJyZWFkIiwid3JpdGUiXX0.NC9YTyf-BmpuCKbZVNGmdJ1tKBJGmuH7bHzhEMWNiIs",
"expires_in": 43199,
"scope": "read write",
"jti": "769b61bc-872b-4b39-9133-14ae16fe22ab"
}