Using ExactTarget’s FuelSDK, how do I parse the response object?

I’m able to successfully retrieve results using Exact Target’s Python FuelSDK, but can’t figure out the format of the response.results object or how to parse it.

It looks like JSON… but not quite.

Does anyone know what format it’s in, or if it’s not a standard format, can anyone point me to an existing parser?

An example of response for a Send object (getResponse.results in many of the SDK’s code samples):

       Client = 
             ID = 1966311
       PartnerKey = None
       PartnerProperties[] = 
             Name = "BCCEmail"
             Value = None
       CreatedDate = 2012-04-17 11:04:00
       ModifiedDate = 2012-04-17 11:04:58.000001
       ID = 11099
       ObjectID = None
       Email = 
             PartnerKey = None
             ID = 6511
             ObjectID = None
       SendDate = 2012-04-17 11:04:00
       FromAddress = ""
       FromName = "Person 1"
       Duplicates = 0
       InvalidAddresses = 0
       ExistingUndeliverables = 0

etc. etc.


This looks like a Python object returned by the suds package, which is what the Fuel-SDK uses to make SOAP requests.

If the code snippet you posted is what is stored in response.Results, you should be able to access the values like this:

for send in response.Results:
    print send.SendDate

Or like this:

print response.Results[0].SendDate

If you want to serialize a suds object, you may want to take a look at these posts:

Source : Link , Question Author : Nick , Answer Author : Community

Leave a Comment