Once you have generated your API key, you need to include it in the header of each API request. The API key is passed in the header using the following format:
Copy
Ask AI
x-api-key: YOUR_API_KEY
Example RequestHere is an example of how to include the API key in a cURL request:
Copy
Ask AI
curl -X GET https://public.api.micro1.ai/interview \-H "x-api-key: YOUR_API_KEY"
Header Details
Header Name: x-api-key
Header Value: YOUR_API_KEY
Replace YOUR_API_KEY with the actual API key you generated from the client portal.
Error HandlingIf your API key is missing, invalid, or expired, the API will respond with an error. Below are common HTTP status codes related to authentication:
401 Unauthorized: The request was made without a valid API key or the key was incorrect.
403 Forbidden: The API key does not have the necessary permissions to access the requested resource.
Example Error Response
Copy
Ask AI
{ "status": false, "message": "Unauthorized: API key is missing or invalid."}