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...
Answered

API

(0) ShareShare
ReportReport
Posted on by 80

I'm trying to understand the different api options for Business central cloud

So I can successfully use the API which are created in webservices table in Business Central

api.businesscentral.dynamics.com/.../BankAccountLedgerEntries

but when i create an api view in an extension what is the api endpoint I am supposed to use to access the query api's created (see below)

Thanks!

query 20000 "APIV1 - Customer Sales"
{
QueryType = API;
APIPublisher = 'contoso';
APIGroup = 'app1';
APIVersion = 'v1.0';
Caption = 'customerSales', Locked = true;
EntityName = 'customerSale';
EntitySetName = 'customerSales';

elements
{
dataitem(QueryElement1; Customer)
{
column(customerId; Id)
{
Caption = 'Id', Locked = true;
}
column(customerNumber; "No.")
{
Caption = 'No', Locked = true;
}
column(name; Name)
{
Caption = 'Name', Locked = true;
}
dataitem(QueryElement10; "Cust. Ledger Entry")
{
DataItemLink = "Customer No." = QueryElement1."No.";
SqlJoinType = LeftOuterJoin;
DataItemTableFilter = "Document Type" = FILTER (Invoice | "Credit Memo");
column(totalSalesAmount; "Sales (LCY)")
{
Caption = 'TotalSalesAmount', Locked = true;
Method = Sum;
}
filter(dateFilter; "Posting Date")
{
Caption = 'DateFilter', Locked = true;
}
}
}
}
}

  • Suggested answer
    Anks27 Profile Picture
    1,083 on at
    RE: API

    Hello,

    I have gone through your question, though detailed information are not available but as per my assumption below is the answer.

    1. As per your example Customer Sales you have created data set from Web Service page I guess.

    AP1.png

     2.  You can only create custom web service between range of 50000 to 99999. so what you just need to do is, go through the Web Service page of Business Central filter the Id as 20000 and type as Query and now you just need to click in the OData V4 link as shown in below image.

    API2.png

    • Now, this is the only way to get the correct web service link, as well if you don't have access to the GUI of the business central then below is the web service structure so you can make the URL by your self.

    For my environment below generated end point:

    API3.png

    Don't forget to help the community by Verifying the answer and Like it if your question has been answered. It will let others know that the topic has verified answer.

     

    Thanks & Regards,

    Ankit Shah

  • Verified answer
    hyattmjh Profile Picture
    80 on at
    RE: API

    Yes resolved I was able to find the answer in another post  - the url wasn't clear from the Microsoft documentation

  • Bilal Haider Profile Picture
    234 on at
    RE: API

    So, is it solved your issue ?

  • Suggested answer
    hyattmjh Profile Picture
    80 on at
    RE: API

    community.dynamics.com/.../1065333

    api.businesscentral.dynamics.com/v2.0/<tenant id>/sandbox/api/<ApiPublisher>/<ApiGroup>/<ApiVersion>

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,272 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,931 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans