Just wondering if Webhooks will be a better choice - http://docs.particle.io/photon/webhooks/
like you can trigger a url hosting the script you write/wrote for the login instead of doing a direct request?
There is a guy who interfaced with a Sonos that should be using XML: Hover + Spark = Sonos Remote