I’m attempting to update a record in a table using URL Parameters but need some help with syntax for the JSON data i need to tack on the end of the URL. Here is what i tried
https://dsp-midata.cloud.dreamfactory.com/rest/midataAPI/SensorData/SENSOR1?method=PATCH&app_name=myappname&RecValue=123
Where RecValue is the value i want to update. According to the API Doc it should be a PATCH. I can update the value in using API Doc by don’t know how to put that all together in the URL as a parameter. The API Doc just gives me the a URL but doesn’t expose the parameters in the URL for me to use.
This format works using API Doc: {“RecValue”:“123”}
Any help appreciated.
Gary, is there a restriction that prevents you from passing posted data (a data payload?)
Sort of. Here’s the thing…I am testing the URL version of PATCH in Dreamfactory so i can then use it in the NBEclipse IDE by NetBurner. At the moment i have only figured out how to use a full URL to GET data from my Azure Tables via Dreamfactory. I was able to copy the URL it produces and use it in NBEclpse .NBEclpse compiles C++ and uploads it to a development board. The development board has sensors attached to it that change value. I need to send those changed vales to the cloud. I’m working with Netburner support as well since they did provide a sample that would utilize the data payload but it didn’t work. Netburner’s first comment was that maybe Dreamfactory wasn’t expecting a POST. In NBEclipse that was what i was trying to do. The function i used was DoJsonPost which took 4 parameters. 1 was the URL, 2 was the JSON formated data object, 3 is the JSON result object and finally a timeout value. So it goes something like this.
//I build a JSON object that holds the name-value pair. Dreamfactory will accept JSON
JsonOutToDF.StartBuilding();
JsonOutToDF.Add(“RecValue”,“444”);
JsonOutToDF.DoneBuilding();
//I assume I use DoJsonPost for a PATCH
bool result2=DoJsonPost(UrlReq,JsonOutToDF,JsonResult,10*TICKS_PER_SECOND);
if(result2)
{
JsonResult.PrintObject(true);
}
else
iprintf(“DF - Result failed \r\n”);
}
NBEclipse link:
http://www.netburner.com/products/netburner-software/nbeclipse-ide