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

**URL:** <https://forum.inductiveautomation.com/t/ignition-7-9-system-net-httppost-needs-api-key-gives-401-error-code-works-on-postman-just-fine/84870>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [January 29, 2024, 5:22am UTC](https://forum.inductiveautomation.com/t/ignition-7-9-system-net-httppost-needs-api-key-gives-401-error-code-works-on-postman-just-fine/84870 "2024-01-29T05:22:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Hobba](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@Dan\_Hobba](https://forum.inductiveautomation.com/u/Dan_Hobba)\
**Post date:** [January 29, 2024, 5:22am UTC](https://forum.inductiveautomation.com/t/ignition-7-9-system-net-httppost-needs-api-key-gives-401-error-code-works-on-postman-just-fine/84870/1 "2024-01-29T05:22:04Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/2/b28dc8d79f71b01b8aadb5ee4fb67f0925b36803.png)

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)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/c/dc36416e861c3858a310ce296aab0c7edcf7c27f.png)

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

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/a/6a875cd86ffb02c1c4421fbc695294b3151d981f.png)

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 ☹

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 29, 2024, 1:26pm UTC](https://forum.inductiveautomation.com/t/ignition-7-9-system-net-httppost-needs-api-key-gives-401-error-code-works-on-postman-just-fine/84870/2 "2024-01-29T13:26:34Z")

</div>

`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.

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [January 29, 2024, 2:13pm UTC](https://forum.inductiveautomation.com/t/ignition-7-9-system-net-httppost-needs-api-key-gives-401-error-code-works-on-postman-just-fine/84870/3 "2024-01-29T14:13:26Z")

</div>

> [@Dan\_Hobba](#):
>
> 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)
> 
> ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/c/dc36416e861c3858a310ce296aab0c7edcf7c27f.png)

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.

---

<div class="post-metadata">

**Author:** ![Dan\_Hobba](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@Dan\_Hobba](https://forum.inductiveautomation.com/u/Dan_Hobba)\
**Post date:** [February 1, 2024, 9:22pm UTC](https://forum.inductiveautomation.com/t/ignition-7-9-system-net-httppost-needs-api-key-gives-401-error-code-works-on-postman-just-fine/84870/4 "2024-02-01T21:22:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dan\_Hobba](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@Dan\_Hobba](https://forum.inductiveautomation.com/u/Dan_Hobba)\
**Post date:** [February 1, 2024, 9:32pm UTC](https://forum.inductiveautomation.com/t/ignition-7-9-system-net-httppost-needs-api-key-gives-401-error-code-works-on-postman-just-fine/84870/5 "2024-02-01T21:32:13Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2bfd03ccae57f3faf92e4999a6e11901bfaacf7c.png)

Still same error even with this update ☹

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 1, 2024, 9:33pm UTC](https://forum.inductiveautomation.com/t/ignition-7-9-system-net-httppost-needs-api-key-gives-401-error-code-works-on-postman-just-fine/84870/6 "2024-02-01T21:33:55Z")

</div>

Share code, not screenshots.

There's no need to encode the headers dictionary, see [system.net.httpPost - Ignition User Manual 7.9 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC79/system.net.httpPost)

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [February 1, 2024, 9:38pm UTC](https://forum.inductiveautomation.com/t/ignition-7-9-system-net-httppost-needs-api-key-gives-401-error-code-works-on-postman-just-fine/84870/7 "2024-02-01T21:38:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 1, 2024, 9:43pm UTC](https://forum.inductiveautomation.com/t/ignition-7-9-system-net-httppost-needs-api-key-gives-401-error-code-works-on-postman-just-fine/84870/8 "2024-02-01T21:43:39Z")

</div>

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.
