Using Post command through browser but ultimately google script

First you need to drop the ampersand & in these two lines, since without [] it’s already an address.

  ...
  Spark.variable("temperature", &tempstr, STRING);  
  Spark.variable("outMotion", &motionstr, STRING);
  ...

And your function inMotionStore() should return an int value.
But the functionality in there looks a bit crude, but since I don’t actually know what you want to do with it, I guess it’s OK.

Unless you need your Spark.variable strings JSON encoded, you could just build them as you actually want them, since they will be wrapped up propperly by the Core firmware anyway.


Please read this thread how to format code propperly.