Sumo Logic supports the following options for API authentication:
- Access ID and access key
- Base64 encoded access id and access key
See Access Keys to generate an access key. Make sure to copy the key you create, because it is displayed only once.
When you have an
accessKey you can execute requests such as the following:
curl -u "<accessId>:<accessKey>" -X GET https://api.YOUR_DEPLOYMENT.sumologic.com/api/v1/collectors?limit=2
Where YOUR_DEPLOYMENT is either us1, us2, eu, de, or au. For us1, use
api.sumologic.com. For the others, use
api.us2.sumologic.com, and so on. For more information, see Sumo Logic Endpoints.
If you prefer to use basic access authentication, you can do a Base64 encoding of your
<accessId>:<accessKey> to authenticate your HTTPS request. The following is an example request, replace the placeholder
<encoded> with your encoded access id and access key string:
curl -H "Authorization: Basic <encoded>" -X GET https://api.YOUR_DEPLOYMENT.sumologic.com/api/v1/collectors?limit=2
For example, in most Linux distributions you can use the 'base64' command. If access id was
Aladdin and your access key was
OpenSesame then the command would be as follows:
echo -n "Aladdin:OpenSesame" | base64
This would yield a Base64 encoded string 'QWxhZGRpbjpPcGVuU2VzYW1l' that is used like this:
"Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l"
A rate limit of four API requests per second (240 requests per minute) applies to all API calls from a user. If the rate is exceeded, a rate limit exceeded (429) error is returned.