开发者

find signature is required or not using shipment API (USPS, UPS, DHL, FeDex)

I am integrating the Carrier (USPS, UPS, DHL, FeDex) API with my application. For that i need to find different statuses for that shipment like is it delivered or not, which is getting me properly. Similarly, i need to check whether the shipment required the signature or not? How do i came to know this using the different API?

Re开发者_如何学Pythongards, Salil Gaikwad


Not all APIs support the same functionality. All will tell you the current status and some will provide the shipper/recipient information but I don't believe any will tell you if it was sent signature required.


E.g. for FedEx if you want to know about parcel's tracking events (delivered or not, any problems, delivery time and many other info) use this service endpoint - https://ws.fedex.com:443/web-services/track. The request to FedEx will be look like this (C# sample):

    TrackRequest request = new TrackRequest();
    request.WebAuthenticationDetail = new WebAuthenticationDetail();
    request.WebAuthenticationDetail.UserCredential = new WebAuthenticationCredential()
    {
        Key = "ApiKey",
        Password = "PasswordKey"
    };
    request.ClientDetail = new ClientDetail
    {
        AccountNumber = "...",
        MeterNumber = "..."
    };
    request.TransactionDetail = new TransactionDetail();

    request.PackageIdentifier = new TrackPackageIdentifier();
    request.PackageIdentifier.Value = "parcel tracking number";
    request.PackageIdentifier.Type = TrackIdentifierType.TRACKING_NUMBER_OR_DOORTAG;

    request.IncludeDetailedScans = true;
    request.IncludeDetailedScansSpecified = true;
    request.Version = new VersionId();

When you receive from FedEx - TrackReply, you should check TrackDetails array. There will be tracking info. As for other carriers, the common idea is the same. Almost every carrier use tracking number.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜