# HTTP protocol error. 401. - when running \<API QUERY\> matillion component

**URL:** <https://matillioncommunity.discourse.group/t/http-protocol-error-401-when-running-api-query-matillion-component/1344>\
**Category:** Matillion ETL\
**Created:** [May 17, 2021, 1:43pm UTC](https://matillioncommunity.discourse.group/t/http-protocol-error-401-when-running-api-query-matillion-component/1344 "2021-05-17T13:43:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AGosp](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@AGosp](https://matillioncommunity.discourse.group/u/AGosp)\
**Post date:** [May 17, 2021, 1:43pm UTC](https://matillioncommunity.discourse.group/t/http-protocol-error-401-when-running-api-query-matillion-component/1344/1 "2021-05-17T13:43:33Z")

</div>

Hello. I am trying to use \<API QUERY\> Matillion component.

I use the settings like: 1) Profile field: "Matillion API" 2) Data Source field: "Run Historical Details"&nbsp;&nbsp;3) Other required fields are set as well.

Result of running this component is:&nbsp; **HTTP protocol error. 401.**

&nbsp;

When I choose Profile field: "Sample", I am able to load the data in the table.

&nbsp;

Please let me know what could be a problem?

---

<div class="post-metadata">

**Author:** ![deBaris](https://avatars.discourse-cdn.com/v4/letter/d/57b2e6/32.png) [@deBaris](https://matillioncommunity.discourse.group/u/deBaris)\
**Post date:** [May 17, 2021, 3:35pm UTC](https://matillioncommunity.discourse.group/t/http-protocol-error-401-when-running-api-query-matillion-component/1344/2 "2021-05-17T15:35:54Z")

</div>

Hi AGosp,

&nbsp;

A [401 error](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401) means unauthorized, so you mabye have not put a username and password?

&nbsp;

On my system I have to remember to set

&nbsp;

- Authentication Method = User/Password (it defaults to 'Other')
- Username = A Matillion user which has been granted API privilege (more info [in this doc](https://documentation.matillion.com/docs/2338785))
- Password = the user's password

&nbsp;

For me sample never works without the above.

&nbsp;

BR

---

<div class="post-metadata">

**Author:** ![AGosp](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@AGosp](https://matillioncommunity.discourse.group/u/AGosp)\
**Post date:** [May 18, 2021, 8:10am UTC](https://matillioncommunity.discourse.group/t/http-protocol-error-401-when-running-api-query-matillion-component/1344/3 "2021-05-18T08:10:27Z")

</div>

Thank you [@deBaris](https://matillioncommunity.discourse.group/u/deBaris)​

I set the username and password and the issue was solved!

Best Regards, Alex
