Page History
Inhalt | ||
---|---|---|
|
Zur Veranschaulichung und als kleine Hilfe möchten wir hier ein paar Beispielaufrufe, die per Shell abgesetzt werden können, auflisten.
Um die Statements möglichst kurz zu halten sind größere JSON Inhalte in Dateien ausgelagert:
Anhänge | ||||||||
---|---|---|---|---|---|---|---|---|
|
Login
Codeblock |
---|
export JSESSIONID=`curl -X POST -d '{"username":"nuclos", "password":""}' http://localhost:8080/nuclos-war/rest -H "Accept:application/json" -H "Content-Type:application/json" | awk -v FS="\"" '{ print $4 }'` |
Neue Order anlegen
Anhang insert_order_2002.json
Codeblock |
---|
curl -X POST -d @insert_order_2002.json http://localhost:8080/nuclos-war/rest/bos/example_rest_Order -H "Cookie:JSESSIONID=$JSESSIONID" -H "Content-Type:application/json" -H "Accept:application/json" |
Vorhandene Order ändern
Anhang update_order_1012.json
- Attribut node wird gesetzt
- Unterformular position erhält einen neuen Eintrag und der Vorhandene wird geändert
Codeblock |
---|
curl -X PUT -d @update_order_1012.json http://localhost:8080/nuclos-war/rest/bos/example_rest_Order/40000305 -H "Cookie:JSESSIONID=$JSESSIONID" -H "Content-Type:application/json" -H "Accept:application/json" |
Anhang update2_order_1012.json
- Attribute node wird geändert
- Unterformular position, ein Eintrag wird gelöscht
Codeblock |
---|
curl -X PUT -d @update2_order_1012.json http://localhost:8080/nuclos-war/rest/bos/example_rest_Order/40000305 -H "Cookie:JSESSIONID=$JSESSIONID" -H "Content-Type:application/json" -H "Accept:application/json" |
Order löschen
order_1012
Codeblock |
---|
curl -X DELETE http://localhost:8080/nuclos-war/rest/bos/example_rest_Order/40000305 -H "Cookie:JSESSIONID=$JSESSIONID" |
Statuswechsel einer Order
order_1011 nach Finished
Codeblock |
---|
curl -X GET http://localhost:8080/nuclos-war/rest/boStateChanges/example_rest_Order/40000302/example_rest_ExampleorderSM_State_80 -H "Cookie:JSESSIONID=$JSESSIONID" |
Report ausführen
Codeblock |
---|
# Anmelden und Token erhalten
AUTH_RESPONSE=$(curl -X 'POST' \
'https://nucuclos.de/rest' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"username": "nuclos",
"password": "n!12345"
}')
# Extrahiere das Token aus der AUTH_RESPONSE
TOKEN=$(echo "$AUTH_RESPONSE" | jq -r '.sessionId')
curl -X 'POST' \
'https://nucuclos.de/rest/reports/ssdfksdfkfjsafdj/execute' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H "Cookie:JSESSIONID=$TOKEN" \
-d '{
"printoutId": "org_nuclet_test_ExportPO",
"name": "Export",
"outputFormats": [
{
"outputFormatId": "org_nuclet_test_ExportPO_artikel",
"name": "artikel",
"selected": true
},
{
"outputFormatId": "org_nuclet_test_ExportPO_vkpreis",
"name": "vkpreis",
"selected": true
}
]
}' |
curl -X GET http://localhost:8080/nuclos-war/rest/boStateChanges/example_rest_Order/40000302/example_rest_ExampleorderSM_State_80 -H "Cookie:JSESSIONID=$JSESSIONID"
Logout
Codeblock |
---|
curl -X DELETE http://localhost:8080/nuclos-war/rest -H "Cookie:JSESSIONID=$JSESSIONID" |
Overview
Content Tools