Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

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

Posted on by 2,234 Super User 2024 Season 1

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

  • Verified answer
    NAV_with_Narang Profile Picture
    NAV_with_Narang 2,234 Super User 2024 Season 1 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
    Marco Mels 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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,134 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,928 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans