Knowledge base for Bubble® apps

API Connector call will not initialize

By Red Center Studio / Updated

TL;DR

Every API Connector call must be initialized successfully before you can use it. When initialization fails, the request itself is usually wrong or the response is not something the connector can read. Test the request outside Bubble, fix the auth and body, re-initialize, or define the response manually.

Why initialization matters

The official API Connector documentation states that every call needs to be initialized before it can be used in your app. Initializing runs the call once so Bubble can learn the shape of the response. Until that succeeds, the call cannot be used as a data source or as an action.

Common causes

  • The request fails at the provider. A missing or expired API key, a wrong header name, or a bad URL returns an error instead of data.
  • The body is in the wrong format. The API Connector supports JSON, Form-data and Raw bodies. Sending JSON to an endpoint that expects form data (or the reverse) fails.
  • The response is not usable. If the endpoint returns an empty body, an HTML error page, or text that is not the format you selected, there is nothing for Bubble to map. The official documentation also notes that the API Connector does not support non-UTF-8 encodings.
  • The call changed after it was initialized. The official documentation says to re-initialize after changing the structure of a call, and after toggling Include errors in response and allow workflow actions to continue.

How to fix it

  1. Reproduce the call outside Bubble. Send the exact same method, URL, headers and body with an HTTP client. If it fails there, fix the request first. Most initialization problems end here.
  2. Check authentication. Confirm the key is valid and is sent where the provider expects it (header, query parameter or body). Tick Private on secret values so they are not visible client-side.
  3. Match the body type. Choose JSON, Form-data or Raw to match the provider's documentation, and make sure test values in every parameter are real enough to return a full response.
  4. Pick the right Use as setting. Choose Data if you will display the result (it then appears under Get data from an external API), or Action if a workflow will run it (it then appears as an action in the workflow editor's actions menu).
  5. Re-initialize after every structural change. Click Initialize call again whenever you change parameters, headers, the body or the error setting.
  6. Define the response yourself if the call cannot run safely. If initializing would charge money, send a message or change live data, use Manually enter response to describe the response structure instead of calling the API.
Fix this for a fixed price

API Rescue / $399

Repair of a failing API Connector integration or backend workflow. Also books as a general call-out: up to 4 hours of Bubble work on whatever you need.

Pay $399 and book

Related fixes