({{, (RefLink[ResponseForm, paclet:ref/ResponseForm])[expr,"fmt"] 
represents a response record to be given in a specified format when requested during the execution of a function specified by (RefLink[APIFunction, paclet:ref/APIFunction]), (RefLink[FormFunction, paclet:ref/FormFunction]), etc.}, {, (RefLink[ResponseForm, paclet:ref/ResponseForm])[expr,"fmt",{"(Subscript[elem, 1])","(Subscript[elem, 2])",…}]
includes only the response record elements (Subscript[elem, i]).}})

OpenersNotesSection(Spacer1)Details

(RefLink[ResponseForm, paclet:ref/ResponseForm])[expr,"fmt"] is equivalent to (RefLink[ExportForm, paclet:ref/ExportForm])[(RefLink[EvaluationData, paclet:ref/EvaluationData])[expr],"fmt"].

By default, the elements included in the response record are:

Typical formats include:

The format specified by (RefLink[ResponseForm, paclet:ref/ResponseForm]) takes precedence over a response form setting given in (RefLink[APIFunction, paclet:ref/APIFunction]), (RefLink[FormFunction, paclet:ref/FormFunction]), etc.

The format specified by (RefLink[ResponseForm, paclet:ref/ResponseForm]) cannot be overridden by parameters given in the URL used to call an (RefLink[APIFunction, paclet:ref/APIFunction]) etc.

(RefLink[ResponseForm, paclet:ref/ResponseForm]) has attribute (RefLink[HoldFirst, paclet:ref/HoldFirst]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Use a custom response format:

CloudDeploy[APIFunction[{"x" -> "String"},ResponseForm[#x,"JSON"] &]]

CloudDeploy[APIFunction[{"x" -> "String"},ResponseForm[#x,"XML"] &]]

Create an API that gives its response directly:

CloudDeploy[APIFunction[{"m"->Number,"n"->Number},ResponseForm[Mod[#m,#n],None]&]]

Execute an API and import the result:

api = CloudDeploy[APIFunction[{"x" -> "Integer"},ResponseForm[Fibonacci[#x], "JSON"] &]]

URLExecute[api, {"x" -> 20}, "JSON"]

CloudFunction[api][{"x" -> 20}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ExportForm, paclet:ref/ExportForm])  ▪  (RefLink[HTTPResponse, paclet:ref/HTTPResponse])  ▪  (RefLink[EvaluationData, paclet:ref/EvaluationData])  ▪  (RefLink[APIFunction, paclet:ref/APIFunction])  ▪  (RefLink[FormFunction, paclet:ref/FormFunction])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Creating Instant APIs, paclet:guide/CreatingAnInstantAPI])}, {▪(RefLinkPlain[Cloud Functions & Deployment, paclet:guide/CloudFunctionsAndDeployment])}, {▪(RefLinkPlain[HTTP Requests & Responses, paclet:guide/HTTPRequestsAndResponses])}})}})