API v1 Introduction
The LifePeaks.dk API is organized around REST. Our API accepts JSON-encoded requests, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
The LifePeaks.dk API is based on the principles of Representational State Transfer (REST) allowing clients to create, view, modify and delete resources using standard HTTP request methods with OAuth2 authentication.
Endpoint groups
Every v1 endpoint is listed below. The complete request and response shapes are described in the v1 API reference, generated from the v1 OpenAPI specification.
| Group | Endpoints |
|---|---|
| Authorization | POST /token, POST /oauth2/revoke |
| Actions | GET /action/ping, POST /action/list, POST /action/analytics, POST /action/claimed-items, GET /action/subscribers |
| Item | GET /item/{code}, POST /item/{code}/resend, POST /item/{code}/claim, POST /item/{code}/refund, POST /item/{code}/cancel, POST /item/{code}/activate, POST /action/create-gc |
| Order | POST /order/{order_id}/claim, POST /order/{order_id}/capture |
| Events | POST /event/list, POST /event/{slug}/participants |
| Lists | GET /list/gc-value-modifications |
Alongside these, /authorize, /login and /logout serve the browser-based authorization code flow — see Authorization of Request.
Scopes and user rights
Access is controlled by two independent things: the scope attached to the OAuth2 client, and the user right of the API user the token belongs to.
| Scope | What it permits |
|---|---|
admin | Every endpoint. |
zapier | GET /action/subscribers. |
Most endpoints require the admin scope. GET /action/subscribers performs no scope check at all — any authenticated token reaches it, and the company is taken from the token holder. Claim, refund and event endpoints additionally reject users whose user right is agency_user.
Recommended reading
- HTTP: http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
- Headers: http://en.wikipedia.org/wiki/List_of_HTTP_headers
- Basic access authentication: http://en.wikipedia.org/wiki/Basic_access_authentication
- OAuth authentication: https://en.wikipedia.org/wiki/OAuth
- Status codes: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
- REST: http://en.wikipedia.org/wiki/Representational_State_Transfer
- JSON: http://en.wikipedia.org/wiki/JSON
Where to go next
- Authorization of Request — obtaining an OAuth2 access token
- Authorization via curl — password grant example
- API info — base URLs, support contact, and terms of service
- Data — encoding, dates, languages, and request GUIDs
- Testing — developer and demo environments
- FAQ — token lifetimes and common errors
- v1 API reference — the full OpenAPI specification