EmailEngine uses Bearer authorization. When making API requests, you have to set an Authorization header with the Bearer scheme.
Authorization: Bearer <token>
Where
<token>
is the access token you generated on the access tokens page
For example, if you have generated a token with the value of "abcdef", then you can make requests with curl
using the following arguments:
$ curl http://127.0.0.1:3000/v1/stats -H "Authorization: Bearer abcdef"
{
"version": "2.8.0",
"license": "AGPL-3.0-or-later OR LICENSE_EMAILENGINE",
"accounts": 2,
"node": "16.13.1",
...
Alternatively, if you are unable to set HTTP headers, you can pass the token as a query argument access_token
.
$ curl http://127.0.0.1:3000/v1/stats?access_token=abcdef"