{ "Protocol": "AIXE", "Version": "1.0", "Endpoint": "/aixe/web-parts/get-web-part", "DiscoveryRequest": "GET /aixe/web-parts/get-web-part/?", "CanonicalHelpTrigger": "GET /aixe/web-parts/get-web-part/?", "ActionRequest": "POST /aixe/web-parts/get-web-part", "Method": "POST", "AccessType": "Public", "ContentType": "application/json; charset=utf-8", "Purpose": "Returns one active reusable HTML and JavaScript Web Part selected by its public WebPartKey after replacing approved @@BusinessField@@ tokens and, when ProductKey is supplied, approved @@ProductField@@ tokens with HTML-encoded values.", "DocumentationSource": "AIXEEndpointRegistry", "ProtocolReference": { "ProtocolHome": "http://aixeprotocol.com/", "CanonicalUsageContract": "http://aixeprotocol.com/usage/?", "Whitepaper": "http://aixeprotocol.com/whitepaper/full-spec.html", "Inventor": "Gregory Oglethorpe", "IncludeIn": [ "/aixe.ai starter discovery documents", "Every endpoint self-description returned by GET /endpoint/?" ], "AIInstruction": "Read this live endpoint contract as operational guidance, not merely as a transport schema." }, "RequiredFields": { "WebPartKey": { "Type": "string", "Description": "The public key of the active Web Part to retrieve.", "Required": true, "SubmittedIn": "JSON body", "MaxLength": 50 }, "BusinessKey": { "Type": "string", "Description": "The public key of the active business whose approved public fields replace matching @@BusinessField@@ tokens in WebPartHTMLBody. @@BusinessKey@@ is explicitly supported.", "Required": true, "SubmittedIn": "JSON body", "MaxLength": 50 } }, "OptionalFields": { "ProductKey": { "Type": "string", "Description": "Optional public key of an active product linked to the selected business. When supplied, approved product tokens are replaced and @@ProductKey@@ is explicitly supported.", "Required": false, "SubmittedIn": "JSON body", "MaxLength": 50 } }, "BusinessRules": [ "Only active Web Parts are returned.", "BusinessKey is required and must identify an active business.", "@@BusinessKey@@ is replaced with the selected business\u0027s real public BusinessKey before the response is returned.", "ProductKey is optional. When supplied, it must identify an active product linked to the selected business.", "@@ProductKey@@ is replaced with the selected product\u0027s real public ProductKey when ProductKey is supplied.", "Approved public business tokens are HTML-encoded before replacement. Place tokens in HTML text or attribute values; JavaScript should read values from the rendered DOM.", "Approved product tokens include ProductKey, ProductName, ProductCode, ProductType, ProductCategory, ProductSKU, ProductShortDescription, ProductLongDescription, ProductPrice, ProductQuantityOnHand, ProductRequiresScheduling, ProductDefaultDurationMinutes, and ProductIsActive.", "ProductID, ProductUnitCost, ProductReorderLevel, ProductSerialNumber, and other internal product fields are never available as replacement tokens.", "Internal numeric IDs, login fields, authentication and reset values, owner details, notification destinations, payment configuration, and other sensitive fields are never available as replacement tokens.", "WebPartHTMLBody is executable presentation content intended for server-side placement into a trusted website response.", "The consuming server is responsible for trusting this endpoint before emitting WebPartHTMLBody without HTML encoding." ], "SuccessfulResponse": { "SuccessCode": "SUCCESS", "WebPartKey": "The selected public Web Part key.", "BusinessKey": "The selected active business key.", "ProductKey": "The selected active product key when ProductKey was supplied; otherwise null.", "WebPartHTMLBody": "The complete stored HTML and JavaScript fragment after approved business-token replacement." }, "Errors": [ { "SuccessCode": "VALIDATION_FAILED", "Meaning": "WebPartKey, BusinessKey, or a supplied ProductKey is malformed.", "Recovery": "Submit WebPartKey and BusinessKey as non-empty strings no longer than 50 characters; omit ProductKey or submit a non-empty public key.", "Recoverable": true }, { "SuccessCode": "NOT_FOUND", "Meaning": "No active Web Part or active business matched the submitted keys, or a supplied ProductKey did not identify an active product linked to that business.", "Recovery": "Use current public keys for an active Web Part, active business, and optionally a linked active product.", "Recoverable": true }, { "SuccessCode": "FAILED", "Meaning": "The endpoint could not complete the read.", "Recovery": "Do not inject content; retry only after the execution failure is resolved.", "Recoverable": false } ], "ActionResponse": { "RequiredResponseFields": [ "SuccessCode" ], "SuccessCodes": [ "SUCCESS" ], "FailureCodes": [ "VALIDATION_FAILED", "NOT_FOUND", "FAILED" ], "NonFinalCodes": [], "MissingOrEmptyResponse": "Treat as FAILED.", "Rule": "Only SuccessCode = SUCCESS means the Web Part was returned." } }