Aahhh! The joys of integrating with third-party API’s. Trying to get your application to talk to a third-party API is sometimes tricky, especially if the API documentation is not up to date. SOAP is supposed to make this simpler by providing a WSDL from which you can generate classes. So what are you supposed to do if the documentation and the WSDL seem out of date?
Clarification: By out of date I mean that the documentation for a particular object states it has retrievable properties a, b and c, the WSDL has properties a, c and d, and by trial and error you finally figure out that only a and d are retrievable.
Not to fear, ExactTarget provides a SOAP method that describes objects. You pass the object name as a parameter and in return you get a list of all properties and their attributes. One of the attributes is isRetrievable, which is what I am after.
Great! Right? Well, mostly…
For most objects the method described below returns accurate results from what I can tell. The only object I have encountered so far that has an incorrect result form this method is EmailSendDefinition.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
The Describe method is quite handy and I use it quite a bit when exploring the API, so I added it to my PHP library for accessing ExactTarget’s SOAP API. You can get the lib here, and this is how you would get the definition for the above EmailSendDefinition object:
1 2 3 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
As I learn more about the ExactTarget SOAP API and SOAP itself I will be posting my findings and expanding the library on github.