How update variable using API

This will do the job i think Link