From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use an API key with the HTTP funcitons

Solved!
Go to solution

I have a web service that provides an API key string.

The "Set API Key" function in the HTTP Client -> Security palette has two inputs, the private and public sections of the key.

 

Setting the given key for either/both does not work,  Setting my usernam as the public portion also does not work.

The service (Pushbullet) gives this example in their documentaion:

curl -u <your api key here>: https://api.pushbullet.com/api/devices

Any ideas how to make that work?

 

0 Kudos
Message 1 of 3
(3,764 Views)

API's will have a Public and Private key which function like a Username and Password. For a given API you will need both. Most online API's use different authintication methods which are not part of the HTTP VI's. There are community toolkits that have been made for a few of the methods. Namely there is an OAuth Protocal Library available. You will need to figure out what is required to communicate to PushBullet. I highly recomend looking at the Twitter API for LabVIEW from the LabVIEW Hackers for information on how they communicated to its API. This may help you create your own. 

 

The API Key's will have to be gotten from the service you are wishing to interface with. 

Alex D
Systems Engineer
Academic Research
National Instruments
0 Kudos
Message 2 of 3
(3,689 Views)
Solution
Accepted by topic author Jed_Davidow

Thanks for the message; I forgot I posted this.

FYI, for this particular code, they provided an API key but then their implementation required this as the username with a blank password.

 

Everyone does it slightly differently, but assumes that their method is the standard.  Sigh.

0 Kudos
Message 3 of 3
(3,685 Views)