Skip to content
Gallery
Shippr
More
Share
Explore
Kabaun

icon picker
API REST

1) API Documentation

2) Générer un Token JWT

Plus d’nfos sur les
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 )
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
}
]
}'

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.