# Manager API Error 401

**URL:** <https://forum.manager.io/t/manager-api-error-401/12127>\
**Category:** Uncategorized\
**Created:** [October 10, 2017, 4:51pm UTC](https://forum.manager.io/t/manager-api-error-401/12127 "2017-10-10T16:51:37Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![sma11](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sma11](https://forum.manager.io/u/sma11)\
**Post date:** [October 10, 2017, 4:51pm UTC](https://forum.manager.io/t/manager-api-error-401/12127/1 "2017-10-10T16:51:37Z")

</div>

Hello, i tried using postman on chrome to test the api but i got error 401

[https://subdomain.manager.io/api](https://subdomain.manager.io/api)  
username: administrator  
password: \*\*\*\*\*\*\*\*

any idea why this error occur?

---

<div class="post-metadata">

**Author:** ![lubos](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/lubos/32/62798_2.png) [@lubos](https://forum.manager.io/u/lubos)\
**Post date:** [October 11, 2017, 12:25am UTC](https://forum.manager.io/t/manager-api-error-401/12127/2 "2017-10-11T00:25:20Z")

</div>

Error 401 would indicate the password is incorrect. I’m not able to reproduce this issue. I can log in as administrator or any other user who has administrator role.

---

<div class="post-metadata">

**Author:** ![sma11](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sma11](https://forum.manager.io/u/sma11)\
**Post date:** [October 11, 2017, 9:25am UTC](https://forum.manager.io/t/manager-api-error-401/12127/3 "2017-10-11T09:25:37Z")

</div>

it didn’t indicate any particular reason. just 401 unauthorized.

 ![Capture](https://us1.discourse-cdn.com/flex019/uploads/manager1/original/2X/d/d9e6affbc35ddbd1deee6c142004f7f6876e226f.PNG)

---

<div class="post-metadata">

**Author:** ![ShaneAU](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/shaneau/32/10122_2.png) [@ShaneAU](https://forum.manager.io/u/ShaneAU)\
**Post date:** [October 11, 2017, 11:25am UTC](https://forum.manager.io/t/manager-api-error-401/12127/4 "2017-10-11T11:25:10Z")

</div>

Two things to try:

Try logging in with the same password using the web interface. Does it work?

Try changing the endpoint to not end with a slash. Try /api instead of /api/

---

<div class="post-metadata">

**Author:** ![ShaneAU](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/shaneau/32/10122_2.png) [@ShaneAU](https://forum.manager.io/u/ShaneAU)\
**Post date:** [October 11, 2017, 11:26am UTC](https://forum.manager.io/t/manager-api-error-401/12127/5 "2017-10-11T11:26:52Z")

</div>

No, actually. You’re not passing in the details correctly!

Don’t enter username and password there. You’ve entered it into the parameters section instead by mistake.

Select “Basic Auth” on the Authorisation tab and you should see two dedicated fields for username and password:

 ![04 pm](https://us1.discourse-cdn.com/flex019/uploads/manager1/original/2X/1/123be853c19ad74a5503c2044fe26ace19e41fa3.png)

Let us know how you go after trying this 🙂

---

<div class="post-metadata">

**Author:** ![sma11](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sma11](https://forum.manager.io/u/sma11)\
**Post date:** [October 11, 2017, 12:18pm UTC](https://forum.manager.io/t/manager-api-error-401/12127/6 "2017-10-11T12:18:33Z")

</div>

thanks, i’m in

---

<div class="post-metadata">

**Author:** ![sma11](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sma11](https://forum.manager.io/u/sma11)\
**Post date:** [October 11, 2017, 12:20pm UTC](https://forum.manager.io/t/manager-api-error-401/12127/7 "2017-10-11T12:20:44Z")

</div>

but response isnt in json 😫😫😫 i want to connect manager api to a mobile app, i need json response

---

<div class="post-metadata">

**Author:** ![ShaneAU](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/shaneau/32/10122_2.png) [@ShaneAU](https://forum.manager.io/u/ShaneAU)\
**Post date:** [October 11, 2017, 12:24pm UTC](https://forum.manager.io/t/manager-api-error-401/12127/8 "2017-10-11T12:24:00Z")

</div>

> [@sma11](#):
>
> response isnt in json 😫😫😫

You might find it easier to also have your web browser open while you’re playing around with the API, until you become familiar with how it works.

Visit the `/api` route in your browser and enter your auth details. You’ll see a list of businesses and a file named `index.json` - it is this file that gives you data in the format you’re looking for.

> [@sma11](#):
>
> want to connect manager api to a mobile app, i need json response

Try what I suggested above. You can get JSON from the Manager API.

---

<div class="post-metadata">

**Author:** ![sma11](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sma11](https://forum.manager.io/u/sma11)\
**Post date:** [October 11, 2017, 12:32pm UTC](https://forum.manager.io/t/manager-api-error-401/12127/9 "2017-10-11T12:32:44Z")

</div>

> [@ShaneAU](#):
>
> index.json

i perfectly understand what you mean but “[Manager Xxxxx](https://xxxxx.manager.io/api/businessId)” does not have a json data

its easy to view list of business using index.json but “[Manager Xxxxx](https://xxxxx.manager.io/api/businessId)” displays  
CapitalSubaccount  
JournalEntry  
ProfitAndLossStatementAccount  
ProfitAndLossStatementGroup  
Tabs  
with no json data.

how do i navigate past this page

---

<div class="post-metadata">

**Author:** ![ShaneAU](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/shaneau/32/10122_2.png) [@ShaneAU](https://forum.manager.io/u/ShaneAU)\
**Post date:** [October 11, 2017, 12:40pm UTC](https://forum.manager.io/t/manager-api-error-401/12127/10 "2017-10-11T12:40:13Z")

</div>

It is true that the initial endpoint for a business does not have an `index.json` file. However, you’ll notice that the ID for each of these items is consistent.

For example, if you have two businesses:

The customers tab is at `ec37c11e-2b67-49c6-8a58-6eccb7dd75ee`.

So for any business, you would access it using this endpoint:  
`https://<domain>/api/<business>/ec37c11e-2b67-49c6-8a58-6eccb7dd75ee`

In the same way, Tabs is `ac789d1f-034f-4964-a8b5-ebfffc3511f2`.

So you could build up a list of constants in your client application, mapping the friendly name that you want to refer to it by, with the relevant ID - then use these constants for any business you access.

e.g. An array:

```auto
sections = [
    "Customers" => "ec37c11e-2b67-49c6-8a58-6eccb7dd75ee",
    "Tabs" => "ac789d1f-034f-4964-a8b5-ebfffc3511f2",
    // ...
]

```

This will make it easier for you to construct the URL you need:

```auto
endpoint = "https://<domain>/api/<business>/" + sections['Tabs'] + "/index.json";

```

---

<div class="post-metadata">

**Author:** ![sma11](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sma11](https://forum.manager.io/u/sma11)\
**Post date:** [October 11, 2017, 12:52pm UTC](https://forum.manager.io/t/manager-api-error-401/12127/11 "2017-10-11T12:52:02Z")

</div>

> [@ShaneAU](#):
>
> ec37c11e-2b67-49c6-8a58-6eccb7dd75ee

very detail explanation, thanks 🙂🙂 bookmarking the page

---

<div class="post-metadata">

**Author:** ![ShaneAU](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/shaneau/32/10122_2.png) [@ShaneAU](https://forum.manager.io/u/ShaneAU)\
**Post date:** [October 11, 2017, 12:55pm UTC](https://forum.manager.io/t/manager-api-error-401/12127/12 "2017-10-11T12:55:18Z")

</div>

You marked your own answer as solution! 😛

Please note that the API is in development, and may change in future. For example, a recent change split the Bank and Cash Accounts into separate tabs.

The side effect of this recent change is that it also affected the API, because that initial endpoint for a business is based on the tabs that are available and contain data.

So when tabs change on the front-end, the way you access data in the API back-end changes also. Just be prepared to make occasional fixes to your API client if you’re keeping the server up to date. Cloud Edition updates itself regularly, so a change might take you by surprise.

---

<div class="post-metadata">

**Author:** ![sma11](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sma11](https://forum.manager.io/u/sma11)\
**Post date:** [October 11, 2017, 1:08pm UTC](https://forum.manager.io/t/manager-api-error-401/12127/13 "2017-10-11T13:08:07Z")

</div>

okay, thanks again

---

<div class="post-metadata">

**Author:** ![Ealfardan](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/ealfardan/32/63166_2.png) [@Ealfardan](https://forum.manager.io/u/Ealfardan)\
**Post date:** [January 18, 2023, 2:50pm UTC](https://forum.manager.io/t/manager-api-error-401/12127/14 "2023-01-18T14:50:02Z")

</div>


