POST HTTP with LABVIEW [Solved]

I want to connect my photon core with labview without using Javascript, I used Labview Library HTTP, with POST.vi but I don’t want the JSON or javascript, I want to understand why

this URL works
https://api.simonpainter.com/core/v2/?device=MYDEVICEID&function=led&access_token=MYACCESSTOKEN&command=12

and this one doesn’t
https://api.particle.io/v1/devices/2a003b001447353136383631/led/?access_token=MYACCESSTOKEN&command=12

well the first one labview can’t autheticate the server, does someone know?

Yor second URL is formatted like a GET request, but Particle.functions() need to be POSTed.
Have a look in the docs how the curl commands are made up.

1 Like

ok, but with cURL, Can I request exactly the same way with cURL than with URL?, because I read cURL is using with command line, and I need a URL.

Hi @ysel96brigette

You cannot do a http POST request for a Particle function with just a URL–you need to add the POST parameters and they go in the body, not the URL. I am sure LabView can do a http POST request, you will have to look up exactly how.

2 Likes

Don’t worry, I already did it. and I can do a http post request for a Particle function with Just a URL. :smile:

Hi I am new in photon and labview also in this forum. I have read this topic maybe you can help me I want to sense a temperature sensor and show the dashboard with labview. It seems that you can help me with that. thanks so much

What have you tried so far?

HI, Moors7 Iam trying to send data via serial port from de photon to LabView (Maybe thats my first error), bc in labview I get and error. Also when I look for the COM for Photon in the Devices Manager I get that Serial Photon driver is no there.

I understand that you send the data to a cloud with photon, so I think that the way Iam doing this is wrong. Thanks for you help

Hey, I use this for serial

and I use this for read and write information on a particle server cloud

Thanks ysel96briggette i am gonna try it

1 Like

I am trying to get tata from my photon to labview. I downloaded the VI’s but they ask for stuff that I am unclear as to what they want.

GET-Particle vi asks for:

Device ID which I understand

Nombre de la Variable which I assume is the variable number… what is this?
Access Token what is this? and where do I find it?

thanks steve

Google translate never hurts... "Variable name".

The token which grants you access to control your devices.

https://docs.particle.io/tutorials/developer-tools/build/photon/#account-information

2 Likes

Fortunately you can translate it hahaha … I will do it again in English…

GetParticleFunction


Im not sure if still working with new updates of Photon, I guess they should, but these were the Block Diagram of each VI.