Developer forum

Forum » Integration » BC PIM Connector: "Apply updates" fails with 401 Unauthorized mid-run, initial sync works

BC PIM Connector: "Apply updates" fails with 401 Unauthorized mid-run, initial sync works

Arnór Halldórsson
Arnór Halldórsson
Reply

Hi guys,

We're seeing consistent 401 Unauthorized failures from the Dynamicweb PIM Connector for Business Central (v1.1.1.0) when running Apply updates. Initial full sync completes without errors and products appear in BC, so credentials and connectivity are valid.

Environment

  • DW10, PIM Connector, version 1.1.1.0
  • Endpoint: https://[server-ip]/admin/api/BCProductUpdate
  • Error: failed with status code 401 Unauthorized
  • Call stack ends in DWAPIWrapper_EX(CodeUnit 6177280).ReportAPIError via FullProductSync → ProcessProductUpdates → SendProductDataToPIM
  • Example timestamp: 2026-08-18T09:17:58.4992533Z

Behavior

  1. Connecting the PIM connector app in BC with DW is successful.
  2. Initial sync runs clean, including a 3000+ item batch.
  3. Every Apply updates run since fails partway through, consistently around item ~500 of ~6000, roughly the same point each run.
  4. Reducing the product set to 747 items did not fix it, same 401 error.
  5. All users hit the identical error.
  6. This is a newly provisioned environment: New BC environment against a new staging web. An earlier setup (separate test BC + test web) ran Apply updates reliably. Our hosting team has reviewed the server environment and found no blocking, rate limiting, or network issues, so far :)

The fuil error details from BC:

Error message: 
The request to https://[server-ip]/admin/api/BCProductUpdate failed with status code 401 Unauthorized.

Internal session ID: 
f2d48103-766e-4b23-965e-a647a49c046b

Application Insights session ID: 
01677dad-1931-46ca-b727-810cbde73ed0

Client activity id: 
4fd8620f-c2ac-468c-af26-8bae64ca6776

Time stamp on error: 
2026-08-18T09:17:58.4992533Z

User telemetry id: 
194fdeba-3d9d-4766-b530-4c97a3ab5a41

AL call stack: 
DWAPIWrapper_EX(CodeUnit 6177280).ReportAPIError line 6 - DynamicWeb PIM Connector by SignUp Software AB version 1.1.1.0
DWPIMDataExchangeManagement_EX(CodeUnit 6177295).SendProductDataToPIM line 26 - DynamicWeb PIM Connector by SignUp Software AB version 1.1.1.0
DWPIMDataExchangeManagement_EX(CodeUnit 6177295).ProcessProductUpdates line 88 - DynamicWeb PIM Connector by SignUp Software AB version 1.1.1.0
DWPIMDataExchangeManagement_EX(CodeUnit 6177295).FullProductSync line 16 - DynamicWeb PIM Connector by SignUp Software AB version 1.1.1.0
DWOverview_EX(Page 6177273).ApplyAllUpdates line 7 - DynamicWeb PIM Connector by SignUp Software AB version 1.1.1.0
DWOverview_EX(Page 6177273)."ApplyUpdates - OnAction"(Trigger) line 2 - DynamicWeb PIM Connector by SignUp Software AB version 1.1.1.0

Custom dimensions: 
[]

Does the token/session the connector obtains have a TTL, and does the connector refresh it mid-batch, or hold one token per "Apply updates" run?

Have you guys run into this or a similar issue in other setups?

Best regards,
Arnór


Replies

 
Matthias Sebastian Sort Dynamicweb Employee
Matthias Sebastian Sort
Reply

Hi Arnór,

Thanks for the detailed report — the stack trace plus "fails at the same point every run" is what made this diagnosable.

Short version: despite the status code, I do not think you are looking at an authentication problem.

Your two questions first

The connector authenticates with the API key you generated in Dynamicweb during setup. That is not a short-lived access token — it has whatever expiry date was set when it was created, and it is sent as-is on every request. There is no per-batch refresh because nothing expires mid-run. A key that works for item 500 is still valid for item 501.

Why you get a 401 anyway

The /admin/api/ endpoints answer 401 in two quite different situations:

1. The caller is not authenticated — unknown, revoked or expired API key.
2. The caller is authenticated, but lacks permission for the specific record it is touching.

The second case is really a 403, and that is on us — it is exactly what sends you looking at tokens.

For BCProductUpdate, case 2 occurs when the user behind the API key does not have Edit permission on the product being updated. Product permissions in Dynamicweb are inherited from the product's groups, so this can be true for some products and not others — which fits "the same item every time" far better than anything time-based does. It also explains why the initial sync succeeded: creating a product is checked against a general create permission, while updating an existing product is checked against that product's own groups.

What to check first

Start with the user your API key belongs to. The key is tied to whoever was signed in when it was generated — if you generated it yourself, that is your user.

Then, in the Dynamicweb backend:

1. Go to PIM and find the product groups the Business Central sync writes into.
2. Open a group's context menu and choose "Permissions" (the padlock entry).
3. The screen lists "Explicit permissions" and "Inherited permissions", each showing the user or user group it applies to and the level granted.
4. Look for the entry covering the API key's user — either directly, or through a user group that user is a member of.

The level needs to be Edit or higher. Two things to watch for:

- A level of "None" is an explicit deny, not an absent setting. It overrides whatever the group would otherwise inherit, so a single "None" somewhere in the tree stops updates for everything below it.
- Products can belong to more than one group, so work through the whole tree rather than only the obvious group.

You will only see the "Permissions" entry if your own user has full rights on that group.

Since the run stops at the same item every time, you are looking for a corner of the tree where the level drops below Edit while the rest is fine.

If the permissions all check out

Then we should look at what Dynamicweb actually sent back, because the response body distinguishes the two cases above even though the status code does not.

Write back here and we will send you a short guide for enabling a diagnostic log in the Business Central extension. It records every call made to Dynamicweb together with the full request and response payloads, so we can read the real message rather than infer it from the status code.

Let us know how you get on

BR

Matthias Sort

 

 
Arnór Halldórsson
Arnór Halldórsson
Reply

Hi Matthias,

Thanks for the detailed reply :)

We'll go through the product group permission tree for the API key's user this week, confirm which product the run stops on and check the inherited permissions from there.

We'll keep you posted once we know more.

Best regards,
Arnór

 
Gunnar Örn Baldursson
Reply

Hi, I'm working with Arnór and I looked at our products and products groups, but I don't see any unusual permsisions. If I query UnifiedPermission table, there are no records for Products or Product Groups.. can you send us this guide so we can get a better diagnostic report in BC?

Best Regards,

Gunnar

 

You must be logged in to post in the forum