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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

publish Query as web api

(0) ShareShare
ReportReport
Posted on by

I created query API extension and publish it.

I can access it with this URL http://BC365:7148/NUP/api/beta/salesOrderQueries.

but i fail to access it if i specified with company http://BC365:7148/NUP/api/beta/companies(83855a81-572f-4de1-8dd0-e755ed9967c8)/salesOrderQueries. i got return code  "BadRequest_NotFound"

here is my code

query 50101 SalesOrderQuery
{
    QueryType = API;
    EntityName = 'SalesOrderQuery';
    EntitySetName = 'SalesOrderQueries';

    elements
    {
        dataitem(Sales_Header; "Sales Header")
        {
            DataItemTableFilter = "Document Type" = filter (Order);
            column(OrderNo; "No.")
            {
                Caption = 'OrderNo';
            }
            filter(Order; "No.")
            {
                Caption = 'Order', Locked = true;
            }
        }
    }
}


how can I call that query web API for a specific company?
Please help.

Categories:
  • I Gusti Made Ari Profile Picture
    3,608 on at

    Are you using Postman to test  ?

    Please check your authentication setup as below link :

    community.dynamics.com/.../nav2018-msdyn365bc-api-authentication

    Check the Id from your company information is match with id at your end point url.

  • Community Member Profile Picture
    on at

    Hi I Gusti,

    Thanks for your reply. yes i use postman.

    authentication and company id is correct. i already try it for another endpoint in this case Page Web API.

    but when try access Query Web API got return code  "BadRequest_NotFound".

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 Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

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

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans