Getting Started - Lagoon/LagoonSecurity-API GitHub Wiki
Starting to use LagoonSecurity REST API is very simple!
All requests should be made to the subdomain provided, followed by the domain lagoonsecurity.dyndns.org:9091/api and the API version to use, as shown in following example:
https://demo.lagoonsecurity.pt/api/v1/sanitycheck
All requests to the REST API should be made with Accept Content Type set to application/json.
For integration tests we recommend Rest Console or any other client you like.
The first step is to configure Lagoon® Security with your application. To do so it is needed to create an application and a new environment (with login and password). This environment is your working area.
To configure your environment go to https://demo.lagoonsecurity.pt.
To connect to the REST API the external system should support Basic Authentication, as each request must contain those credentials in the HTTP header. No request is accepted without them.
To check if your application is ready to use and your credentials are correct use the SanityCheck and Environment Settings routes.
The Lagoon® RESTful API supports two operation modes: SaaS and non SaaS. To choose one or another access Lagoon® Security and configure your application with one of these modes.
If your application is configured as a non SaaS application it means your users and profiles are stored and accessed directly under your application. No distinction is made between them.
If your application is configured as a SaaS application you can make use of contexts. A context works as an users and profiles agglomerator, for instance if your application serves several subdomains. Once you configure your application as SaaS you cannot use non contextualized routes, being all routes in the following format:
GET /contexts/{cname}/users/{user_id}/profiles
The parameter cname reperesents the name of the context to use.
The API returns one of the following HTTP codes:
200 | Successfull request and valid response |
400 | Bad Request |
403 | Limited Permissions |
404 | Not Found |
409 | Request generated conflicts |
500 | For all other invalid requests |
503 | Unkown erros or temporarily unavailable |