{"id":1478,"date":"2025-12-15T13:52:42","date_gmt":"2025-12-15T13:52:42","guid":{"rendered":"https:\/\/fredborg.org\/?p=1478"},"modified":"2026-01-07T10:30:24","modified_gmt":"2026-01-07T10:30:24","slug":"episode-4-building-the-interface-api-pages-permissions","status":"publish","type":"post","link":"https:\/\/fredborg.org\/?p=1478","title":{"rendered":"Episode 4: Building the Interface (API Pages &amp; Permissions)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In the previous episodes, we established our &#8220;Agentic&#8221; workflow and built the foundation of our Business Central integration: the Staging Tables.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we need to open the door so the outside world can actually talk to us.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this episode, we use Roo Code to generate the <strong>API Pages<\/strong>, fix a common real-world error involving entitlements, and finally verify our connection using postman.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Moving Files &amp; Updating the Spec<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before we started coding, I noticed a small housekeeping issue: the AI had placed our staging tables in the <code>Common<\/code> folder instead of <code>Source<\/code>. I moved them manually. This is a good reminder that while AI is powerful, you still need to be the &#8220;Architect&#8221; of your own project structure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We then updated the <code>implementation.md<\/code> plan to focus on <strong>Phase 2 (UI) and Phase 3 (API Layer)<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Generating the Code (And Fixing Small &#8220;Oopsies&#8221;)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">I instructed the Orchestrator to implement Phase 2. It successfully created the List Pages and Card Pages for our staging tables.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, it made a classic AI mistake: it used hashtags in the Application Area (e.g., <code>ApplicationArea = #All<\/code>). In AL development, that&#8217;s a syntax error.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>Could I have done a Find &amp; Replace? Yes. But the point of this series is to push the AI.<\/em><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">I told the agent to fix the Application Area and remove the hashtags. It did so immediately. I also realized I hadn&#8217;t enforced <strong>Namespaces<\/strong> in my initial rules, so I instructed the agent to wrap all objects in a <code>MyCompany.WebShop<\/code> namespace to keep things clean<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. The &#8220;Missing Entitlement&#8221; Error<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This was the most critical part of the episode. When I tried to deploy the app, I got a compilation error regarding permissions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The AI had generated the objects, but it hadn&#8217;t updated the permission sets to allow access to them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I asked the agent to generate a new permission set, <code>WebShop<\/code>, with access to the new Staging Header and Line tables. We then registered this permission set in the <code>app.json<\/code> (or Entra ID registration) to ensure the API user actually has the right to read and write data<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Refining the API Pages<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When generating the API pages, the agent initially included an &#8220;Action&#8221; on the API page. As experienced BC developers know, <strong>API pages cannot have actions.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I instructed the agent to:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Remove the actions from the API page.<\/li>\n\n\n\n<li>Add a <code>SubPage<\/code> part for the lines, so we can POST a header and lines in a single call (using deep inserts).<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">5. Testing with Postman<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">With the code deployed, it was time to test. I switched to Postman.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I set up a GET request to our new endpoint: <code>GET ...\/api\/myCompany\/webShop\/v2.0\/companies(...)\/webOrders<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Result:<\/strong> <code>200 OK<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We successfully authenticated and retrieved an empty list (since we haven&#8217;t posted data yet). This confirms that our API pages are published, our namespace is correct, and our permissions are active <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\"  id=\"_ytid_39763\"  width=\"1140\" height=\"641\"  data-origwidth=\"1140\" data-origheight=\"641\" src=\"https:\/\/www.youtube.com\/embed\/E9Yal4sF6_o?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  epyt-is-override  no-lazyload\" title=\"YouTube player\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous episodes, we established our &#8220;Agentic&#8221; workflow and built the foundation of our Business Central integration: the Staging&#8230; <a class=\"read-more\" href=\"https:\/\/fredborg.org\/?p=1478\" rel=\"nofollow\"> Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":1479,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1478","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-business-central","shapla-grid-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Episode 4: Building the Interface (API Pages &amp; Permissions) - Fredborg<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fredborg.org\/?p=1478\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Episode 4: Building the Interface (API Pages &amp; Permissions) - Fredborg\" \/>\n<meta property=\"og:description\" content=\"In the previous episodes, we established our &#8220;Agentic&#8221; workflow and built the foundation of our Business Central integration: the Staging... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fredborg.org\/?p=1478\" \/>\n<meta property=\"og:site_name\" content=\"Fredborg\" \/>\n<meta property=\"article:published_time\" content=\"2025-12-15T13:52:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-07T10:30:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fredborg.org\/wp-content\/uploads\/2025\/12\/Gemini_Generated_Image_jmt3d2jmt3d2jmt3-1024x572.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"572\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"dfredborg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dfredborg\" \/>\n<meta name=\"twitter:site\" content=\"@dfredborg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"dfredborg\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fredborg.org\/?p=1478#article\",\"isPartOf\":{\"@id\":\"https:\/\/fredborg.org\/?p=1478\"},\"author\":{\"name\":\"dfredborg\",\"@id\":\"https:\/\/fredborg.org\/#\/schema\/person\/59a5520cbf04c6bd1267f30b4488e71d\"},\"headline\":\"Episode 4: Building the Interface (API Pages &amp; Permissions)\",\"datePublished\":\"2025-12-15T13:52:42+00:00\",\"dateModified\":\"2026-01-07T10:30:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fredborg.org\/?p=1478\"},\"wordCount\":476,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fredborg.org\/#\/schema\/person\/59a5520cbf04c6bd1267f30b4488e71d\"},\"image\":{\"@id\":\"https:\/\/fredborg.org\/?p=1478#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fredborg.org\/wp-content\/uploads\/2025\/12\/Gemini_Generated_Image_jmt3d2jmt3d2jmt3-scaled.png\",\"articleSection\":[\"Business Central\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fredborg.org\/?p=1478#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fredborg.org\/?p=1478\",\"url\":\"https:\/\/fredborg.org\/?p=1478\",\"name\":\"Episode 4: Building the Interface (API Pages &amp; Permissions) - Fredborg\",\"isPartOf\":{\"@id\":\"https:\/\/fredborg.org\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fredborg.org\/?p=1478#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fredborg.org\/?p=1478#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fredborg.org\/wp-content\/uploads\/2025\/12\/Gemini_Generated_Image_jmt3d2jmt3d2jmt3-scaled.png\",\"datePublished\":\"2025-12-15T13:52:42+00:00\",\"dateModified\":\"2026-01-07T10:30:24+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fredborg.org\/?p=1478#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fredborg.org\/?p=1478\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fredborg.org\/?p=1478#primaryimage\",\"url\":\"https:\/\/fredborg.org\/wp-content\/uploads\/2025\/12\/Gemini_Generated_Image_jmt3d2jmt3d2jmt3-scaled.png\",\"contentUrl\":\"https:\/\/fredborg.org\/wp-content\/uploads\/2025\/12\/Gemini_Generated_Image_jmt3d2jmt3d2jmt3-scaled.png\",\"width\":2560,\"height\":1429},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fredborg.org\/?p=1478#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fredborg.org\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Episode 4: Building the Interface (API Pages &amp; Permissions)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fredborg.org\/#website\",\"url\":\"https:\/\/fredborg.org\/\",\"name\":\"Fredborg\",\"description\":\"Business Central and Azure\",\"publisher\":{\"@id\":\"https:\/\/fredborg.org\/#\/schema\/person\/59a5520cbf04c6bd1267f30b4488e71d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fredborg.org\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/fredborg.org\/#\/schema\/person\/59a5520cbf04c6bd1267f30b4488e71d\",\"name\":\"dfredborg\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fredborg.org\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/fredborg.org\/wp-content\/uploads\/2023\/06\/download.png\",\"contentUrl\":\"https:\/\/fredborg.org\/wp-content\/uploads\/2023\/06\/download.png\",\"width\":256,\"height\":256,\"caption\":\"dfredborg\"},\"logo\":{\"@id\":\"https:\/\/fredborg.org\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:fredborg.org\",\"https:\/\/www.linkedin.com\/in\/dfredborg\/\",\"https:\/\/x.com\/dfredborg\",\"https:\/\/www.youtube.com\/channel\/UCUNZglLDMjBlOK_T9JtI8UA\"],\"url\":\"https:\/\/fredborg.org\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Episode 4: Building the Interface (API Pages &amp; Permissions) - Fredborg","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fredborg.org\/?p=1478","og_locale":"en_US","og_type":"article","og_title":"Episode 4: Building the Interface (API Pages &amp; Permissions) - Fredborg","og_description":"In the previous episodes, we established our &#8220;Agentic&#8221; workflow and built the foundation of our Business Central integration: the Staging... Read more","og_url":"https:\/\/fredborg.org\/?p=1478","og_site_name":"Fredborg","article_published_time":"2025-12-15T13:52:42+00:00","article_modified_time":"2026-01-07T10:30:24+00:00","og_image":[{"width":1024,"height":572,"url":"https:\/\/fredborg.org\/wp-content\/uploads\/2025\/12\/Gemini_Generated_Image_jmt3d2jmt3d2jmt3-1024x572.png","type":"image\/png"}],"author":"dfredborg","twitter_card":"summary_large_image","twitter_creator":"@dfredborg","twitter_site":"@dfredborg","twitter_misc":{"Written by":"dfredborg","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fredborg.org\/?p=1478#article","isPartOf":{"@id":"https:\/\/fredborg.org\/?p=1478"},"author":{"name":"dfredborg","@id":"https:\/\/fredborg.org\/#\/schema\/person\/59a5520cbf04c6bd1267f30b4488e71d"},"headline":"Episode 4: Building the Interface (API Pages &amp; Permissions)","datePublished":"2025-12-15T13:52:42+00:00","dateModified":"2026-01-07T10:30:24+00:00","mainEntityOfPage":{"@id":"https:\/\/fredborg.org\/?p=1478"},"wordCount":476,"commentCount":0,"publisher":{"@id":"https:\/\/fredborg.org\/#\/schema\/person\/59a5520cbf04c6bd1267f30b4488e71d"},"image":{"@id":"https:\/\/fredborg.org\/?p=1478#primaryimage"},"thumbnailUrl":"https:\/\/fredborg.org\/wp-content\/uploads\/2025\/12\/Gemini_Generated_Image_jmt3d2jmt3d2jmt3-scaled.png","articleSection":["Business Central"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fredborg.org\/?p=1478#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fredborg.org\/?p=1478","url":"https:\/\/fredborg.org\/?p=1478","name":"Episode 4: Building the Interface (API Pages &amp; Permissions) - Fredborg","isPartOf":{"@id":"https:\/\/fredborg.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fredborg.org\/?p=1478#primaryimage"},"image":{"@id":"https:\/\/fredborg.org\/?p=1478#primaryimage"},"thumbnailUrl":"https:\/\/fredborg.org\/wp-content\/uploads\/2025\/12\/Gemini_Generated_Image_jmt3d2jmt3d2jmt3-scaled.png","datePublished":"2025-12-15T13:52:42+00:00","dateModified":"2026-01-07T10:30:24+00:00","breadcrumb":{"@id":"https:\/\/fredborg.org\/?p=1478#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fredborg.org\/?p=1478"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fredborg.org\/?p=1478#primaryimage","url":"https:\/\/fredborg.org\/wp-content\/uploads\/2025\/12\/Gemini_Generated_Image_jmt3d2jmt3d2jmt3-scaled.png","contentUrl":"https:\/\/fredborg.org\/wp-content\/uploads\/2025\/12\/Gemini_Generated_Image_jmt3d2jmt3d2jmt3-scaled.png","width":2560,"height":1429},{"@type":"BreadcrumbList","@id":"https:\/\/fredborg.org\/?p=1478#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fredborg.org\/"},{"@type":"ListItem","position":2,"name":"Episode 4: Building the Interface (API Pages &amp; Permissions)"}]},{"@type":"WebSite","@id":"https:\/\/fredborg.org\/#website","url":"https:\/\/fredborg.org\/","name":"Fredborg","description":"Business Central and Azure","publisher":{"@id":"https:\/\/fredborg.org\/#\/schema\/person\/59a5520cbf04c6bd1267f30b4488e71d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fredborg.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/fredborg.org\/#\/schema\/person\/59a5520cbf04c6bd1267f30b4488e71d","name":"dfredborg","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fredborg.org\/#\/schema\/person\/image\/","url":"https:\/\/fredborg.org\/wp-content\/uploads\/2023\/06\/download.png","contentUrl":"https:\/\/fredborg.org\/wp-content\/uploads\/2023\/06\/download.png","width":256,"height":256,"caption":"dfredborg"},"logo":{"@id":"https:\/\/fredborg.org\/#\/schema\/person\/image\/"},"sameAs":["https:fredborg.org","https:\/\/www.linkedin.com\/in\/dfredborg\/","https:\/\/x.com\/dfredborg","https:\/\/www.youtube.com\/channel\/UCUNZglLDMjBlOK_T9JtI8UA"],"url":"https:\/\/fredborg.org\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fredborg.org\/index.php?rest_route=\/wp\/v2\/posts\/1478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fredborg.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fredborg.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fredborg.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fredborg.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1478"}],"version-history":[{"count":1,"href":"https:\/\/fredborg.org\/index.php?rest_route=\/wp\/v2\/posts\/1478\/revisions"}],"predecessor-version":[{"id":1480,"href":"https:\/\/fredborg.org\/index.php?rest_route=\/wp\/v2\/posts\/1478\/revisions\/1480"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fredborg.org\/index.php?rest_route=\/wp\/v2\/media\/1479"}],"wp:attachment":[{"href":"https:\/\/fredborg.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fredborg.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fredborg.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}