# Json API issues

**URL:** <https://forum.manager.io/t/json-api-issues/29894>\
**Category:** Uncategorized\
**Created:** [August 6, 2020, 12:08am UTC](https://forum.manager.io/t/json-api-issues/29894 "2020-08-06T00:08:32Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![AliYusuf](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/aliyusuf/32/21940_2.png) [@AliYusuf](https://forum.manager.io/u/AliYusuf)\
**Post date:** [August 6, 2020, 12:08am UTC](https://forum.manager.io/t/json-api-issues/29894/1 "2020-08-06T00:08:32Z")

</div>

Hi,

I’m trying to use the manager API `user@pass:manager-url/api/` route and it’s work fine.

I just found out that I can use some reports data by appending .json in the URL:

> [@API: Invoice Add TotalAmounts and Paid Status](https://forum.manager.io/t/api-invoice-add-totalamounts-and-paid-status/28987/2):
>
> This is actually possible by appending `.json` to any URL path.

I tested in the browser while I have a session and worked fine, but I can’t use it without a session. It’s shows this error:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/manager1/original/3X/6/c/6ccf0b9092de9e0a68d576d55bb537d1f5f68dbf.png)

I tried using `Authorization: Basic *credentials*` header and I have same result.

Also, another thing that the json result does not respect the search filter in the tables `&Term=*some-filter*`, all results are shown always.

---

<div class="post-metadata">

**Author:** ![dalacor](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dalacor](https://forum.manager.io/u/dalacor)\
**Post date:** [August 6, 2020, 12:55pm UTC](https://forum.manager.io/t/json-api-issues/29894/2 "2020-08-06T12:55:58Z")

</div>

This is something that @lubos will need to investigate. He recently updated the api to fix a pdf creation bug. This is probably a different, but similar bug.

---

<div class="post-metadata">

**Author:** ![d3mad](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/d3mad/32/3963_2.png) [@d3mad](https://forum.manager.io/u/d3mad)\
**Post date:** [August 12, 2020, 6:09am UTC](https://forum.manager.io/t/json-api-issues/29894/3 "2020-08-12T06:09:54Z")

</div>

what’s the content of the “Internal Error” because I just tested a sales invoice view in 20.8.37 without a problem.

 ![Screen Shot 2020-08-12 at 4.07.29 pm](https://us1.discourse-cdn.com/flex019/uploads/manager1/original/3X/c/2/c210ce82a35764a57bb405ddcd9d624aa2ee5fb3.png)

---

<div class="post-metadata">

**Author:** ![MarkLL](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@MarkLL](https://forum.manager.io/u/MarkLL)\
**Post date:** [August 12, 2020, 10:18am UTC](https://forum.manager.io/t/json-api-issues/29894/4 "2020-08-12T10:18:35Z")

</div>

> [@AliYusuf](#):
>
> I’m trying to use the manager API `user@pass:manager-url/api/` route and it’s work fine.

You may of entered a typo in your post, but it should be `user:pass@manager-url/api/`

Also do you have curl installed?

I have Windows 10 running DeskTop version and WSL with ubuntu 18.04 running mono and manager-server (set to use port 8123).

`curl --ipv4 -v --get "http://administrator:@localhost:8123/api/index.json"`

returns

```
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8123 (#0)
* Server auth using Basic with user 'administrator'
> GET /api/index.json HTTP/1.1
> Host: localhost:8123
> Authorization: Basic YWRtaW5pc3RyYXRvcjo=
> User-Agent: curl/7.61.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: no-cache, no-store
< Content-Type: application/json
< Server: Mono-HTTPAPI/1.0
< Date: Wed, 12 Aug 2020 10:02:50 GMT
< Content-Length: 314
< Keep-Alive: timeout=15,max=100
<
[
  {
    "Key": "VGVzdGluZzAwMQ",
    "Name": "Testing001"
  },
  {
    "Key": "VGVzdGluZzAwMg",
    "Name": "Testing002"
  },
  {
    "Key": "VGVzdGluZzAwMw",
    "Name": "Testing003"
  },
  {
    "Key": "VGVzdGluZzAwNA",
    "Name": "Testing004"
  },
  {
    "Key": "Tm9ydGh3aW5k",
    "Name": "Northwind"
  }
]* Connection #0 to host localhost left intact

```

Then looking at an invoice for Northwind…

`curl --ipv4 -v --get "http://administrator:@localhost:8123/sales-invoice-view.json?FileID=Tm9ydGh3aW5k&Key=4850f691-6abc-41d1-8e7a-3e8b5662db56"`

which returns:

```
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8123 (#0)
* Server auth using Basic with user 'administrator'
> GET /sales-invoice-view.json?FileID=Tm9ydGh3aW5k&Key=4850f691-6abc-41d1-8e7a-3e8b5662db56 HTTP/1.1
> Host: localhost:8123
> Authorization: Basic YWRtaW5pc3RyYXRvcjo=
> User-Agent: curl/7.61.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: no-cache, no-store
< Content-Type: application/json
< Server: Mono-HTTPAPI/1.0
< Date: Wed, 12 Aug 2020 09:45:41 GMT
< Content-Length: 1253
< Keep-Alive: timeout=15,max=100
<
{"title":"Invoice","description":null,"reference":"3002","emphasis":{"text":"Overdue","positive":false,"negative":true},"fields":[{"label":"Invoice date","text":"8/9/2020","emphasis":false},{"label":"Due date","text":"8/9/2020","emphasis":false},{"label":"Invoice number","text":"3002","emphasis":false}],"custom_fields":[],"table":{"columns":[{"label":"Description","align":"start","nowrap":false},{"label":"Qty","align":"center","nowrap":true},{"label":"Unit price","align":"right","nowrap":true},{"label":"Amount","align":"right","nowrap":true}],"rows":[{"cells":[{"value":null,"text":"14/07/2020 - Testing"},{"value":3.25,"text":"3.25 hours"},{"value":14.25,"text":"14.25"},{"value":46.31,"text":"46.31"}]},{"cells":[{"value":null,"text":"20/07/2020 - "},{"value":null,"text":"&nbsp;"},{"value":125.0,"text":"125.00"},{"value":125.0,"text":"125.00"}]}],"totals":[{"label":"Total","text":"$ 171.31","number":171.31,"emphasis":true}]},"business":{"logo":"/business-logo-view?Key=4f6ce09d-d6f8-4ce5-bf3e-163718d7c263&FileID=Tm9ydGh3aW5k","name":"Northwind","address":null,"custom_fields":[]},"recipient":{"code":null,"name":"Around the Horn","address":"120 Hanover Sq.\r\nLondon NULL WA1 1DP\r\nUK\r\n","identifier":null,"email":null,"telephone":null}}* Connection #0 to host localhost left intact

```

Your error seems to indicate it may be an authentication error

I agree in regard to `&Term=*some-filter*` does not work. It would be really helpful if it did 🙂

---

<div class="post-metadata">

**Author:** ![AliYusuf](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/aliyusuf/32/21940_2.png) [@AliYusuf](https://forum.manager.io/u/AliYusuf)\
**Post date:** [August 14, 2020, 2:43pm UTC](https://forum.manager.io/t/json-api-issues/29894/5 "2020-08-14T14:43:40Z")

</div>

> [@d3mad](#):
>
> what’s the content of the “Internal Error” because I just tested a sales invoice view in 20.8.37 without a problem.

The problem presets in cloud/server editions … since the desktop edition doesn’t use authentication.

> [@MarkLL](#):
>
> You may of entered a typo in your post, but it should be `user:pass@manager-url/api/`

Ohh … thank you for correcting that 😅  
Anyway as I said the `/api/` path working fine as expected what is not working is normal URLs that end with `.json` …

I found that the issue happened only in the **administrator** user, then I checked my users and there were two users with `administrator` as username 😐, I just delete the one with red color and everything works fine now.

> [@MarkLL](#):
>
> I agree in regard to `&Term=*some-filter*` does not work. It would be really helpful if it did 🙂

The remaining issue is this, I hope @lubos fix this soon.

---

<div class="post-metadata">

**Author:** ![MarkLL](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@MarkLL](https://forum.manager.io/u/MarkLL)\
**Post date:** [August 25, 2020, 11:25am UTC](https://forum.manager.io/t/json-api-issues/29894/6 "2020-08-25T11:25:38Z")

</div>

> [@AliYusuf](#):
>
> > [@MarkLL](#):
> >
> > I agree in regard to `&Term=*some-filter*` does not work. It would be really helpful if it did 🙂
> 
> The remaining issue is this, I hope @lubos fix this soon.

So just an FYI… It is possible to get a list of **All Invoices** for a **single Customer** in json format.

If you browse to the Customer tab and check the links in the “Invoices” column you will see it includes a _Customer_ parameter and uuid. Just add the .json and it will look like the following.

`/sales-invoices.json?Customer=74c350ab-bbd2-4609-a1ae-4c58e8d548e6&FileID=Tm9ydGh3aW5k`

---

<div class="post-metadata">

**Author:** ![Tor](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@Tor](https://forum.manager.io/u/Tor)\
**Post date:** [March 5, 2021, 12:57am UTC](https://forum.manager.io/t/json-api-issues/29894/7 "2021-03-05T00:57:30Z")

</div>

Can this be put into ideas, that is filter parameter, like date, for API ?

---

<div class="post-metadata">

**Author:** ![Tut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/tut/32/3286_2.png) [@Tut](https://forum.manager.io/u/Tut)\
**Post date:** [March 5, 2021, 1:36am UTC](https://forum.manager.io/t/json-api-issues/29894/8 "2021-03-05T01:36:26Z")

</div>

Can what be put into ideas? You are responding to a thread pertaining to a Manager version that is now several hundred versions out of date.

---

<div class="post-metadata">

**Author:** ![Tor](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@Tor](https://forum.manager.io/u/Tor)\
**Post date:** [March 5, 2021, 3:15am UTC](https://forum.manager.io/t/json-api-issues/29894/9 "2021-03-05T03:15:00Z")

</div>

> [@MarkLL](#):
>
> I agree in regard to `&Term=*some-filter*` does not work. It would be really helpful if it did

@Tut, like @MarkLL points out, a filter parameter for API calls for Manager can’t be utilized. Also I could not find anything which solves this in the forum.

As an example, if a company has many years of accounting data in Manager and only wants to query with API the current year data and not having to move also alls data from previous years into say Excel, then a date parameter for API calls would solve that

---

<div class="post-metadata">

**Author:** ![Patch](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@Patch](https://forum.manager.io/u/Patch)\
**Post date:** [March 5, 2021, 3:29am UTC](https://forum.manager.io/t/json-api-issues/29894/10 "2021-03-05T03:29:25Z")

</div>

API calling a localisation and passing parameters normal accepted by the localisation would probably be more powerful. It may also involve less later customisation for NG Software as technical users & contract programmers could then implement any function they wanted.

---

<div class="post-metadata">

**Author:** ![Tor](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@Tor](https://forum.manager.io/u/Tor)\
**Post date:** [March 5, 2021, 4:31am UTC](https://forum.manager.io/t/json-api-issues/29894/11 "2021-03-05T04:31:20Z")

</div>

> [@Patch](#):
>
> API calling a localisation and passing parameters normal accepted by the localisation would probably be more powerful.

I don’t think localisation will nearly suffice for those using BI tools or want full capabilities of Excel auto refresh etc. Also companies in Manager each use all sorts of custom fields and want their speed and flexibility to move 100% all data, including custom fields data, to BI tools without having to go through localisation in Manager as additional layer.

Don’t misunderstand me, I have nothing against localisation and actually think it serves good purpose for standardised reports in each country. API is just ubiquitous these days and BI tools have greatly advanced and even so some larger companies/enterprises are starting to phase out data warehouses (skipping layers) to save on IT cost and get their data straight into BI tools.

As API is already built into Manager and it does mostly work well, I think updates to API parameters would be a good option

---

<div class="post-metadata">

**Author:** ![Patch](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@Patch](https://forum.manager.io/u/Patch)\
**Post date:** [March 5, 2021, 4:39am UTC](https://forum.manager.io/t/json-api-issues/29894/12 "2021-03-05T04:39:44Z")

</div>

The suggestion was you continue to use the API interface and external tools but you write a localisation / liquid code interface to deliver what ever data your external system needs.

Almost all data and searching is available within a localisation. An API call to a custom localisation would give the same access to your external application.

> [@Tor](#):
>
> I think updates to API parameters would be a good option

With an API to the users own localisation, the user would implement any required search and processing themselves.

---

<div class="post-metadata">

**Author:** ![Tor](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@Tor](https://forum.manager.io/u/Tor)\
**Post date:** [March 5, 2021, 4:55am UTC](https://forum.manager.io/t/json-api-issues/29894/13 "2021-03-05T04:55:34Z")

</div>

Ok good we agree then on getting the data to the external tools 🙂

I actually think those capable of using BI tools will have no problem with using APIs and I have seen here in the forum that many users are already extracting data from Manager with API

---

<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:53pm UTC](https://forum.manager.io/t/json-api-issues/29894/14 "2023-01-18T14:53:35Z")

</div>

Closed on January 18, 2023, 2:53pm UTC


