REST Builder
The REST / API Builder lets you turn a web API into a data source. You describe the API in a small JSON document (where it lives, how to sign in, how it pages through results and where the records are), save it, and APEX Data polls it and lands the records in your project.
The page title is REST / API Builder. Its subtitle reads "Define a new REST connector source." for a new source, and "Editing source — read-only view" when you open a saved one. Without an open project the source list says "No project selected — choose one from the sidebar".
The page
| Area | What it does |
|---|---|
| Source list (left) | Your project's REST sources. Each shows a status dot, its name and its URL. The dot is green for active, amber for pending, grey for paused and red for error |
| New REST Source | Clears the editor so you can start a new source |
| Name box | The source name. A New source or Viewing tag sits beside it |
| JSON editor | The API definition, opened with a starter template |
| Result bar | Appears under the editor with an error or a test result |
Only sources that use the REST / Poll method are listed. Other kinds, such as Kafka or CDC, are managed from Sources or their own pages.
Create a REST source
Start a new source
Click New REST Source. The name box is ready to type in, and the editor shows the starter template.
Name it
Type a Source name…. Save Source stays off until there is a name.
Describe the API
Edit the JSON in the editor. See Settings for each field. If the JSON is not valid, Save Source turns off and the page shows Invalid JSON under the editor.
Save
Click Save Source. The editor clears so you can add another, and the source appears in the list.
Test and pull
Select the saved source in the list, then use Test to check it and Pull to fetch data.
Settings
The starter template is:
{
"base_url": "https://api.example.com",
"path": "/data",
"http_method": "GET",
"auth_type": "none",
"auth_token": "",
"extra_headers": {},
"query_params": {},
"records_path": "data",
"pagination_type": "none",
"page_param": "page",
"page_size_param": "limit",
"page_size": 100
}
Request
| Setting | Meaning |
|---|---|
base_url | The root address of the API, such as https://api.example.com |
path | The endpoint to call, such as /data |
http_method | The HTTP method. GET by default |
extra_headers | Extra headers to send with every request, as "Name": "value" pairs |
query_params | Query-string parameters to send with every request |
Authentication
auth_type | What to also set |
|---|---|
none | Nothing. The API is open |
bearer | auth_token, sent as Authorization: Bearer <token> |
api_key | auth_token for the key, and auth_header for the header name. The header defaults to Authorization |
basic | basic_user and basic_password |
Reading the response
| Setting | Meaning |
|---|---|
records_path | Where the list of records sits in the response, as a dot path. For {"data": {"items": [...]}} use data.items. Leave it out when the response is the list itself |
If an item in the list is not an object, it is stored as a record with a single value field.
Pagination
Set pagination_type to say how the API splits results into pages.
pagination_type | How it works | Settings it uses |
|---|---|---|
none | One request only | None |
page | Asks for page 0, 1, 2… | page_param (default page), page_size_param (default limit), page_size (default 100) |
offset | Asks for records starting at 0, then 100, 200… | offset_param (default offset), page_size_param, page_size |
cursor | Each response says where the next page starts | cursor_param (default cursor), cursor_field (the response field holding the next cursor), page_size_param, page_size |
Page numbering starts at 0, not 1. Fetching stops when a response comes back empty or has fewer records than page_size. For cursor paging it stops when there is no next cursor or it does not change. As a safety limit, no more than max_pages pages (100 by default) are read in one pull.
Test and pull
With a saved source selected, two buttons appear next to the name:
- Test calls the API and reports the result below the editor. A green result says Connection successful, with the message and how many sample rows came back. A red one says Connection failed with the reason. If the request itself could not be sent, the message is "Test request failed". Click the small bin icon on the result to dismiss it.
- Pull queues a job that fetches the data and writes it to the landing zone. Hovering shows "Trigger a pull job — fetches data into Zone 1". The button reads Queuing… while it is sent. The page does not show the job's progress, so check the new data in the Catalog.
Every record that is pulled also gets bookkeeping fields: _ingested_at, _source_id, _source_method, _raw_payload_hash and _event_id.