# Error message as  "msg": "Status code was 401 and not \[202\]: HTTP Error 401: Unauthorized",

**URL:** <https://forum.ansible.com/t/error-message-as-msg-status-code-was-401-and-not-202-http-error-401-unauthorized/31895>\
**Category:** Ansible Project\
**Created:** [January 3, 2020, 1:59pm UTC](https://forum.ansible.com/t/error-message-as-msg-status-code-was-401-and-not-202-http-error-401-unauthorized/31895 "2020-01-03T13:59:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vijay\_Ravindran](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@Vijay\_Ravindran](https://forum.ansible.com/u/Vijay_Ravindran)\
**Post date:** [January 3, 2020, 1:59pm UTC](https://forum.ansible.com/t/error-message-as-msg-status-code-was-401-and-not-202-http-error-401-unauthorized/31895/1 "2020-01-03T13:59:38Z")

</div>

Hello Team

The below error msg keep on coming

“msg”: “Status code was 401 and not [202]: HTTP Error 401: Unauthorized”, as i use URI for enabling a POST operation via REST API

Really seeking your help please.

Thanks

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [January 3, 2020, 2:52pm UTC](https://forum.ansible.com/t/error-message-as-msg-status-code-was-401-and-not-202-http-error-401-unauthorized/31895/2 "2020-01-03T14:52:44Z")

</div>

> Hello Team
> 
> The below error msg keep on coming
> 
> "msg": "Status code was 401 and not [202]: HTTP Error 401: Unauthorized", as i use URI for enabling a POST operation  
> via REST API
> 
> Really seeking your help please.
> 
> Thanks

Vijav it is all there in the error messages ... you need to provide the proper credentials.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke
