pld 0200 june 2003 upload a pld0200 file and receive and parse the response
TRANSCRIPT
PLD 0200
June 2003
Upload a PLD0200 File
and
Receive and Parse the Response
UPS | EUR Region EBSG 2
PLD Flow Diagram
UPS | EUR Region EBSG 3
PLD0200 upload
http request message
Methode: POST
TCP/IP socket connection Host: www.pld-certify.ups.com PORT: 443 URI: /hapld/tos/kdwhapltos
URL connection URL: https://www.pld-certify.ups.com/hapld/tos/kdwhapltos
PW+ UID: PLDDSTEST
THE UPLOAD
UPS | EUR Region EBSG 5
PLD0200 upload
POST /hapld/tos/kdwhapltos HTTP/1.1
Host: www.pld-certify.ups.com
Content-type: multipart/mixed; boundary=BOUNDARY
Content-length: 1038
--BOUNDARY
Content-type: application/x-www-form-urlencoded
Content-length: 140
AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&VersionNumber=V4R1&UserId=xxx&Password=xxx
--BOUNDARY
Content-type: application/x-ups-binary
Content-length: 719
020082 2.0 2002101700000000000010500 000000001*AA0A1754 US 1234567002000001*BA1z1234560100002352 00001+0000000000000010 +0000000000000000LBS01PRE10 …
--BOUNDARY—
header
message
UPS | EUR Region EBSG 6
PLD0200 upload
POST /hapld/tos/kdwhapltos HTTP/1.1
Host: www.pld-certify.ups.com
Content-type: multipart/mixed; boundary=BOUNDARY
Content-length: 1038
--BOUNDARY
Content-type: application/x-www-form-urlencoded
Content-length: 140
AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&VersionNumber=V4R1&UserId=xxx&Password=xxx
--BOUNDARY
Content-type: application/x-ups-binary
Content-length: 719
020082 2.0 2002101700000000000010500 000000001*AA0A1754 US 1234567002000001*BA1z1234560100002352 00001+0000000000000010 +0000000000000000LBS01PRE10 …
--BOUNDARY—
Multipart message
part 2
part 1
the PL0200 upload is a multipart message contains 2 part the two parts are delimited by --Boundary
UPS | EUR Region EBSG 7
PLD0200 upload
POST /hapld/tos/kdwhapltos HTTP/1.1
Host: www.pld-certify.ups.com
Content-type: multipart/mixed; boundary=BOUNDARY
Content-length: 1038
--BOUNDARY
Content-type: application/x-www-form-urlencoded
Content-length: 140
AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&VersionNumber=V4R1&UserId=xxx&Password=xxx
--BOUNDARY
Content-type: application/x-ups-binary
Content-length: 719
020082 2.0 2002101700000000000010500 000000001*AA0A1754 US 1234567002000001*BA1z1234560100002352 00001+0000000000000010 +0000000000000000LBS01PRE10 …
--BOUNDARY—
Multipart message
part 2
part 1
each part and the main message has a a Content-type and a content-length header
UPS | EUR Region EBSG 8
PLD0200 upload
POST /hapld/tos/kdwhapltos HTTP/1.1
Host: www.pld-certify.ups.com
Content-type: multipart/mixed; boundary=BOUNDARY
Content-length: 1038
--BOUNDARY
Content-type: application/x-www-form-urlencoded
Content-length: 140
AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&VersionNumber=V4R1&UserId=xxx&Password=xxx
--BOUNDARY
Content-type: application/x-ups-binary
Content-length: 719
020082 2.0 2002101700000000000010500 000000001*AA0A1754 US 1234567002000001*BA1z1234560100002352 00001+0000000000000010 +0000000000000000LBS01PRE10 …
--BOUNDARY—
Multipart message
part 2
part 1
the Content-length is one of the most important detail for a successful upload
THE RESPONSE
UPS | EUR Region EBSG 10
PLD0200 RESPONSE
HTTP/1.1 200 OKServer: IBM-HTTP-Server/1.0Date: Mon, 25 Nov 2002 20:21:15 GMTConnection: closeAccept-Ranges: bytesContent-Type: multipart/mixed; boundary=BOUNDARYContent-Length: 1251
--BOUNDARYContent-type: text/htmlContent-length: 138
<HTML><HEAD><TITLE>UPS Internet Software</TITLE></HEAD><BODY><P>UPS Internet Software, Copyright UPS 1998</P></BODY></HTML>
--BOUNDARYContent-type: application/x-ups-psmpldContent-length: 103
UPSOnLine%1.0%0000%0000Successful completion - No errors found.
--BOUNDARYContent-type: application/x-ups-pldContent-length: 758
000200000758300000640 KDGPLCR1 United Parcel Service11/25/02 Page:1 PLD Control Report 04:09 PM
--BOUNDARY--
part 1 text/html
Multipart message
part 2 application/x-ups-psmpld
part 3 application/x-ups-pld
the PLP0200 upload response is a multipart message contains 3 part all 3 parts are delimited by --Boundary
UPS | EUR Region EBSG 11
PLD0200 RESPONSE
HTTP/1.1 200 OKServer: IBM-HTTP-Server/1.0Date: Mon, 25 Nov 2002 20:21:15 GMTConnection: closeAccept-Ranges: bytesContent-Type: multipart/mixed; boundary=BOUNDARYContent-Length: 1251
--BOUNDARYContent-type: text/htmlContent-length: 138
<HTML><HEAD><TITLE>UPS Internet Software</TITLE></HEAD><BODY><P>UPS Internet Software, Copyright UPS 1998</P></BODY></HTML>
--BOUNDARYContent-type: application/x-ups-psmpldContent-length: 103
UPSOnLine%1.0%0000%0000Successful completion - No errors found.
--BOUNDARYContent-type: application/x-ups-pldContent-length: 758
000200000758300000640 KDGPLCR1 United Parcel Service11/25/02 Page:1 PLD Control Report 04:09 PM
--BOUNDARY--
part 1 text/html
Multipart message
part 2 application/x-ups-psmpld
part 3 application/x-ups-pld
text/html
UPS | EUR Region EBSG 12
PLD0200 RESPONSE
Content-type: text/htmlContent-length: 138
<HTML><HEAD><TITLE>UPS Internet Software</TITLE></HEAD><BODY><P>UPS Internet Software, Copyright UPS 1998</P></BODY></HTML>
sample text/html part
text/html contains HTML formatted response
UPS | EUR Region EBSG 13
PLD0200 RESPONSE
HTTP/1.1 200 OKServer: IBM-HTTP-Server/1.0Date: Mon, 25 Nov 2002 20:21:15 GMTConnection: closeAccept-Ranges: bytesContent-Type: multipart/mixed; boundary=BOUNDARYContent-Length: 1251
--BOUNDARYContent-type: text/htmlContent-length: 138
<HTML><HEAD><TITLE>UPS Internet Software</TITLE></HEAD><BODY><P>UPS Internet Software, Copyright UPS 1998</P></BODY></HTML>
--BOUNDARYContent-type: application/x-ups-psmpldContent-length: 103
UPSOnLine%1.0%0000%0000Successful completion - No errors found.
--BOUNDARYContent-type: application/x-ups-pldContent-length: 758
000200000758300000640 KDGPLCR1 United Parcel Service11/25/02 Page:1 PLD Control Report 04:09 PM
--BOUNDARY--
part 1 text/html
Multipart message
part 2 application/x-ups-psmpld
part 3 application/x-ups-pld
application/x-ups-psmpld
UPS | EUR Region EBSG 14
PLD0200 RESPONSEapplication/x-ups-psmpld contains the response type (successful, warning, error or severe error). 4 Fields - delimited by "%“ Field1: UPSOnline Field2: Version Field3: PLD Upload - Return Codes 0000 Success - Successful upload, no warning messages. Control and Status Reports are returned. 6930 PLD Warning - Successful upload with warning messages. Error, Control and Status Reports are returned. 6931 PLD Error - Failed upload due to errors in the PLD data. Error and Status Reports are returned. 6932 PLD Severe Error - Failed upload due to errors in the input parameters. Status Report is returned.Field4: PLD Upload - Message Text ReasonCode(4digits) + Description (see PLD Documentation for more Details)
Content-type: application/x-ups-psmpldContent-length: 103
UPSOnLine%1.0%0000%0000Successful completion - No errors found.
Sample successful upload
Content-type: application/x-ups-psmpldContent-length: 104
UPSOnLine%1.0%6931%5491PLD File contains Fatal Errors. Correct errors and resubmit.
Sample failed upload
UPS | EUR Region EBSG 15
PLD0200 RESPONSE
HTTP/1.1 200 OKServer: IBM-HTTP-Server/1.0Date: Mon, 25 Nov 2002 20:21:15 GMTConnection: closeAccept-Ranges: bytesContent-Type: multipart/mixed; boundary=BOUNDARYContent-Length: 1251
--BOUNDARYContent-type: text/htmlContent-length: 138
<HTML><HEAD><TITLE>UPS Internet Software</TITLE></HEAD><BODY><P>UPS Internet Software, Copyright UPS 1998</P></BODY></HTML>
--BOUNDARYContent-type: application/x-ups-psmpldContent-length: 103
UPSOnLine%1.0%0000%0000Successful completion - No errors found.
--BOUNDARYContent-type: application/x-ups-pldContent-length: 758
000200000758300000640 KDGPLCR1 United Parcel Service11/25/02 Page:1 PLD Control Report 04:09 PM
--BOUNDARY--
part 1 text/html
Multipart message
part 2 application/x-ups-psmpld
part 3 application/x-ups-pld
application/x-ups-pld
UPS | EUR Region EBSG 16
PLD0200 RESPONSEapplication/x-ups-pld contains the reports (Status, Error and Control Reports)
start with fixed length:Pos. Length Description 1 4 Number of Reports5 8 Length of all Reporst
then start again with fixed length:Pos. Length Description 1 1 Type of Report
1=Status Report 2=Error Report 3=Control Report
2 8 Length of these Report (Xbyte) 9 Xbyte Report
Content-type: application/x-ups-pldContent-length: 758
000200000758300000640 KDGPLCR1 United Parcel Service11/25/02 Page:1 PLD Control Report 04....
Sample application/x-ups-pld part
UPS | EUR Region EBSG 17
PLD0200 RESPONSEapplication/x-ups-pld
Content-type: application/x-ups-pldContent-length: 759
000200000746300000640 KDGPLCR1 United Parcel Service 01/28/03 Page:1 PLD Control Report 08:12 AM ------------------------------------------------------------------------------- Pickup Date:20030203 Sequence#:000001111111002 #of Segments:000000000000000005 Shipper#:4334A4 Book/Page#:1111111002 Shipments:000001 Packages:0000000001 10000008800000000Successful completion - No errors found.
Sample1: application/x-ups-pld part
Value Description 0002 Number of Reports00000746 Length of all Reports
Value Description 3 3=Control Report00000640 Length of Control Report
Value Description 1 1=Status Report00000088 Length of Control Report
UPS | EUR Region EBSG 18
PLD0200 RESPONSEapplication/x-ups-pld
Content-type: application/x-ups-pldContent-length: 1319
000200001306200001200 KDGPLRS1 United Parcel Service 01/28/03 Host Access 08:28 AM PLD Error Report PAGE 1 ------------------------------------------------------------------------------- Err Error Code/ Message/ Tracking Seg Field Field Number ID Name Contents ------------------------------------------------------------------------------- 9124 Weight cannot be zero for a non-letter. 1Z4334A46800000016 *BA ShipmentActualWeight +0000000000000000 5491 PLD File contains Fatal Errors. Correct errors and resubmit. 10000008800025491PLD File contains Fatal Errors. Correct errors and resubmit.
Sample2: application/x-ups-pld part
Value Description 0002 Number of Reports00001306 Length of all Reports
Value Description 1 1=Status Report00000088 Length of Control
Report
Value Description 1 2=Error Report00001200 Length of Control
Report
UPS | EUR Region EBSG 19
PLD0200 RESPONSEapplication/x-ups-pld Status Report
contains a Return Code, a Reason Code and a Reason Text
fixed length:Pos. Length Description 1 4 Return Code
0000 - Successful Return Code No errors were found in the file. 0001 - Successful Warning Return Code Warning, non-fatal errors were found in the
file0002 - Unsuccessful Return Code Fatal errors were found in the file0003 - Unsuccessful Return Code Severe errors were found
5 4 Reason Code (see SPF Documentation for more Details) 9 Xbyte Reason Text (see SPF Documentation for more Details)
10000008800026504Password is invalid.
Status Report Sample 110000008800000000Successful completion - No errors found.
10000008800025491PLD File contains Fatal Errors. Correct errors and resubmit. Status Report Sample 2
Status Report Sample 3
UPS | EUR Region EBSG 20
PLD0200 RESPONSEapplication/x-ups-pld Control Report
the length of this report is always X * 80 ByteInsert a [CR] [LF] after each 80Bytes and you will get a well formed human readable report
300000640 KDGPLCR1 United Parcel Service 01/28/03 Page:1 PLD Control Report 08:40 AM ------------------------------------------------------------------------------- Pickup Date:20030203 Sequence#:000001111111002 #of Segments:000000000000000005 Shipper#:4334A4 Book/Page#:1111111002 Shipments:000001 Packages:0000000001
300000640 KDGPLCR1 United Parcel Service 01/28/03 Page:1 PLD Control Report 08:40 AM ------------------------------------------------------------------------------- Pickup Date:20030203 Sequence#:000001111111002 #of Segments:000000000000000005 Shipper#:4334A4 Book/Page#:1111111002 Shipments:000001 Packages:0000000001
80
Sample Error Report / unparsed
Sample Error Report / parsed
UPS | EUR Region EBSG 21
80
PLD0200 RESPONSEapplication/x-ups-pld Error Report
the length of this report is always X * 80 ByteInset a [CR] [LF] after each 80Bytes and you will get a well formed human readable report200001200 KDGPLRS1 United Parcel Service 01/28/03 Host Access 08:40 AM PLD Error Report PAGE 1 ------------------------------------------------------------------------------- Err Error Code/ Message/ Tracking Seg Field Field Number ID Name Contents ------------------------------------------------------------------------------- 6715 Invalid 1z Service Level for the chosen UPS services 1Z4334A45600000011 *PA PackageTrackingNumber 1Z4334A45600000011 5481 PLD File submitted with above errors. Correct for next upload.
Sample Error Report / unparsed
200001200 KDGPLRS1 United Parcel Service 01/28/03 Host Access 08:40 AM PLD Error Report PAGE 1 ------------------------------------------------------------------------------- Err Error Code/ Message/ Tracking Seg Field Field Number ID Name Contents ------------------------------------------------------------------------------- 6715 Invalid 1z Service Level for the chosen UPS services 1Z4334A45600000011 *PA PackageTrackingNumber 1Z4334A45600000011 5481 PLD File submitted with above errors. Correct for next upload.
Sample Error Report / parsed
UPS | EUR Region EBSG 22
--BOUNDARYContent-type: text/htmlContent-length: 138
<HTML><HEAD><TITLE>UPS Internet Software</TITLE></HEAD><BODY><P>UPS Internet Software, Copyright UPS 1998</P></BODY></HTML>
--BOUNDARYContent-type: application/x-ups-psmpldContent-length: 104
UPSOnLine%1.0%0000%0000Successful completion - No errors found.
--BOUNDARYContent-type: application/x-ups-pldContent-length: 759
000200000746300000640 KDGPLCR1 United Parcel Service 01/28/03 Page:1 PLD Control Report 08:12 AM ------------------------------------------------------------------------------- Pickup Date:20030203 Sequence#:000001111111002 #of Segments:000000000000000005 Shipper#:4334A4 Book/Page#:1111111002 Shipments:000001 Packages:0000000001 10000008800000000Successful completion - No errors found.
--BOUNDARY--
PLD0200 RESPONSE
The Text
The Response Type – 0000 Successful
The Reports – 2 Reports ( Control + Status )
© Copyright 2003 United Parcel Service of America, Inc. All rights reserved.
Thank you