Documents URL changed!

I am using Manager Server v22.9.1.350 on Ubuntu 20.04 and my Sales Invoices links contain Key and FileID but in the following sequence (domain name deleted this is after the /).

/sales-invoice-view?Key=4e10434a-a9f3-44d1-91a6-c1d53ac2fb79&Position=1&MaxPosition=1&FileID=dGVzdCBsYXRlc3Q&Referrer=L3NhbGVzLWludm9pY2VzP1NraXA9MCZUYWtlPTUwJkZpbGVJRD1kR1Z6ZENCc1lYUmxjM1E

I tried to reproduce your issue and I can report that the behavior is a bit perplexing. I tried to decode the query string and it appears to be recursing.

Take this query string for example:

https://{x}.manager.io/sales-invoice-view?ogYNMDAzX05vcnRod2luZKoGLi9zYWxlcy1pbnZvaWNlcz9vZ1lOTURBelgwNXZjblJvZDJsdVpNQU1BTWdNTWfCDBIJpCLnbDeLg0kRtvLVIDNYf47IDB7QDIMQ

The string

ogYNMDAzX05vcnRod2luZKoGLi9zYWxlcy1pbnZvaWNlcz9vZ1lOTURBelgwNXZjblJvZDJsdVpNQU1BTWdNTWfCDBIJpCLnbDeLg0kRtvLVIDNYf47IDB7QDIMQ

decodes to:

003_Northwind./sales-invoices?ogYNMDAzX05vcnRod2luZMAMAMgMMg	"l7I 3X

Which in turn decodes to:

003_Northwind�2	{#u

I’m not sure if this is by design or if it’s a bug.

So maybe this is cloud server setting related as I can not reproduce it in Manager Server?

I’m using Cloud Edition Version 22.9.5.365

Cloud version v22.9.5.365 is ahead of Desktop and Server editions that are v22.9.1.350 so as suggested maybe it is an issue with Manager cloud.

It’s true URLs have changed yesterday. Not API though. Just everything else outside of API.

For the record, I do value clean readable URLs. But they do introduce extra layer of complexity into the program. It got to the point where it’s just easier for me to encode query parameters as binary data (which can be compressed if needed).

There are no secrets in query parameter. It’s just encoded differently.

I know this kind of creates a problem where URLs are no longer “guessable”. But the way I look at this, “guessable” URLs are still in API and always will be.

How can I decode it using JavaScript?

Good to know

Wouldn’t be a problem if there were WebHooks. I would change the word “guessable” by “usable”. Now is not usable.

1 Like

Can you please tell us how to get the query from this new way encoded string?

I just getting something like this afetr decoding base64:

(/sales-invoices?ogYJQ29uenVsdGVrwAwAyAwy bJHFv$|\

I haven’t figure out how to get the key of the document from here. This is the only thing I need.

@rdavidsc The query string is protocol buffers encoded in base64. The key itself is 128-bit label representing GUID.

So it’s not like there are any secrets in query string. But these query strings are not meant for API consumption or de-serializing at your end.

So rather than trying to de-serialize query string, what does your integration do and how API itself can be improved to achieve what you need?

1 Like

Hi there! Thanks for you answer.

What I really need is to detect the moment when the user create a document (sales invoice and purchase invoice).

If there were WebHooks would be perfect because I could receive the data (FileID and key) so I could then make an API call and get the rest of the info and make some calculations like utility by invoice, commission, etc.

Meanwhile, as there are no WebHooks, what I was doing was using an JavaScript extension to detect when the user make a new invoice and send my own http request (emulating a Webhook). I used to take the FileID and key from the URL.

In addition to, now extensions are an obsolete feature…

All this described before, just to avoid to pool the API every second looking for a new invoice. WebHooks is a better solution because it saves a lot of CPU resources for both ends. The API call is made only when needed, not every second.
cBesides, when the API is called to get a list, there is no limit, no pagination, there is no filter… So every call will bring a lot of unnecessary data.

I hope you can consider to have WebHooks.

Cheers!

1 Like

Is the API really the best way of doing this? Would not an external program call which is passed appropriate data be a cleaner solution? Similar calls are already required for tax authority reporting / integration elsewhere.

Hi @Patch !

How do you think a external program can get the appropriate data? I think the best way to make an integrations is using the API. What other solution do you propose?

In my case, that external call is made form another server where I have deployed my program. But this program need to be notified when a new invoice is created. And yes, other requirement I have is to pass the invoice data to the local tax authority.

  • Which country is this for?

  • Have you got your solution to submit data to your tax authority or just planning to in the future?

  • Have you considered contributing to the localisation for your country?

1 Like

Panama Republic.

Yes, there are some providers government approved and the only thing is to send them a JSON or a XML with the data. And I have to be doing this before the year ends.

Yes, I would love to. I fact, I have made some language contributions several years before.

1 Like

Hi @lubos, can you give an example of the .proto file you use to encode/decode? I have been studing the protobuffer and is seems to be necesary a estructure file.

Manager can be improved with Webhooks!

That sounds similar to

In summary, a Manager localisation which formats the data then facilitates communication with the tax authority has greater potential to share development costs than a separate program interrogating Manger and is consistent with development elsewhere in Manger. @rdavidsc you contributing to the Panama Republic localisation would be an excellent outcome imo

Sorry, I am not sure this is the right place to post this, but we are having issues with the API as well.

We used to get inventory items in json form by using this url manager.io/inventory-items.json?fileId but now this gives “Unimplemented error”. Any idea on how we can use that now. What we want is a list of inventory items but with some reporting like qtyOnHand, QtyTo receive, which the API doesn’t give currently.

Hi again. I haven’t found a solution for not having WebHooks yet. The thing is, I need to know the key of the document modified at the moment of the update.

If I use the API and look for the timestamp, still have a problem because after my calculations or modifications to the document, there is a new timestamp and the process calls it itself again and again in an infinite loop.

What do I need:

  • Somewhere in the app where I can specify the type of document, the action (create, edit, delete) and the URL where to receive a Webhook.
  • The Webhook should send the document type and key. Nothing else. With this info is possible to do the rest with the current API.

Hi there!

Where can I start looking into this? I have two choises: make custom enougth Manager for Panama and electronic invoicing or change to QB or something else after 6 years with Manager.

Thanks in advance.