Skip to content

API Action: send a browser request

Reference · Advanced · App Connect

Send an explicit browser request with query parameters, headers and a chosen request body.

Send an explicit browser request with query parameters, headers and a chosen request body.

  • An App Connect page and an endpoint whose request fields and JSON response shape you know. Use a development endpoint for write examples.

API Action runs in the user’s browser. Use it for browser-accessible APIs with a known JSON response. Put private service credentials and trusted authorization logic in a server API Connector action. For a form with named controls or files, API Form is usually the clearer starting point.

Name the component apiSave and enable No Auto Load for a request that changes data. Trigger Load from a deliberate button event.

Control or value Meaning and use
ID / UrlID is the page binding name. Url is the endpoint, or bind Dynamic Url for an intentional runtime destination.
MethodGET, POST, PUT, PATCH or DELETE. GET sends query parameters and no body. Use the verb required by the endpoint.
Data TypeControls the outgoing body, not the accepted response format. JSON serializes Input Data. Auto POST creates FormData, appending array fields with []; Auto for other non-GET methods stringifies the supplied value rather than producing JSON.
Text DataText stringifies the supplied data. The installed runtime sets Content-Type to application/text; override through API Headers if the endpoint requires text/plain or another media type.
No Auto LoadPrevents initial and reactive URL/parameter loads. Set it explicitly for mutations; repeated automatic loads could repeat a write.
CredentialsEnables withCredentials subject to browser/server cross-origin rules. It does not authenticate the request by itself.
Define API SchemaDeclares fields for editor pickers. It does not create the endpoint or enforce its response schema.
Input Data / Query Parameters / API HeadersBody, URL query and header name/value pairs are separate inputs. Use Input Data for JSON body fields; keep private secrets out of all browser fields.

On a development endpoint that accepts PATCH /api/preferences, choose PATCH and JSON. Bind Input Data compact to a boolean true, enable No Auto Load and trigger apiSave → Load from a button. The request body should be {“compact”:true}. If the endpoint returns {“saved”:true}, read apiSave.data.saved on Success. Confirm the server response before showing Saved; a completed request alone does not prove a write.

The installed fetch runtime reloads on URL or parameter changes only when No Auto Load is off; changing Input Data or headers alone does not send a request. Load accepts query parameters and a Reload flag. It aborts a previous HTTP request and preserves previous response data until a new success replaces it. Timeout, when set as a runtime attribute, is in seconds. A Text outgoing body still requires a JSON success response.

Use Success for work that depends on a successful JSON response. Done also runs after errors and aborts, so it is suitable for cleanup rather than a saved-successfully message.

Control or value Meaning and use
Start / state.executingA request starts; disable repeated submission or show a loading indicator while executing is true.
Success / dataThe HTTP path accepts status below 400 only when the response parses as JSON. Empty 204 responses and HTML login pages produce a JSON error.
Invalid / Unauthorized / Forbidden / Rate LimitHTTP 400 / 401 / 403 / 429 have distinct event branches. Handle the applicable branch; these do not also trigger the generic Error event.
Error / lastErrorOther HTTP failures, transport failures, timeouts or invalid successful JSON. Inspect status, message and response; do not expose private server details in a public error label.
Abort / DoneAbort ends the browser request. It does not undo work already accepted by the server. Done means the attempt ended.
Upload / DownloadProgress events expose loaded, total and lengthComputable. Progress objects provide position, total and percent. Upload at 100% means bytes were sent; server processing can still fail.

Use the related guide to build and check the surrounding page workflow.

You can configure the request, bind its real output and distinguish a successful result from loading, validation and error states.