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

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;
}
}
}
}
}

I have the same question (0)
  • Suggested answer
    Anks27 Profile Picture
    1,085 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
    391 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

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
Sohail Ahmed Profile Picture

Sohail Ahmed 2,669 Super User 2025 Season 2

#2
Sumit Singh Profile Picture

Sumit Singh 2,668

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,203

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans