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...
Suggested Answer

Webhook for custom API raises error "Resource not found for the segment"

(1) ShareShare
ReportReport
Posted on by 18
Hi everyone,
I am having trouble creating a webhook subscription for a custom API page in BC.
When calling //webhookSupportedResources/ I can clearly see my API, but when I post a subscription for that API I receive the /Resource not found for the segment/ error.

I copy/pasted all API details to avoid accidental typos, but that didn't help.
Am I missing a setup step that might be necessary to open custom APIs up for webhook subscription? Or is there something I need to include in AL in the page definition that will allow the page to be accessed?
 
I have no trouble subscribing to standard APIs, which excludes issues with my postman, or receiver URL or anything of that sort.
 
I'm definitely not excluding that I am making a stupid mistake somewhere, I just can't find it. Any help would be greatly appreciated.
 
Thanks community!
 
@Inge M. Bruvik I unfortunately can't find a way to respond to your comment, so I'm doing it from within the post. First of all thank you for your suggestion! I checked everything that you mentioned but unfortunately nothing applies to my API. Fro clarification purpose I will add the page definition for my /test/ API here:
 
page 71034 custCust
{
    APIGroup = 'APIGroup';
    APIPublisher = 'APIPublisher';
    APIVersion = 'v1.0';
    ApplicationArea = All;
    Caption = 'customer';
    DelayedInsert = true;
    EntityName = 'customer';
    EntitySetName = 'customers';
    PageType = API;
    SourceTable = Customer;
    ODataKeyFields = SystemId;
    DataAccessIntent = ReadOnly;
    Editable = false;
    layout
    {
        area(content)
        {
            repeater(General)
            {
                field(no; Rec./No./)
                {
                    Caption = 'No.';
                }
                field(name; Rec.Name)
                {
                    Caption = 'name';
                }
                field(systemId; Rec.SystemId)
                {
                    Caption = 'SystemId';
                }
            }
        }
    }
}
 
 
////
 
////
I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at
    Webhook for custom API raises error "Resource not found for the segment"
    There are some expections where webhooks will not work for custom API

    Webhooks are not supported for APIs in the following cases:

    • The source table for the API page is a temporary table (SourceTableTemporary = true).
    • The API page has a composite key (for example, if ODataKeyFields consists of several fields or is missing, then the primary key for the source table consists of several fields).
    • The source table for the API page is a system table ("Table No." > 2000000000).
    • The API is declared through an API type query, for example, and not through an API type page.
    • The source table for the API page is Job Queue Entry ("Table No." = 472).
    Can any of this be valid for your case?
    You can find further documentation around this here:
     
    I  hope this can be of some assistance to you.
     
  • NAV_with_Narang Profile Picture
    2,294 Moderator on at
    Webhook for custom API raises error "Resource not found for the segment"
    Hi @jakob - Were you able to solve the issue you've mentioned? I am kind of facing a similar one myself, was hoping you'd have found a solution
     
    Please do explain what did you change in your resource URL
  • AlexKlymenko Profile Picture
    2 on at
    Webhook for custom API raises error "Resource not found for the segment"
    Also stuck today with the same issue.
    The findings are quite surprising.
     
    I created an API page with some entity names - here it is 'xxx'
     
    The API page is listed in webhookSupportedResources and is accessible and returns data (in this example empty array but still) without errors. The URL mentions the EntitySetName=xxxs which is fine/expected.
     
     
    But attempts to subscribe to exactly this URL resulted into errors "No HTTP resource was found that matches the request URI"
     
     
    At the same time tutorial https://fredborg.org/?p=914 works fine.
    But here API page was based on items
    and subscription was requested also for items
    Not sure how that tutorial worked, because if I change my 'xxxs' to 'items' it also 'works' - at least it doesn't complain on not found resource. Or if I change it to 'salesOrders'... to anything which matches one of the 'standard' shared webservices.

    What really helped - specifying the API publisher/group/version also in the URL of the request (not mentioned in the tutorial) 
     

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,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans