I created a new CFC for accessing the new UPS API using JSON. I mainly use the rates API which sends a slight big and multi level JSON. I decided to go with creating a struct and then serialize it to JSON. Works great except the keys need to be case sensitive, so the struct is built like an array (struct[“Key”][“Subkey”]…etc). I looked at components but you would need a bunch of them to make all the layers and it seems to be more confusing than the struct.
Anyone done anything like this and have any better input?
You can see my struct based CFC and example at https://github.com/kabutotx/upsapi
4 posts - 4 participants