Airtable automation scripts for OneBill API integration.
These scripts integrate with the OneBill API for authentication and data retrieval, storing credentials in Airtable for use across automations.
Authenticates with OneBill using OAuth password grant flow and stores tokens in Airtable.
Fetches subscriber data from OneBill using the stored access token.
- Copy
.env.exampleto reference required credentials - Update the
CONFIGobject in each script with your specific values - Create an
Authenticationtable in Airtable withKeyandRefreshTokenfields
| Variable | Description |
|---|---|
CLIENT_ID |
OneBill OAuth client identifier |
CLIENT_SECRET |
OneBill OAuth client secret |
USERNAME |
OneBill account username/email |
PASSWORD |
OneBill password hash |
AIRTABLE_TABLE |
Table name storing auth tokens |
AIRTABLE_RECORD_ID |
Record ID containing tokens |
Run onebill-auth.js on a schedule to keep tokens fresh. The script will:
- Request new access/refresh tokens from OneBill
- Update the Airtable record with new tokens
Run onebill-get-subscribers.js to retrieve subscriber data. The script will:
- Read the current access token from Airtable
- Call the OneBill Subscriber API
- Return subscriber data for processing
| Endpoint | Description |
|---|---|
/oauth/token |
OAuth token endpoint |
/rest/SubscriberService/v1/subscribers |
Get all subscribers |
Tokens are stored in the Authentication table:
Key- Access tokenRefreshToken- Refresh token