-
Bastien DUMONT authoredBastien DUMONT authored
routes.md 2.36 KiB
Routes
This section explains the different API route. Descriptions are not currently up-to-date.
A swagger documentation can be consulted at http://localhost:3000/api/doc/
Auth
-
api/auth/signin
: It is used for local and dev authentication. It is linked to two different password into the database. -
api/auth/token
: It is used for generate one token. Only for internal process. This route is not call from another apps. -
api/auth/token/check
: It is used for check one token. It is called from cozy-stack service of the usager. -
api/auth/token
: It is used for generate one token. Only for internal process. This route is not call from another apps. -
api/auth/login
: It is used for Sign&Go authentication. Linked to AuthStrategy. -
login/callback
: Get the authentication from Sign&Go process.
Beneficiary
-
/api/beneficiaire
: Get all usager known from Postgre database. -
/api/beneficiaire/create'
: This route is used in order to store Usager domain and his trigger process from Cozy. This route is protected by a COZY_SECRET env variable token. This token is generated by us. If you change it, you need to inform Cozy team because this token is store in their side also. -
/api/beneficiaire/remove'
: This route is used in order to remove Usager domain and his trigger process. Only available by POST. This route is not accessible from any part of TS FRONT application. Protected rout by the same token of create route.
Add one beneficiary by Postman
- Create a POST request
- Entry the URL: http://localhost:3020/api/beneficiaire/create or https://pilote-agent-rec.grandlyon.com/api/beneficiaire/create
- Push in Authorization/ Bearer Token => the token use by "process.env.COZY_SECRET"
- In Body, as JSON format example :
{
"cozy_name":"pilote-rec.cozy.self-data.alpha.grandlyon.com",
"trigger":"https://pilote-rec.cozy.self-data.alpha.grandlyon.com/jobs/webhooks/d010bf3fa2aed6f3c6584ea93a54affc"
}
- Local :
{
"cozy_name":"pilote.cozy.tools:8080",
"trigger":"http://pilote.cozy.tools:8080/jobs/webhooks/"
}
Cozy
-
api/redirect/cozy
: Allow to send information to the cozy-stack in order to run smsProcess on cozy-stack side.
Users
Authentication only used for local or dev environment because Sign&Go is only available for rec and prod env.