Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Authentication credentials were not provided." Error #31

Open
jfriedr opened this issue Feb 13, 2025 · 7 comments
Open

"Authentication credentials were not provided." Error #31

jfriedr opened this issue Feb 13, 2025 · 7 comments
Assignees

Comments

@jfriedr
Copy link

jfriedr commented Feb 13, 2025

Discussed in #30

Originally posted by pvt-kowalski January 31, 2025
I've implemented a webhook to get status updates. Testing the webhook via the portal works fine. When trying to create a tracker via the SDK I get an "Authentication credentials were not provided." error. I'm using the example code from the website and the test data for carrier, etc. Here's my code:

try
{
ShippoSDK sdk = new ShippoSDK(
apiKeyHeader: "shippo_test_6fd5xxxxxxxxxxxxxxxxxxxxxxx15ce1e4xxxxxxxxx",
shippoApiVersion: "2018-02-08"
);

Track res1 = await sdk.TrackingStatus.CreateAsync(
tracksRequest: new TracksRequest()
{
    Carrier = "shippo",
    Metadata = "PO 123456",
    TrackingNumber = "SHIPPO_TRANSIT",
},
shippoApiVersion: "2018-02-08");

.
.
.

The error occurs almost immediately on the CreateAsync() call. Any ideas why I need authentication credentials when the SDK objecthas already been created with the authorization token? If I make a call to GetAsync with the same test data, it works fine.

Thanks

@jfriedr
Copy link
Author

jfriedr commented Feb 13, 2025

@pvt-kowalski Thank you for reporting this. We will get this replicated and let you know when you can expect it to be resolved here in this Github Issue.

It's worth noting If you are purchasing the labels through Shippo then the registration of a tracking number is not required.

@pvt-kowalski
Copy link

@jfriedr, thank you for looking into this issue. We are using the API to track inbound packages and will be registering several hundred tracking numbers per week.

@pvt-kowalski
Copy link

@jfriedr, do you have any update on this issue? We're looking to sign a contract, but this will delay (or prevent) that. The registering of tracking numbers is critical to our implementation.

@jfriedr
Copy link
Author

jfriedr commented Feb 19, 2025

@pvt-kowalski I will have an update on estimated time of resolution by end of day. Thanks for including how this will be used.

@jfriedr
Copy link
Author

jfriedr commented Feb 19, 2025

@pvt-kowalski we were able to investigate this further and have determined this is due to a trailing slash not being passed in the url. We are determining if this should be fixed within the SDK or rather server side. Once we have some additional information I will update this thread. Apologies that we don't yet have an ETA. Once we have that ETA we will include it here.

@pvt-kowalski
Copy link

@jfriedr thank you for the update. Looking forward to a quick resolution to this issue. Thanks again.

@pvt-kowalski
Copy link

@jfriedr, I'm trying to work around the SDK issue until it is resolved and am implementing the HTTPClient object in C#. I have the following code...

HttpClient client = new HttpClient();
var url = "https://api.goshippo.com/tracks/";

client.DefaultRequestHeaders.Add("Accept", "application/json");
client.DefaultRequestHeaders.Add("Authorization", "ShippoToken shippo_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX109");

var trackerData = new
{
    carrier = "shippo",
    tracking_number = "SHIPPO_TRANSIT",
    metadata = "EQW TEST"
};

var response = await client.PostAsJsonAsync(url, trackerData);

response.EnsureSuccessStatusCode();

var jsonResponse = await response.Content.ReadAsStringAsync();

This returns the following payload (partial data)...

 "carrier": null,
  "eta": "2025-02-24T18:30:06.426Z",
  "original_eta": "2025-02-24T18:30:06.426Z",
  "servicelevel": {
    "token": "shippo_priority",
    "name": null
  },
  "metadata": null,
  "transaction": null,
  "messages": [],
  "test": true
}

as you can see, the metadata property is null even though the value of "EQW TEST" was passed in. If I use the same valued via the Shippo Webhook portal, the metadata shows the correct value. Any ideas why it doesn't show from the code example above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants