Here’s a detailed explanation for the API, including status codes, error messages, and successful responses, aimed at helping developers work with your API.
1. Register for an API Key
Endpoint: POST /api/developers/register• Description: Developers can register for an API key by providing their LinkedIn and endpoint. Once registered, you will receive an API key via email. Keep in mind that only logger in users can register themselves.
• Request Headers:
• Content-Type: application/json
• Cookie: User login token for authentication.
• Request Body:
• Possible Responses:
• 200 OK:
• 400 Bad Request:
• 401 Unauthorized:
2. Check API Usage
Endpoint: GET /api/developers/usages• Description: Developers can check their current API usage, including the number of calls made in the current month and the previous months. Default number of calls per month is 1000. To get more quota tag me on twitter or linkedIn to show what you are building.
• Request Headers:
• Cookie: User login token for authentication.
• Possible Responses:
• 200 OK:
• 401 Unauthorized:
3. Retrieve Contest Data Using API Key
Endpoint: GET /api/developers/contests/yourApiKey• Description: Fetch all available programming contests. Developers must provide their API key in the URL.
• Request Parameters:
• apiKey: The API key provided upon registration.
• Possible Responses:
• 200 OK:
• 400 Bad Request:
• 429 Too Many Requests:
Status Codes Summary
• 200 OK: The request was successful.
• 400 Bad Request: Invalid input, such as missing parameters.
• 401 Unauthorized: The user must be authenticated (logged in) or has provided an invalid API key.
• 403 Forbidden: The user’s email is not verified.
• 404 Not Found: The requested resource (user or contest) was not found.
• 429 Too Many Requests: The developer has exceeded their monthly quota.
• 500 Internal Server Error: Something went wrong on the server.