python-fedex-devs / python-fedex

A light wrapper around FedEx's SOAP API.
http://python-fedex.readthedocs.org
BSD 3-Clause "New" or "Revised" License
156 stars 139 forks source link

Significant Change in json field names on track request 2.4.0 ==> 2.4.1 #153

Closed brianhwitte closed 1 year ago

brianhwitte commented 3 years ago

Simplified use case for python-fedex:

import json
from fedex.services.track_service import FedexTrackRequest
from fedex.tools.conversion import sobject_to_json

def get_delivered_at_time(tracking_number):
    track_request = FedexTrackRequest(fedex_config_object)
    track_request.SelectionDetails.PackageIdentifier.Value = tracking_num
    track_request.SelectionDetails.PackageIdentifier.Type = 'TRACKING_NUMBER_OR_DOORTAG'

    # remove FedEx operating company from request
    del track_request.SelectionDetails.OperatingCompany 

    track_request.send_request()
    json_response = sobject_to_json(track_request.response)
    json_response = json.loads(json_response)

    tracking_details = json_response['CompletedTrackDetails'][0]['TrackDetails']
    if 'ActualDeliveryTimestamp' in tracking_details:
         do stuff

It looks like the ActualDeliveryTimestamp was removed from the specifications for sobject_to_json wsdl specifications used by fedex-python between 2.4.0 and 2.4.1 (see here)

As a result, our code cannot get the essential data from the fedex api response, and the "do stuff" block in our code is unreachable.

I didn't see anything in a changelog about the update. When I contacted Fedex developer support, they claim that no updates were made to the structure of the data they send out.

  1. Are we using the package incorrectly?
  2. Where would I find out about breaking changes like this?

UPDATED to clarify my question as I understand the changes.

radzhome commented 1 year ago

Use the old version or adapt your code to the new wsdl