How update variable using API

Here some links that will help Link1

Link2