Setup interface
XML interface
The individual elements of the XML interface are contained within the xsd definitions. Examples of the message types can be found in the respective chapter.
The exchange of XML files between host system and COGLAS Web takes place via transfer folders.
In the folder “Outbound” files are stored, which start from the host in the direction of COGLAS.
The “Inbound” folder contains feedback messages from COGLAS to the host. For further information see chapter Interfaces › Feedback from COGLAS.
JSON WebAPI
The COGLAS Web WMS provides a json WebAPI data interface that can be used to communicate bidirectionally between the host and COGLAS.
With the following statements the COGLAS WebAPI can be addressed. For the execution can be used e.g. Windows Powershell can be used. After entering the statements, the necessary parameters are queried.
Authentication
Request “login” of type POST with parameters:
grant_type* (string): always “password”
username* (string): Warehouse-alias and username in the form “warehouse/username”.
password* (string): password of the user
returns a bearer access_token as response, which must be included in the header data for all subsequent requests.
$url = Read-Host -Prompt 'Input url (https://test.coglas.com)'
if ($url -eq '') { $url= "https://test.coglas.com/server" }
$client = Read-Host -Prompt 'Input client-id (010)'
if ($client -eq '') { $client= "010" }
$user = Read-Host -Prompt 'Input warehouse/user (coglas/service)'
if ($user -eq '') { $user= "coglas/service" }
$pass = Read-Host -Prompt 'Input password' -AsSecureString
$body = @{grant_type='password';username=$user;password=[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($pass))}
$token = Invoke-RestMethod -Uri ("{0}/api/login" -f $url) -Body $body -Method Post
if ($token -eq $null)
{
Write-Host "Access denied!"
}
else
{
$token = $token."access_token"
Write-Host "Got token!"
}
Query list status
Request “datainterface/getliststatus” of type GET with parameters:
client* (string): client identifier
listtype (string): List type that is queried – GoodsInOrder | DeliveryNote | ProductionOrder | CustomerOrder
listnumber (string): list number that will be queried
listline (integer): List position for which the status is queried.
token (string): token
List number, list type as well as list position are optional and only serve to further restrict the result set. If these parameters are left empty, the result will be the oldest status changes by timestamp. The number of records returned is currently limited to 500 records per request.
The combination of list type + list number + list position + status is unique.
The token is left empty on initial query and returned in the result. Further queries can use this string to query only subsequent status changes. If the token is used throughout, the result is a complete status history.
ListStatus (list headers only)In die Zwischenablage kopieren
# calloff list status
$listtype = Read-Host "Input list type to get (1 = GoodsInOrder, 2 = DeliveryNote, 3 = ProductionOrder, 4 = CustomerOrder, default = all)"
switch($listtype)
{
1 { $listtype = "GoodsInOrder" }
2 { $listtype = "DeliveryNote" }
3 { $listtype = "ProductionOrder" }
4 { $listtype = "CustomerOrder" }
}
$listnumber = Read-Host "Input listnumber to get (empty)"
$journaltoken = Read-Host "Input token from last calloff (empty)"
$request = "{0}/api/datainterface/getliststatus?client={1}&listtype={2}&listnumber={3}&token={4}" -f ($url,$client,$listtype,$listnumber,$journaltoken)
Write-Host "Request: " $request
$json = $null
$json = Invoke-RestMethod $request -Headers @{Authorization=("Bearer {0}" -f $token)} | ConvertTo-Json -Depth 10
if($json)
{
Write-Host "Result:"
Write-Host $json
Write-Host
Read-Host "Press enter to save result or ctrl + c to cancel"
$filename = ((get-date -Format yyMMddTHHmmss) + "_" + $client + "_ListStatus.json")
$json | out-file $filename
Write-Host "Saved result to"$filename
}
ListStatus (incl. positions)
# calloff list status
$listtype = Read-Host "Input list type to get (1 = GoodsInOrder, 2 = DeliveryNote, 3 = ProductionOrder, 4 = CustomerOrder, default = all)"
switch($listtype)
{
1 { $listtype = "GoodsInOrder" }
2 { $listtype = "DeliveryNote" }
3 { $listtype = "ProductionOrder" }
4 { $listtype = "CustomerOrder" }
}
$listnumber = Read-Host "Input listnumber to get (empty)"
$listline = Read-Host "Input listposition to get (empty)"
$journaltoken = Read-Host "Input token from last calloff (empty)"
$request = "{0}/api/datainterface/getlistpositionstatus?client={1}&listtype={2}&listnumber={3}&position={4}&token={5}" -f ($url,$client,$listtype,$listnumber,$listline,$journaltoken)
Write-Host "Request: " $request
$json = $null
$json = Invoke-RestMethod $request -Headers @{Authorization=("Bearer {0}" -f $token)} | ConvertTo-Json -Depth 10
if($json)
{
Write-Host "Result:"
Write-Host $json
Write-Host
Read-Host "Press enter to save result or ctrl + c to cancel"
$utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
$filename = $(get-location).Path + '' + ((get-date -Format yyMMddTHHmmss) + "_" + $client + "_ListStatus.json")
[System.IO.File]::WriteAllLines($filename, $json, $utf8NoBomEncoding)
Write-Host "Saved result to"$filename
}
Query stock transformations
Request “datainterface/getstocktransformations” of type GET with parameters:
client* (string): client identifier
token (string): token
The token is left empty on initial query and returned in the result. Further queries can use this string to query only subsequent status changes. If the token is used throughout, the result is a complete status history.
$journaltoken = Read-Host "Input token from last calloff (empty)"
$request = "{0}/api/datainterface/getstocktransformations?client={1}&token={2}" -f ($url,$client,$journaltoken)
Write-Host "Request: " $request
$json = $null
$json = Invoke-RestMethod $request -Headers @{Authorization=("Bearer {0}" -f $token)} | ConvertTo-Json -Depth 10
if($json)
{
Write-Host "Result:"
Write-Host $json
Write-Host
Read-Host "Press enter to save result or ctrl + c to cancel"
$utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
$filename = $(get-location).Path + '\' + ((get-date -Format yyMMddTHHmmss) + "_" + $client + "_InventoryAdjustments.json")
[System.IO.File]::WriteAllLines($filename, $json, $utf8NoBomEncoding)
Write-Host "Saved result to"$filename
}
Query stock corrections
Request “datainterface/getinventoryadjustments” of type GET with parameters:
client* (string): client identifier
token (string): token
The token is left empty on initial query and returned in the result. Further queries can use this string to query only subsequent status changes. If the token is used throughout, the result is a complete status history.
$journaltoken = Read-Host "Input token from last calloff (empty)"
$request = "{0}/api/datainterface/getinventoryadjustments?client={1}&token={2}" -f ($url,$client,$journaltoken)
Write-Host "Request: " $request
$json = $null
$json = Invoke-RestMethod $request -Headers @{Authorization=("Bearer {0}" -f $token)} | ConvertTo-Json -Depth 10
if($json)
{
Write-Host "Result:"
Write-Host $json
Write-Host
Read-Host "Press enter to save result or ctrl + c to cancel"
$filename = ((get-date -Format yyMMddTHHmmss) + "_" + $client + "_ListStatus.json")
$json | out-file $filename
Write-Host "Saved result to"$filename
}
Query list
Request “datainterface/getlist” of type GET with parameters:
client* (string): client identifier
listnumber* (string): list number that will be queried
listtype* (string): List type that will be queried – GoodsInOrder | DeliveryNote | ProductionOrder | CustomerOrder
Depending on the status of the list, a different message type may be delivered as a result.
$listtype = Read-Host "Input list type to get (1 = GoodsInOrder, 2 = DeliveryNote, 3 = ProductionOrder, 4 = CustomerOrder)"
switch($listtype)
{
1 { $listtype = "GoodsInOrder" }
2 { $listtype = "DeliveryNote" }
3 { $listtype = "ProductionOrder" }
4 { $listtype = "CustomerOrder" }
}
$listnumber = Read-Host "Input listnumber to get"
Write-Host "Result:"
$request = "{0}/api/datainterface/getlist?client={1}&listnumber={2}&listtype={3}" -f ($url,$client,$listnumber,$listtype)
$json = $null
$json = (curl -H @{'Authorization' = 'Bearer {0}' -f $token} $request | select-object -expand Content | convertfrom-json)."Data" | convertto-json -Depth 10
if($json)
{
Write-Host $json
Write-Host
Read-Host "Press enter to save result or ctrl + c"
$filename = ((get-date -Format yyMMddTHHmmss) + "_" + $client + "_" + $listtype + "_" + $listnumber + ".json")
$json | out-file $filename
Write-Host "Saved result to"$filename
}
Query article total stock
Request “datainterface/getarticlestocksum” of type GET with parameters:
client* (string): client identifier
$request = "{0}/api/datainterface/getarticlestocksum?client={1}" -f ($url,$client)
$json = Invoke-RestMethod $request -Headers @{Authorization=("Bearer {0}" -f $token)} | ConvertTo-Json -Depth 10
if($json)
{
Write-Host $json
Write-Host
Read-Host "Press enter to save result or ctrl + c"
$filename = ((get-date -Format yyMMddTHHmmss) + "_" + $client + "_ArticleStockSum.json")
$json | out-file $filename
Write-Host "Saved result to"$filename
}
Creation of lists/master data and execution of actions
A uniform method is available for creating lists and master data as well as triggering list actions via ProcessList. This expects data in JSON format, and within this data the type of the message is specified.
Request “datainterface/processmessagetype” of type PUT with parameters:
jsonObject* (JSON): data to be processed
$filename = Read-Host "Input filename to send"
$content = get-content -raw -path $filename -encoding UTF8
curl -Method PUT "$url/api/datainterface/processmessagetype" -H @{'Content-Type' = 'application/json'; 'Authorization' = 'Bearer {0}' -f $token} -Body ([System.Text.Encoding]::UTF8.GetBytes($content))
Available message types
https://coglas.sharepoint.com/:x:/s/Public/EZAZMe_SJx1LmbnMeIJaroABtLZk74M6tPY8482sx4wuvQ?e=vNZdbD
FileTransfer for images via interface
The FileTransfer for images allows to assign graphic files to objects via the interface. This is an effective alternative to manual mapping in the Coglas WMS GUI. The unique assignment is achieved by the naming conventions mentioned below:
Article: Client number, item number
Packaging unit: client number, article number, packaging unit designation
Business partner: Business partner number
Customer order: client number, customer order number
Delivery bill: client number, delivery note number
Loading equipment: Loading equipment designation
Inventory order: client number, inventory order number
Goods receipt slip: client number, goods receipt slip number
Goods issue slip: Goods issue slip number
Using this information we can rename the file name as follows:
Type | Name | Example |
---|---|---|
Article | A_Mandantennummer_Artikelnummer_Dateiname | A_010_123123123_Motor |
Packaging unit | APU_MandantenNr_ArtikelNr_Verpackungseinheitsbez._Dateiname | APU_010_32116817_Tüte_Bild |
Business partner | BP_Geschäftspartnernummer_Dateiname | BP_12345_Logo |
Customer order | CO_MandantenNr_Kundenauftragsnummer_Dateiname | CO_010_123_Schuhe |
Delivery note | DN_MandantenNr_Lieferscheinnummer_Dateiname | DN_010_GI1907110001-01_Test |
Loading equipment | E_Ladehilfsmittelbezeichnung_Dateiname | E_Tüte_Tüte |
Inventory order | IO_MandantenNr_Inventurauftragsnummer_Dateiname | IO_010_IN2005190134_Inv |
Goods receipt slip | GIR_MandantenNr_Wareneingangsscheinnummer_Dateiname | GIR_010_GI1907110001-01-01_Eingang |
Goods out slip | GOR_Warenausgangsscheinnummer_Dateiname | GOR_10002_Ausgang |
→ back to COGLAS processes
→ back to COGLAS menu