API Technical Details
This section includes details on the default XML layouts for authorization, transactions, and client access requests and responses. A folder of example XSL docs can be found here [Drive]\TagNet Extension Framework\EF Web\custom-sql. You can find one close to your use case and modify.
Outbound Transaction Request
The format below is the default layout that is submitted to external endpoints when a transaction rule match occurs. This is used if NO Request XSL is configured in the Outbound Transaction Endpoint menu. If a Request XSL is selected for that endpoint definition, then this XML or JSON format is transformed using that XSL styled.
OutboundTransactionRequest.xml |
OutboundTransactionRequest.json |
<?xml version="1.0" encoding="utf-8"?> <OutboundTransactionRequest> <AuthorizationToken>a2pzYWhkZmxhc2</AuthorizationToken> <OutboundTransaction> <TransactionID>91093</TransactionID> <TagID>C00000000000000000000A7D</TagID> <ItemID>PRT1000</ItemID> <Quantity>1.00</Quantity> <Action>MANUAL</Action> <SourceLevel1>ACME</SourceLevel1> <SourceLevel2>XYZCOMPANY</SourceLevel2> <SourceLevel3>DEMOGTCB01</SourceLevel3> <SourceLevel4>INTRANSIT </SourceLevel4> <SourceLevel5> </SourceLevel5> <TargetLevel1>ACME</TargetLevel1> <TargetLevel2>XYZCOMPANY</TargetLevel2> <TargetLevel3>DEMOGTCB01</TargetLevel3> <TargetLevel4>INSTORAGE </TargetLevel4> <TargetLevel5> </TargetLevel5> <TransactionTime>2020-04-09T16:45:56</TransactionTime> <BinID /> <EmployeeID>RFIDADMIN</EmployeeID> <LotNumber /> <LotStatus> </LotStatus> <Reference /> <ReasonCode>RFID - Receipt</ReasonCode> <RuleName>Receive Items</RuleName> <TransactionAttributes> <OutboundTransactionAttribute Name="CostCenter" Value="Prod-X1" /> <OutboundTransactionAttribute Name="JobCode" Value="655B2AA" /> </TransactionAttributes> <TransactionErrors /> <ProcessedTime /> <Status>InProcess</Status> </OutboundTransaction> <TagAttributes> <OutboundTagAttribute Name="ORDER_ID" Value="4144267" /> <OutboundTagAttribute Name="EXP_DATE" Value="01/01/2022" /> <OutboundTagAttribute Name="MFG_LOT_NO" Value="911S1B43L" /> </TagAttributes> </OutboundTransactionRequest> |
{ "OutboundTransactionRequest": { "AuthorizationToken": "a2pzYWhkZmxhc2", "OutboundTransaction": { "TransactionID": "91093", "TagID": "C00000000000000000000A7D", "ItemID": "PRT1000", "Quantity": "1.00", "Action": "MANUAL", "SourceLevel1": "ACME", "SourceLevel2": "XYZCOMPANY", "SourceLevel3": "DEMOGTCB01", "SourceLevel4": "INTRANSIT ", "SourceLevel5": "", "TargetLevel1": "ACME", "TargetLevel2": "XYZCOMPANY", "TargetLevel3": "DEMOGTCB01", "TargetLevel4": "INSTORAGE ", "TargetLevel5": "", "TransactionTime": "2020-04-09T16:45:56", "BinID": null, "EmployeeID": "RFIDADMIN", "LotNumber": null, "LotStatus": "", "Reference": null, "ReasonCode": "RFID - Receipt", "RuleName": "Receive Items", "TransactionAttributes": { "OutboundTransactionAttribute": [ { "@Name": "CostCenter", "@Value": "Prod-X1" }, { "@Name": "JobCode", "@Value": "655B2AA" } ] }, "TransactionErrors": null, "ProcessedTime": null, "Status": "InProcess" }, "TagAttributes": { "OutboundTagAttribute": [ { "@Name": "ORDER_ID", "@Value": "4144267" }, { "@Name": "EXP_DATE", "@Value": "01/01/2022" }, { "@Name": "MFG_LOT_NO", "@Value": "911S1B43L" } ] } } } |
Outbound Transaction Response
The format below is the expected XML or JSON layout that the external endpoint should respond with after receiving an Outbound Transaction Request. The IsSuccess element is a Boolean value that determines if the external endpoint processed the request successfully. The Message element is a string value that will be linked with the transaction record in the queue. If the external endpoint responds with a different format, you must transform that using a stylesheet as shown in below 301 example.
OutboundTransactionResponse.xml |
OutboundTransactionResponse.json |
<?xml version="1.0" encoding="utf-8"?> <OutboundTransactionResponse> <IsSuccess>true</IsSuccess> <Message>Transaction 91093 success.</Message> </OutboundTransactionResponse> |
{ "OutboundTransactionResponse": { "IsSuccess": "true", "Message": "Transaction 91093 success." } } |
Outbound Transaction Style Sheet Examples
Shown below are XSL examples for SAP 301 Inventory Movements transforming to XML or JSON (based on endpoint content point).
SAP-301-request.xsl |
SAP-transaction-response.xsl |
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <OutboundTransactionRequest xmlns:json='http://yourdomain.com/projects/json'> <OutboundTransaction json:Array='true'> <move_type>301</move_type> <plant><xsl:value-of select="OutboundTransactionRequest/TagAttributes/OutboundTagAttribute[@Name='TARGET_PLANT']/@Value"/></plant> <sloc><xsl:value-of select="OutboundTransactionRequest/TagAttributes/OutboundTagAttribute[@Name='TARGET_SLOC']/@Value"/></sloc> <move_plant>0956</move_plant> <move_stloc>00</move_stloc> <material><xsl:value-of select="OutboundTransactionRequest/TagAttributes/OutboundTagAttribute[@Name='ITEM_NUMBER']/@Value"/></material> <qty><xsl:value-of select="OutboundTransactionRequest/OutboundTransaction/Quantity"/></qty> </OutboundTransaction> </OutboundTransactionRequest> </xsl:template>
</xsl:stylesheet> |
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:variable name="ReturnCode" select="OutboundTransactionResponse/return_code"/> <xsl:template match="/"> <OutboundTransactionResponse> <xsl:choose> <xsl:when test="$ReturnCode='0'"> <IsSuccess>true</IsSuccess> </xsl:when> <xsl:otherwise> <IsSuccess>false</IsSuccess> </xsl:otherwise> </xsl:choose> <Message><xsl:value-of select="OutboundTransactionResponse/message"/></Message> </OutboundTransactionResponse> </xsl:template>
</xsl:stylesheet> |
Authorization Token Request
The XML format below is the default layout that is submitted when requesting an authorization token. This is used if no Request Xsl is configured in the Outbound Authorization Settings menu. If a Request XSL is selected in that menu, then this XML format is transformed using that XSL stylesheet.
Authorization Token Response
The format below is the expected XML layout that the external endpoint should respond with after receiving an Authorization Token Request. The Valid element is a Boolean value that determines if the external endpoint processed the request successfully. The Token element is a string value that will be subsequently included in Outbound Transaction Requests and the Issued and Expired elements are DateTime values that determine how long the token will be used for. If the external endpoint responds with a different XML format, you must transform that XML using a stylesheet specified in the Response Xsl field to match the layout below.
Client Authentication Request
The XML format below is the default layout that is submitted to an external endpoint when validating an employee from an SRC Agent. This is used if no Request Xsl is configured in the Outbound Client Authentication menu. If a Request Xsl is selected in that menu, then this XML format is transformed using that XSL stylesheet. If authorization tokens are disabled, that field will be empty.
Client Authentication Response
The format below is the expected XML layout that the external endpoint should respond with after receiving a Client Authentication Request. The Valid element is a Boolean value that determines if the employee has access to the Location sent in the request. If the external endpoint responds with a different XML format, you must transform that XML using a stylesheet specified in the Response Xsl field to match the layout below.
Add Outbound Attributes Request
The XML format below is the required layout that is submitted when adding transaction attributes to a transaction. These are data elements that can be associated with a movement after the transaction is written, but before it is submitted to an external endpoint. The Process Delay Time setting can be used to increase the delay between these two events, providing time for an external system to link attributes with the transaction. The Extension Framework URL endpoint for this is /ef/api/v1/outbound/add-attribute.
Copyright © 2024 Stratum Global, Inc.