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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Cannot create attachments using graph API, cannot access any endpoints using the common endpoint.

(5) ShareShare
ReportReport
Posted on by 18
I'm working on a custom API that can create different resources based on a customer's input. Users are able to login using OAuth 2.0 and with the token retrieved from that login process I'm able to create various resources in their selected company. All of the API calls use the Graph API endpoint described here (https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/endpoints-apis-for-dynamics) and that has worked very well so far but according to the Microsoft Graph API Explorer, there is no supported endpoint for attachments (https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/resources/dynamics_attachment) or document attachments (https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/resources/dynamics_documentattachment). Adding attachments to the created resources is something that I need to support.
 
I tried to use common endpoint (https://api.businesscentral.dynamics.com/v2.0/production/api/v2.0) to create attachments but the token I'm supplying to the endpoint returns with a 401 status and says that "The credentials provided are incorrect". Is it possible to use the common endpoint and have users authenticate using OAuth? 
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at
    Please note that the endpoints of the graph API and BC are different. I hope the following information can give you some tips.
    Dynamics 365 Business Central Blog Series: Integrate Business Central with SharePoint
     
    Thanks.
    ZHU
  • CU13081944-0 Profile Picture
    18 on at
    Thank you for the response. Unfortunately, I don't know if those suggestions will fit my use case. I do not think it is possible for me to use AL for my solution as I will not have direct access to the Business Central tenant of the users since it is a multi tenant solution where we do not know the tenants beforehand. That is why I am trying to accomplish everything over Graph API calls.
  • Suggested answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at
    If the standard API does not meet your needs, you can customize one and associate it with the following tables and fields.
     
    Hope this can give you some hints.
    Thanks.
    ZHU
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,136 Super User 2025 Season 2 on at
    Attachments aren’t supported in the standard BC API — the endpoints are read-only. To add files you’ll need either an OData service or a custom AL API. The 401 you get on the common endpoint is expected, since create for attachments isn’t supported there.
     
    ✅ Mark this as the verified answer if helpful.
     
     

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans