eLearning.edu.pl API
ENPL

Authentication

An integration client authenticates with an API key or with OAuth 2.0 client credentials. Both use the same secret; the IT administrator decides which methods the client may use.

API key

Send the secret on every request:

GET /api/v1/users HTTP/1.1
Host: https://api.elearning.edu.pl
X-Tenant-Code: your-tenant
X-API-Key: lms_live_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

OAuth 2.0 client credentials

Exchange the client id and secret for a bearer token (RFC 6749 §4.4), then use the token until it expires:

BASE_URL="${BASE_URL:-https://api.elearning.edu.pl}"

# 1. Exchange the client id and secret for a 15-minute token.
TOKEN=$(curl --fail-with-body -sS "$BASE_URL/api/v1/oauth/token" \
  -H "X-Tenant-Code: $TENANT_CODE" \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  --data-urlencode grant_type=client_credentials \
  --data-urlencode "scope=users:read compliance:read" | jq -r .access_token)

# 2. Use the token until it expires.
curl --fail-with-body -sS "$BASE_URL/api/v1/compliance/matrix?limit=10" \
  -H "X-Tenant-Code: $TENANT_CODE" \
  -H "Authorization: Bearer $TOKEN"
{"access_token": "eyJ…", "token_type": "Bearer", "expires_in": 900, "scope": "users:read compliance:read"}
GET /api/v1/compliance/matrix HTTP/1.1
Host: https://api.elearning.edu.pl
X-Tenant-Code: your-tenant
Authorization: Bearer eyJ…
  • Tokens are valid for 15 minutes. Reuse a token until it expires; the token endpoint allows only 10 tokens per minute per client.
  • scope is optional; by default the token gets all scopes of the client.
  • The client's state (disabled, revoked secret, IP allowlist, expiry) is checked on every request, so revoking a client takes effect immediately, even for tokens already issued.

Failures

Authentication failures return 401 without a reason (wrong secret, expired or disabled client, address outside the allowlist) — this is deliberate. The token endpoint returns OAuth errors (invalid_client, invalid_scope, …) as defined in RFC 6749 §5.2.

SCIM

Identity providers (e.g. Microsoft Entra ID) use a client with the scim scope. Configure the provider with:

  • Tenant URL: https://api.elearning.edu.pl/scim/v2/your-tenant
  • Secret token: the client secret (long-lived) or an OAuth token.