I've been looking for ways to use the API to create a new survey by concatenating other surveys given their IDs. I couldn't find anything that seemed like it would work for surveys directly, so I turned to the block API calls. Using these, I can get a block from an existing survey with GET and then POST it to the survey I want to append to. It's possible I overlooked some parameter in the call, but it seems like the POST only adds the metadata about the block - some options and the IDs of the questions in it - to the survey. I then have to go back to the original survey metadata and manually use GET to retrieve all the questions the block contained. For some reason, this returns them ordered differently from how they're actually displayed, so they then need to be reordered using the block metadata. After that, I can use a bunch of POST calls in a for-loop to append the questions to the appropriate block, one at a time.
This ultimately works, but it runs a little too slowly for my liking. It seems like appending blocks, or even entire surveys, would be a common enough use case for there to be a cleverer, and hopefully faster, solution. Is there anything I'm missing, or should I just stick to my current workaround?
Question
Straight-forward way to append two surveys?

Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.