This post is a bit geeky/nerdy, so don’t feel obliged to read it!
At the start of October, Tweetphoto changed their API. As most folk know nothing about code, it’s kinda like they changed the combination to the lock. That meant loads of whinging from me as the old API did everything I needed. I think that made them add a new section to the API for me, but alas I couldn’t get it to work. There was loads of back and forth, and I’m sure my frustration was showing. They were patient with me, but I still couldn’t get an upload going. All the code seemed perfect, in line with the new API, but no joy, I couldn’t upload. So I did what any good quitter does and gave up.
I’d already promised a cross grade to any user that wanted to go to Twitpic, so there was an out in that form. Still I wasn’t happy with that. So the other night I started tinkering again. I commented out the optional sections of API until I got an upload. This little success led me to fixing my issue, which, believe it or not, was down to a misplaced space. With upload working, I considered myself done. Just as I was about to go to bed, I figured I better check the error list, and make sure it was parsing correctly. Disaster. Garbled internal error messages. I was a bit distraught, coming down quickly from the ecstasy of getting an upload again. I sent out feelers in a few directions for help. I left the code and started back to work on a new Web Gallery that I was building to create my new website: SkyWaterLand.com.
The Tweetphoto guys came back telling me that the I probably wasn’t going to get any XML error codes back from this API, but to check the HTTP status codes. Of course I couldn’t see what was coming back as the log didn’t show anything. Eventually I had a peek at my Twitpic code and noticed I’d left out a line to print the log.. Doh! After inserting the code, I was able to see the exact error coming back in the Console. It wasn’t an actual HTTP/HTML response as I expected, it was simply ‘Bad Request’. Well that meant that I needed to search for ‘Bad Request’ and trap that error. So all seems well now. Of course the code needs to be compiled again and tested, but I’m glad I’m at least to that stage again after having practically given up.