A little while ago I did something related:
Not sure if it helps. I can take a closer look a your actual request later on.