My Products
Help
Steinar Møller
PARTNER

Inventory endpoint attachements

by Steinar Møller

When getting list of products from Inventory
https://integration.visma.net/API/controller/api/v1/Inventory?expandAttachment=true&lastModifiedDate... 00:00:01&lastModifiedDateTimeCondition=%3E
Attachment are not returned, although the expandAttachement parameter is set:

We only getting attachment when running get on one and one product. 
How can we get a list of products including all attachements?

 

brgds Steinar    

12 REPLIES 12
Yıldırım
VISMA

by Yıldırım

Hello,

 

this has been planned to be fixed in Visma.net Financials API updates for version 8.66.0 (September 2021)

Release plan may vary, therefore please subscribe & follow the thread and the "News" section.

 

Thanks. 

Yıldırım
VISMA

by Yıldırım (Updated ‎15-09-2021 11:50 by Yıldırım VISMA )

Hello, 

  • "Attachments[] not returned in GET Inventory Endpoint response when using "Attributes" filter" 

This has been confirmed as a bug, we'll keep the thread updated accordingly once we receive further details. Thank you for your understanding.

Yıldırım
VISMA

by Yıldırım (Updated ‎09-09-2021 16:10 by Yıldırım VISMA )

Hello, 

we're able to receive the attachments in the GET All Inventory query while using "Attributes" filtering.
Therefore, we need more information to be able to identify the issue.

 

  1. What is your Attribute's Control type defined for "WEBVAREB2C" in the Financials UI ?
  2. What "Attributes" values has been assigned to those inventories ? 
    2021-09-09 17_06_35-Window.png
  3. When you set the Attributes Filter, are the only some inventories missing the attachment info, or all of them ?

 

Attributes screen can be found at "ScreenId=CS205000"

attributes.jpg

andreasaulin
CHAMPION **

by andreasaulin (Updated ‎10-09-2021 07:50 by andreasaulin )

Hi

 

All Products are missing Attachments - its missing completely from the returned JSON, not even an empty array.

This is the attribute

 

{
        "id": "WEBVAREB2C",
        "value": "1"
      }

 

This is the definition

{
    "attributeID": "WEBVAREB2C",
    "description": "Webvare B2C",
    "controlType": "Checkbox",
    "internal": false,
    "details": [],
    "metadata": {
      "totalCount": 25,
      "maxPageSize": 1000
    }
  }


One note
This

 

https://integration.visma.net/API/controller/api/v1/Inventory?lastModifiedDateTime=2021-08-31 00:00:01&lastModifiedDateTimeCondition=%3E

 

And this

 

https://integration.visma.net/API/controller/api/v1/Inventory?expandAttachment=true&lastModifiedDateTime=2021-08-31 00:00:01&lastModifiedDateTimeCondition=%3E

 

Both returns attachments. Do the expandAttachment parameter have any function?

Yıldırım
VISMA

by Yıldırım (Updated ‎10-09-2021 14:43 by Yıldırım VISMA )

Hello, 

"expandAttachments" is set "True" byDefault in the GET request. So query will be expanding the attachment array unless "expandAttachments" set false.

 

We've defined the same type of Attributes and retried our tests, we still can retrieve the uploaded attachment details. 

 

 

 

https://integration.visma.net/API/controller/api/v1/inventory?

attributes=%7B%22WEBVAREB2C%22%3A1%7D&
expandAttachment=true&
lastModifiedDateTime=2021-09-10T11:14:52.817&
lastModifiedDateTimeCondition=%3E

 

 

 

att.jpg

 

  1. Have you tried uploading another attachment and checking the results ? 
  2. Could you also try the same query with different attributes filtering for another inventories those are matching with ?
  3. It's also worth checking if the query results are the same when you try the request, for instance in Swagger / Postman etc.

Thanks.

andreasaulin
CHAMPION **

by andreasaulin

Hi

 

1. Yes. A lot of the products have attachments. The attachment property is not returned at all.

2. Tried with https://integration.visma.net/API/controller/api/v1/Inventory?lastModifiedDateTime=2021-08-31 00:00:01&lastModifiedDateTimeCondition=%3E&attributes=%7B%22HORECA%22%3A%22yes%22%7D
Same result. No attachment property is returned

3. I'm testing in Insomnia.

Yıldırım
VISMA

by Yıldırım (Updated ‎13-09-2021 11:30 by Yıldırım VISMA )

Hello Andreas, 

in this case, we need to restore the Company DB so that we can investigate this thoroughly. Further instructions to follow have been sent via the email.

 

Do you have information on since when this has started to happen ? 

by Magnus Johnsen

Hi Steinar,

We're not able to reproduce this in our company, when running the exact same query you have written in your post we get attachments returned:

2021-09-09 13_42_50-Postman.png

Could you please doublecheck that the items have files attached to them?

 

andreasaulin
CHAMPION **

by andreasaulin (Updated ‎09-09-2021 14:10 by andreasaulin )

From a list of products

 

...
"purchaseUnit": "STK",
    "stockItem": true,
    "attributes": [
      {
..

 

same product fetched directly

 

"purchaseUnit": "STK",
  "stockItem": true,
  "accountInformation": {
   ...
  },
  "costPriceStatistics": {
   ...
  },
  "attachments": [
    {
      "name": "xxx.jpg",
      "id": "a05fd2de-41eb-49f9-b107-14e87b0f1e77",
      "revision": 1
    }
  ],
  "attributes": [
    {
...

 

Edit:

Attachments are shown when not using

&attributes=%7B%22WEBVAREB2C%22%3A1%7D

 

When using attributes parameter, the attachments are not returned

 

Hi,

Please send the full URI you are querying.

So the issue in this case is that attachments are not returned, even though "expandAttachments" is set to true and the inventory list is filtered on attributes?

andreasaulin
CHAMPION **

Full URL not returning attachments

https://integration.visma.net/API/controller/api/v1/Inventory?expandAttachment=true&lastModifiedDateTime=2021-08-31 00:00:01&lastModifiedDateTimeCondition=%3E&attributes=%7B%22WEBVAREB2C%22%3A1%7D

Without the attributes-parameter, attachments are returned

https://integration.visma.net/API/controller/api/v1/Inventory?expandAttachment=true&lastModifiedDateTime=2021-08-31 00:00:01&lastModifiedDateTimeCondition=%3E

We'll have a look at this, thank you.