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

Dynamic 365 Business: documentAttachments API call return TimeOut

(4) ShareShare
ReportReport
Posted on by 8
Need help on Dynamic 365 Business central documentAttachments API call
Query : 
API calls are throwing TimeOut Error, when there are more than 3-4K records in documentAttachment table.
 
API Call : https://api.businesscentral.dynamics.com/v2.0/production/api/v2.0/companies(--------)/documentAttachments
I have the same question (0)
  • Suggested answer
    Holly Huffman Profile Picture
    6,538 Super User 2025 Season 2 on at
    Good morning, afternoon, or evening depending on your location!
     
    The Timeout Error when calling the documentAttachments API in Dynamics 365 Business Central is likely due to the large volume of records (3-4K) being retrieved in a single request. Here are some strategies to resolve this issue:
     
    1. Use Pagination 2. Apply Filters 3. Optimize API Calls
    • Batch Requests: Combine multiple API calls into a single batch request to reduce overhead.
    • Expand Related Entities: Use the $expand parameter to fetch related data in one call, if applicable.
    4. Increase Timeout Settings
    • If you control the client application making the API call, increase the timeout settings to allow more time for the response.
    5. Use Webhooks for Real-Time Updates
    • Instead of polling the API for large datasets, consider using webhooks to receive updates in real time. This reduces the need for frequent large API calls.
    6. Monitor API Limits
    • Ensure you are within the API rate limits and operational constraints set by Business Central. You can find more details on API limits and rate limits.
    7. Split Data Retrieval
    • If the dataset is too large, consider splitting the data retrieval process into smaller, manageable chunks using custom logic.
     
    Hope this helps some!
  • KP - Solution Architect Technical Profile Picture
    658 on at
    Hi,
     
    Use of the Job Queue might help resolve this error.
    Records can be retrieved via a report/codeunit in a job queue running in the background.
     
     
    Thanks,
    KP
  • Raj Borad Profile Picture
    1,428 on at
    Hi,
     
    The timeout error occurs due to the large volume (3–4K+) of records being fetched in a single API call. 

    Are you currently using pagination or filtering in your API call?

    To avoid this, use pagination with $top and $skip parameters to retrieve records in manageable batches. Also, consider applying filters to narrow results.
     
    Thanks.
  • Gerardo Rentería García Profile Picture
    25,371 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

    Current API Limits in Dynamics 365 Business Central - Business Central | Microsoft Learn

    Best Regards
    Gerardo

  • Suggested answer
    YUN ZHU Profile Picture
    95,746 Super User 2025 Season 2 on at
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,643 Super User 2025 Season 2 on at

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 2,066

#2
YUN ZHU Profile Picture

YUN ZHU 658 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 595

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans