A custom API named contoso_CheckCredit defines a String response property with the unique name CreditStatus. Its main operation plug-in runs without errors and the trace log shows the calculated value, but the Web API response always returns CreditStatus as null. The plug-in sets context.OutputParameters["Status"]. What should the developer fix?
Select an answer to reveal the explanation.
Short Explanation
The response is like a form with labeled boxes, and Dataverse only copies what's in the box with the exact label. You filled in a box called Status, but the form only has CreditStatus. Match the unique name and the value shows up.
Full Explanation
When a custom API runs, Dataverse builds the response from the OutputParameters collection of the execution context, matching each entry to a response property by its unique name. The plug-in wrote its result under the key Status, which does not correspond to any defined response property, so the CreditStatus property is returned with its default value of null even though the calculation succeeded. Writing the value under CreditStatus, exactly as defined in the CustomAPIResponseProperty record, fixes the response. SharedVariables pass data between plug-ins executing in the same pipeline; they are never serialized into the API response, so placing the value there would still leave CreditStatus null. InputParameters hold the request values supplied by the caller; changing them does not populate response properties. The display name is a localized label for user interfaces and is not used to bind values; only the unique name identifies the property in code and in the Web API. Exam caveat: the unique name is also the name callers see in the Web API response body, and it cannot be changed after the property is saved, so code and definition must agree. Operational check: trace the keys present in OutputParameters at the end of Execute, call the API with an HTTP client, and confirm that the CreditStatus property in the response body carries the calculated value.