API Keys are unique alphanumeric strings or tokens that are used to authenticate and authorize access to the Search API.
Authentication: API keys serve as a form of identification for applications or users accessing an API. By including the API key in API requests, the API can verify the identity of the requester and ensure that only authorized applications or users can access its resources.
Authorization: API keys also play a role in authorization, determining what actions or resources the requester is allowed to access. The API key may be associated with certain permissions or roles that define the level of access and functionality available to the requester.
Security: API keys enhance the security of an API by preventing unauthorized access. With a unique API key, the API provider can track and monitor API usage, enforce usage limits, and implement security measures such as rate limiting, throttling, and access control.
Usage Tracking: API keys allow API providers to track and monitor how their API is being used. They can collect data on the number of requests made, the endpoints accessed, and other metrics that help analyze usage patterns and optimize API performance.
In Search API the API generations requires for a user to be authenticated, meaning Authentication must be enable
Copy the resulting API Key and apply it to every request sent to the Search API as a header
Authorization: Search <API KEY>
All the request made to the Search API must include the Authorization: Search <API KEY>
Here an example calling the Search Endpoint using the API Key
curl -X 'POST' \ 'http://localhost:8085/es/api/v1/search/' \ -H 'accept: application/json' \ -H 'Authorization: Search U2VhcmNop1orHY8nL535WF2pb-BwVUcvtR0vkwgtlRLWz_I96S' \ -H 'Content-Type: application/json' \ -d '{ "q": "testing", "size": 25, "page": 1 }'