Getting Started
This guide will help you get up and running with the ESFA Backend API quickly. Follow these steps to make your first API call.
Prerequisites
Before you begin, ensure you have:
API Credentials: Your
apiKeyandsecretKeyprovided by your administratorDevelopment Environment: A tool to make HTTP requests (curl, Postman, or your preferred HTTP client)
Game Match Data: Valid
gameCodeandmatchIdfor testing
Step 1: Obtain a Bearer Token
All ESFA Backend API endpoints require authentication. You'll need to obtain a Bearer token from the Authentication Service first.
Request Authentication Token
Make a POST request to the Authentication Service:
Endpoint: https://auth.your-service.tld/v1/oauth/token/machine
Headers:
Request Body:
Example with curl
Expected Response
Step 2: Make Your First API Call
Now you can use the Bearer token to call ESFA Backend API endpoints.
Get Match Information
Let's retrieve information about a game match:
Endpoint: GET /api/v1/games/{gameCode}/matches/{matchId}
Headers:
Example with curl
Expected Response
Step 3: Submit Match Results
When a match is complete, you can submit the final results:
Endpoint: POST /api/v1/games/{gameCode}/matches/{matchId}/finish
Headers:
Request Body:
Example with curl
Expected Response
A 204 No Content response indicates the results were successfully processed.
Complete Workflow Script
Here's a complete bash script that demonstrates the full workflow:
Common Issues and Solutions
Token Expired (401 Unauthorized)
Problem: You receive a 401 Unauthorized response from the Backend API.
Solution: Your token may have expired. Repeat Step 1 to obtain a fresh token.
Invalid Credentials (401 from Auth Service)
Problem: The Authentication Service returns 401 Unauthorized.
Solution: Verify your apiKey and secretKey are correct.
Match Not Found (404)
Problem: You receive a 404 Not Found when calling match endpoints.
Solution: Verify the gameCode and matchId are valid and exist in the system.
Next Steps
Now that you've made your first API calls:
Explore Endpoints: Learn about all available API endpoints
Handle Errors: Understand error handling patterns
View Examples: Check out more code examples
Read Schemas: Review detailed schema documentation
Need Help?
Troubleshooting: Check our troubleshooting guide
API Reference: Browse the complete API documentation