The API is always unaythorized

DenisVASI

Cadet
Joined
Apr 3, 2021
Messages
2
Hi.
I recently started using TrueNAS and I have the task of creating a target by API.

I send a POST to http://172.16.0.18/api/v2.0/iscsi/target
with header Authorization: Basic 1-asdcsadvnbhl...my key

I even tried converting Basic 1-asdcsadvnbhl...my key to base64 and nothing worked.

I always get a 401 unauthorized response

Please help me.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Last edited:

DenisVASI

Cadet
Joined
Apr 3, 2021
Messages
2
Cool, it works, but I'm confused, how do I create a volume via api?

In fact, I want to run the wizard on the api
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
I assume from your context you mean iSCSI volume. There is no wizard for the API; the API assumes you know what you're doing.


and scroll down until you find the iSCSI sections.
 
Top