Ignition 7.9 system.net.httpPost needs API Key, gives 401 error code. Works on Postman just fine

Hello!

I am in a little bit of a pickle here.

The Pickle: system.net.httpPost does not work, however the same header (just a single API token) sent to the same URL on PostMan works just fine.

Here is the image of the PostMan Details:

Here is the code I am using in the ignition script (please ensure I have checked the token about 20 times to make sure I haven't made any spelling mistakes)

Here is the error I keep getting from Ignition when I try and run the POST command:

I have heard to use the HTTP Client command, however I don't believe 7.9 has this feature.

Could someone please help here?? I have been stuck on this for about 2 hours now with no luck :frowning:

httpClient was created to solve this and a bunch of other deficiencies in the other functions. It is not available in v7.9. Plan on upgrading.

It looks like you're sending a header dictionary with a key value of 'Authorization' (with embedded single quotes) instead of the literal Authorization header. That might be your issue.

2 Likes

Dang, not sure if I can.... company software for entire factory. There is no way around this in 7.9?

Still same error even with this update :frowning:

Share code, not screenshots.

There's no need to encode the headers dictionary, see system.net.httpPost - Ignition User Manual 7.9 - Ignition Documentation

If you need to redact, consider a ticket with support. They are under NDAs'.

7.9 however is now completely out of support, so I'm not sure what their stance on this is going to be.

7.9's current status only means there will be no more releases, whether it's feature, bug fix, security, etc...

Support will still help you the best they can.

2 Likes