2

I'm trying to get response from FedEx Tracking API by using developer account credentials (UserCredentials) and I do not own ParentCredentials because I'm not Compatible User.

The code looks like this:

            TrackRequest request = new TrackRequest();

            request.WebAuthenticationDetail = new WebAuthenticationDetail();
            request.WebAuthenticationDetail.UserCredential = new WebAuthenticationCredential();
            request.WebAuthenticationDetail.UserCredential.Key = "XXX"; // Replace "XXX" with the Key
            request.WebAuthenticationDetail.UserCredential.Password = "XXX"; // Replace "XXX" with the Password
            request.WebAuthenticationDetail.ParentCredential = null;

            request.ClientDetail = new ClientDetail();
            request.ClientDetail.AccountNumber = "XXX"; // Replace "XXX" with the client's account number
            request.ClientDetail.MeterNumber = "XXX"; // Replace "XXX" with the client's meter number

            request.TransactionDetail = new TransactionDetail();
            request.TransactionDetail.CustomerTransactionId = "***Track Request using VC#***";  //This is a reference field for the customer.  Any value can be used and will be provided in the response.

            request.Version = new VersionId();

            // Tracking information
            request.SelectionDetails = new TrackSelectionDetail[1] { new TrackSelectionDetail() };
            request.SelectionDetails[0].PackageIdentifier = new TrackPackageIdentifier();
            request.SelectionDetails[0].PackageIdentifier.Value = "123456789012"; // Replace "XXX" with tracking number or door tag
            //if (usePropertyFile()) //Set values from a file for testing purposes
            //{
            //    request.SelectionDetails[0].PackageIdentifier.Value = getProperty("trackingnumber");
            //}
            request.SelectionDetails[0].PackageIdentifier.Type = TrackIdentifierType.TRACKING_NUMBER_OR_DOORTAG;

            // Date range is optional.
            // If omitted, set to false
            //request.SelectionDetails[0].ShipDateRangeBegin = DateTime.Parse("06/18/2012"); //MM/DD/YYYY
            request.SelectionDetails[0].ShipDateRangeEnd = request.SelectionDetails[0].ShipDateRangeBegin.AddDays(0);
            request.SelectionDetails[0].ShipDateRangeBeginSpecified = false;
            request.SelectionDetails[0].ShipDateRangeEndSpecified = false;

            // Include detailed scans is optional.
            // If omitted, set to false
            request.ProcessingOptions = new TrackRequestProcessingOptionType[1];
            request.ProcessingOptions[0] = TrackRequestProcessingOptionType.INCLUDE_DETAILED_SCANS;

So, this is just a regular example that every developer user can access and main difference is that I do not use ParentCredentials.

The endpoint for accessing API is: https://ws.fedex.com/web-services/track

UserCredentials that I use are valid.

The response that I get contains the error message and the error code from the title of this question. How can I avoid it?

user7479651
  • 689
  • 1
  • 5
  • 14
  • The request format isn't matching the Fedex requirements. It may be the User Agent headers which indicates the browser paramters. If you have a working application then use a sniffer like wireshark or fiddler and compare the first request of working and non working. If you do not have a working then compare your request against the Fedex specification. – jdweng Mar 26 '20 at 16:30

0 Answers0