web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

PATCH Request Automation API : Resource not found for the segment 'extensionUpload'

(1) ShareShare
ReportReport
Posted on by 2,250 Moderator

Greetings Community - Having used the BC API Automation before, this is the first time I am facing a weird situation.

My goal is to publish a simple extension through automation API, following the 3 steps listed by MS here in this link. https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/itpro-introduction-to-automation-apis#upload-and-install-a-per-tenant-extension

The first part has been successful, which talks about POST : Insert Extension Upload

I am stuck in the part where through a PATCH request, the binary file is to be uploaded. I want to publish this extension to CRONUS (OOTB Company)

This gitHub discussion says that instead of {appID}, the correct parameter to pass in the URL is {packageID} from an extension metadata

My extension has not been published yet, how can I get a PackageID of an extension when it's not yet been published and moreover pass it in the PATCH request? Is there a way through powershell or something else to obtain an extensions PackageID? I see PackageID as a response when I use GET Extensions from the same BC Environment, but these are extensions already published in the environment

My request header is IF-MATCH: *

My request body is the .app file which I want to publish

pastedimage1675440186045v1.png

FYI: Using a trial version of BC, probably has expired but not sure if it will fit this context

I have the same question (0)
  • Verified answer
    NAV_with_Narang Profile Picture
    2,250 Moderator on at
    RE: PATCH Request Automation API : Resource not found for the segment 'extensionUpload'

    An Update for everyone reading this thread:

    I was successfully able to decode the answer to my question above, after some deep research. Here are some pointers for you:

    1. Microsoft has specified that you need 3 requests sent to the automation API for your extension to successfully load into Business Central (POST, PATCH, POST). The english names of these 3 requests is "Insert Extension Upload", "Upload Extension File" & "Install Extension"

    Of which the first request is to send a POST, which will intimate table 5447, that a new extension is now getting uploaded. From my experience, this table will have only one record at a time and the record in this table will be deleted/archived/won't bother you once you are done with all 3 steps to publish an extension via API

    The response of the first POST Request, is very important. The response contains a value named "System ID", which is nothing but your "PackageID"

    2. Use this System ID/Package ID in your upcoming/next PATCH request, in the parameter named "extensionUploadId" in 
    PATCH api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/v2.0/companies({companyId})/extensionUpload({extensionUploadId})/extensionContent

    Now you're good to go. You now have the PackageID of the extension, even before it is published.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: PATCH Request Automation API : Resource not found for the segment 'extensionUpload'

    Hello,

    Feel free to raise this to Microsoft via your partner or CSP.

    Thank you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sumit Singh Profile Picture

Sumit Singh 2,814

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 2,681 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 2,363 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans