Skip to content

Connect a system through a REST API ​

For systems that only expose data through an API: ERP, CRM, marketing tools. Each API address (endpoint) becomes a table in LumeDB.

Before you start ​

Have the system's API documentation and the access credentials at hand: API key, token, user and password or the OAuth2 details, depending on what the system asks for.

Step 1 · Access ​

  1. In Connections, click + New connection and choose REST API.
  2. If the system is listed under Start from a template, search by name or by area (CRM, ERP, marketing) and click Use the template. It fills in the address, the authentication and the most common endpoints; you can change everything afterwards.
  3. Check the Base URL, for example https://api.system.com/v1.
  4. Under Schema in the Core, give the name the tables will appear under, for example crm. Each endpoint becomes crm.table.
  5. Choose the Authentication:
OptionWhat to fill in
no authenticationnothing
API keythe key, the field name and whether it goes in the header or in the URL
fixed token (Bearer)the token
user and password (Basic)user and password
OAuth2 with refresh tokentoken URL, Client id, client secret and refresh token
OAuth2 client credentialstoken URL, Client id and client secret
  1. Click Configure endpoints.

I don't have the refresh token ​

With OAuth2 with refresh token authentication, open No refresh token? Generate one with the authorization code:

  1. Fill in the Authorization URL and the Redirect URI (the same one registered in the provider's app).
  2. Click Authorize at the provider and complete the sign-in that opens.
  3. The provider returns to the redirect URI with ?code=… in the address bar. Copy the value of code.
  4. Paste it into the field and click Generate refresh token. The code works once and only for a few minutes.

With the client secret and the refresh token stored, LumeDB renews the access on its own for the following loads.

Step 2 · Endpoints ​

Each row is a table.

  1. Under table, give the name it will have in LumeDB.
  2. Under path, enter the endpoint, for example /v1/orders.
  3. Under where the list is, say which part of the response holds the records, for example data.items. If you don't know, use * and LumeDB finds it on its own.
  4. Choose the pagination the API uses: none, by page, by offset, by cursor or by the Link header.
  5. Click Preview to read the first page straight from the API and check the columns.
  6. Use + endpoint to add more tables.

Save before previewing

The preview uses the credentials stored on the server. If the connection hasn't been saved yet, click Save (it stays inactive) and go back to the preview.

Activate ​

Click Save and activate, or save, test it in the list and click Activate. The tables now show up on the Source node in Modeling.

If the preview fails ​

SymptomWhat to check
Access deniedThe credential expired or has no permission for that endpoint.
It comes back emptyThe where the list is field doesn't match the response; try *.
It only brings the first pageThe chosen pagination isn't the API's; check the system's documentation.

LumeDB © Keon Analytics