JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Gallery
Shippr
Kabaun
More
Share
Explore
Kabaun
API REST
1) API Documentation
Redoc
Swagger
2) Générer un Token JWT
Plus d’nfos sur les
token jwt
Durée de vie du token : 1h
USERAPI=<your_user>
USERPASSWORD=<your_password>
ACCESS_TOKEN=`
curl -L -X POST "https://auth.kabaun.earth/realms/openplatform/protocol/openid-connect/token" \
-H "Content-Type
:
application/x-www-form-urlencoded" \
-d "client_id=carbon-api" \
-d "grant_type=password" \
-d "scope=openid" \
-d "username=$USERAPI" \
-d "password=$USERPASSWORD" | jq -r ".access_token"`
3) Génération d’activités
Authorization
: Bearer <token>
Companyid
: <companyid> (recuperable depuis
Kabaun admin
)
Pour créer des activities il faut utiliser les routes activity ou activities.
Schema du json
A) Test avec la doc Swagger
Exemple pour activity
{
"name": "OT 11122",
"startDate": "04/19/2023",
"endDate": "04/19/2023",
"incertitude": 10,
"activityValue": 200,
"correctiveCoefficient": 19,
"impactId": 829
}
Exemple pour activities
{
"activities": [
{
"name": "OT 11122",
"startDate": "04/19/2023",
"endDate": "04/19/2023",
"incertitude": 10,
"activityValue": 200,
"correctiveCoefficient": 19,
"impactId": 829
},
{
"name": "0T 11122",
"startDate": "04/19/2023",
"endDate": "04/19/2023",
"incertitude": 10,
"activityValue": 255,
"correctiveCoefficient": 10,
"impactId": 830
}
]
}
B) Test avec Curl
COMPANY_ID=<your_companyid>
Exemple pour activity
curl -XPOST \
"https://api.kabaun.earth/activity/" \
-H "accept: application/json" \
-H "company-id: $COMPANY_ID" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d ' {
"name": "OT 11122",
"startDate": "04/19/2023",
"endDate": "04/19/2023",
"incertitude": 10,
"activityValue": 200,
"correctiveCoefficient": 19,
"impactId": 829
}'
Exemple pour activities
curl -XPOST \
"https://api.kabaun.earth/activity/activities/" \
-H "accept: application/json" \
-H "company-id: $COMPANY_ID" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"activities": [
{
"name": "OT 11122",
"startDate": "04/19/2023",
"endDate": "04/19/2023",
"incertitude": 10,
"activityValue": 200,
"correctiveCoefficient": 19,
"impactId": 829
},
{
"name": "0T 11122",
"startDate": "04/19/2023",
"endDate": "04/19/2023",
"incertitude": 10,
"activityValue": 255,
"correctiveCoefficient": 10,
"impactId": 830
}
]
}'
1) API Documentation
2) Générer un Token JWT
3) Génération d’activités
A) Test avec la doc Swagger
B) Test avec Curl
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.