This question- started answering and realised it is is actually a dupe and marked it. OPs clarification not withstanding. Knowledgeable folks here can clarify ?
I dunno: this later question is quite specifically asking for an API, while the earlier guy wants an API but is asking for a way to do it from the user's point of view.
@bmdixon- beats me- i have heard of people put heating up laptops in fridge for a while (that is equally bad- think of condensation that would happen when taken out ) but this takes the cake (couldn't resist that being an oven)
@DanHulme- lot of safety built in these days
@DanHulme: As a mod can you trash the answer? If downvoting helps- would gladly do
@beeshyams I don't feel that that is a good thing to do, because it is an answer to the question. We don't delete answers for being wrong, even if they're dangerous.