Connecting to the UPS REST API

Describe the problem/error/question

I couldn’t connect to UPS REST services. I was writing this message and in the course of creating screenshots etc I figured it out! I thought I would still post this so it could benefit others in the same predicament.

What is the error message (if any)?

Some (not all) of the errors I encountered:
“status”:“rejected”,“reason”:“Missing transactionSrc”
“status”:“rejected”,“reason”:“Invalid or Missing required parameter”
“status”:“rejected”,“reason”:“Invalid/Missing Authorization Header”
“status”:“rejected”,“reason”:“We do not support the content type in your request. Please modify the format and try again.”

SOLUTION!
Here’s a screenshot of my Credentials:


Access Token URL: https://wwwcie.ups.com/security/v1/oauth/token

Workflow

Link to UPS docs for more info: UPS Developer Portal

Output from HTTP node


[
{
"trackResponse":
{
"shipment":
[
{
"inquiryNumber":
"1Z1234567890123456",
"package":
[
{
"trackingNumber":
"1Z1234567890123456",
"deliveryDate":
[
{
"type":
"DEL",
"date":
"20220126"
}
],
"deliveryTime":
{
"type":
"DEL",
"endTime":
"163000"
},
"activity":
[
{
"location":
{
"address":
{...}, // 4 items
"slic":
"0761"
},
"status":
{
"type":
"D",
"description":
"DELIVERED ",
"code":
"F4",
"statusCode":
"011"
},
"date":
"20220126",
"time":
"163000"
},
{
"location":
{
"address":
{...} // 2 items
},
"status":
{
"type":
"M",
"description":
"Shipper created a label, UPS has not received the package yet. ",
"code":
"MP",
"statusCode":
"003"
},
"date":
"20220126",
"time":
"151641"
}
],
"packageCount":
1
}
]
}
]
}
}
]

Information on your n8n setup

  • n8n version:** 0.227.1
  • Database (default: SQLite):** Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):**
  • Running n8n via (Docker, npm, n8n cloud, desktop app):** App
  • Operating system:** Linux Ubuntu

Hope this helps someone!

1 Like

Sweet, so glad you figured it out @tberneman! OAuth2 authentication can be a pain, especially for services not frequently used with n8n, so I really appreciate you sharing this.

I’ll move this post to the Tips & Tricks category so folks hopefully have an easier time finding it.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.