My Products
Help
Anonymous
Not applicable

API/controller/api/v1/$batch returns 401 Unauthorized for all requests but the first one

by Anonymous (Updated ‎02-02-2021 13:39 by Yıldırım VISMA )

Getting customers or customerpayment methods with batch request returns OK for the first request from the list and 401 for all the others. Here is an example

Batch Requests
GET /api/v1/customer/10076 HTTP/1.1
Accept-Encoding: identity
Accept: application/json
Host: integration.visma.net/API/controller

GET /api/v1/customer/10075 HTTP/1.1
Accept-Encoding: identity
Accept: application/json
Host: integration.visma.net/API/controller


Batch response from API/controller/api/v1/$batch

--97866de2-527d-4db5-b754-5c6a0f7a43b2
Content-Type: application/http; msgtype=response

HTTP/1.1 200 OK
Content-Type: application/octet-stream, application/json; charset=utf-8

{"internalId":22156,"number":"10076","name":"...}
--97866de2-527d-4db5-b754-5c6a0f7a43b2
Content-Type: application/http; msgtype=response

HTTP/1.1 401 Unauthorized


--97866de2-527d-4db5-b754-5c6a0f7a43b2--


When the GET requests are swapped again only the first customer in that case 10075 is returned

--d23d7921-0e60-4db1-9f65-f873bec587a3
Content-Type: application/http; msgtype=response

HTTP/1.1 200 OK
Content-Type: application/octet-stream, application/json; charset=utf-8

{"internalId":22155,"number":"10075","name":"...}
--d23d7921-0e60-4db1-9f65-f873bec587a3
Content-Type: application/http; msgtype=response

HTTP/1.1 401 Unauthorized


--d23d7921-0e60-4db1-9f65-f873bec587a3--

Has there been change in the batch authorization, this has worked for the last year?

5 REPLIES 5

by Yıldırım (Updated ‎26-11-2020 09:59 by Yıldırım VISMA )

Hello, we will look into this and get back to you soon.
Meantime, can you please send your "API CLIENT ID" to developersupport@visma.com ? 

We confirm that, regardless of how many batch lines are included, only the first request is handled and the rest fails with 401 - Unauthorized. This has been reported to the team. We'll get back to you once it's consolidated.

This has been confirmed as a bug. $Batch Endpoint returns 401 for all requests except first operation sent in the payload. 

1) Request Headers
req_headers.png

 

 

 

 

 

 

 

2) RequestBody: 

--batch_357647d1-a6b5-4e6a-aa73-edfc88d8866e
Content-type: application/http; msgtype=request

GET /api/v1/customer/10001 HTTP/1.1
Accept-Encoding: identity
Accept: application/json
Host: integration.visma.net/API/controller


--batch_357647d1-a6b5-4e6a-aa73-edfc88d8866e
Content-type: application/http; msgtype=request

GET /api/v1/customer/1001 HTTP/1.1
Accept-Encoding: identity
Accept: application/json
Host: integration.visma.net/API/controller


--batch_357647d1-a6b5-4e6a-aa73-edfc88d8866e
Content-type: application/http; msgtype=request

GET /api/v1/customer/295 HTTP/1.1
Accept-Encoding: identity
Accept: application/json
Host: integration.visma.net/API/controller


--batch_357647d1-a6b5-4e6a-aa73-edfc88d8866e--

3)Response

response.png

 



 

 

 

 

 

 

Currently, we're unable to share the exact date for when this can be fixed, please be advised that we do our best to deliver this fix within the upcoming release. Please subscribe to the Visma.net Financials API updates for version 8.29 (December 2020) We'll keep aforementioned thread updated. Thank you for bringing this issue to our attention.

Anonymous
Not applicable

by Anonymous

I can verify that release 8.29 has fixed the error. All requests in a batch get correct response.

Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

Thank you for confirming this.

You can find the latest release notes here: [Release Notes] - Visma.Net API 8.29 - 1.12.2020