jorgewong

Post Data with Web API and JQuery

Discussion created by jorgewong on Aug 6, 2014
Latest reply on Nov 7, 2014 by David Golverdingen

I'm trying to post data back to PI using the new Web API.  I am able to pull point data no problem but my guess is there is something in my request I'm doing wrong.  I've starting putting my code together and it looks like this.  Any tips as to get it working?  I'm guessing its probably something to do with my URL but not entirely sure.  I just put a snippet of the javascript piece.

 

 

 

var postUrl = https://server/piwebapi/streams/;

var pointWebID;

 var postUrlComplete;



        $.getJSON(databaseUrl,function (database) {

            pointWebID = database.WebId;

           var pointsIDDomElement = $("#pointID");

            pointsIDDomElement.append("<li> <B>WebID:</B> " + pointWebID + "</li>");

           

            postUrlComplete = postUrl + pointWebID +"/Value=10";

            $.getJSON(postUrlComplete,function (writePoint) {

Outcomes