The connector only reads data. It never creates, changes or deletes users, contents, enrollments or companies in Twygo.
Before you start
- You need a Twygo administrator. The connector uses the API token of your organization, which only an administrator can generate.
- Every table is read in full on every sync. Twygo’s API has no filter by update date, so each sync reads the current state of every table. Large organizations (many users or many questionnaire answers) take longer to sync.
- Some tables depend on your Twygo plan. When a feature is not included in your organization’s Twygo contract (for example, companies and discount grants), Twygo refuses to share it. Those tables are skipped and marked as failed in the run, and the other tables keep syncing. Ask Twygo to enable the feature, or deselect those tables.
- Magic links are not stored. Twygo returns a login link (magic link) for each user and enrollment. Anyone who opens it is logged in as that user, so the connector does not load it.
Configuring Twygo as a Source
In the Sources tab, click on the “Add source” button located on the top right of your screen. Then, select the Twygo option from the list of connectors. Click Next and you’ll be prompted to add your access.1. Add account access
The connector signs in with your organization’s API token (API 2.0). The token is fixed: it does not expire and does not need to be renewed. It identifies your organization, so no organization ID is needed. To generate it:- Sign in to Twygo as an administrator.
- Go to Configurações > Integrações > API (the page
https://twygoead.com/o/<your organization ID>/integrations). - Generate the API token and copy it.
- API Token: The Twygo API 2.0 token of your organization.
2. Select streams
Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis. You can select entire groups of streams or pick specific ones.Tip: The stream can be found more easily by typing its name.Select the streams and click Next.
3. Configure data streams
Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.- Layer: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
- Folder: a folder can be created inside the selected layer to group all tables being created from this new data source.
- Table name: we suggest a name, but feel free to customize it. You have the option to add a prefix to all tables at once and make this process faster!
- Sync Type: every Twygo table is synced as Full table: each sync brings the current state of the data, so records deleted in Twygo also leave your catalog.
4. Configure data source
Describe your data source for easy identification within your organization, not exceeding 140 characters. To define your Trigger, consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times). Optionally, you can configure Delta Log Retention and determine for how long we should store old states of this table as it gets updated. Read more about this resource here. Once you are ready, click Next to finalize the setup.5. Check your new source
You can view your new source on the Sources page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.Streams and Fields
Available streams
The table below lists every stream, its slug (the exact identifier to pass when creating the source via API) and a short description.
Every table also has an
additional_fields column: any field Twygo returns that is not mapped to its own column, as a JSON object.
Fields by stream
Fields marked String (JSON) hold a JSON value; use your SQL engine’s JSON functions to read them.People
Users
Users
Every user of the organization: learners, managers and administrators, with their registration data. Read in full on every sync.Table:
users · Primary key: user_id · Sync: Full tableLearning content
Contents
Contents
Courses, learning paths and other contents (events) of the organization. Read in full on every sync.Table:
contents · Primary key: content_id · Sync: Full tableContent Activities
Content Activities
One row per activity of each content (videos, questionnaires, documents…), taken from the contents list. Read in full on every sync.Table:
content_activities · Primary key: content_id, activity_id · Sync: Full tableEnrollments and progress
Attendees (enrollments)
Attendees (enrollments)
Enrollments of users in contents, with their status, progress, scores, approval and completion dates and certificates. Read in full on every sync.Table:
attendees · Primary key: attendee_id · Sync: Full tableActivities Attendees (progress per activity)
Activities Attendees (progress per activity)
When each user started and concluded each activity of a content. Read in full on every sync.Table:
activities_attendees · Primary key: activity_attendee_id · Sync: Full tableQuestionnaires
Questionnaires
Questionnaires
Questionnaires (surveys and tests) of the organization. Read in full on every sync.Table:
questionnaires · Primary key: questionnaire_id · Sync: Full tableQuestionnaire Questions
Questionnaire Questions
One row per question of each questionnaire, with its answer options. Read in full on every sync.Table:
questionnaire_questions · Primary key: questionnaire_id, question_id · Sync: Full tableQuestionnaire Attempts
Questionnaire Attempts
Each attempt of a user at a questionnaire, with the number of correct answers. Read in full on every sync.Table:
questionnaire_attempts · Primary key: questionnaire_attempt_id · Sync: Full tableAnswers
Answers
Each answer given in a questionnaire attempt. Read in full on every sync.Table:
answers · Primary key: answer_id · Sync: Full tableEngagement
Likes
Likes
Likes of users on contents, active and removed. Read in full on every sync.Table:
likes · Primary key: user_id, content_id, liked · Sync: Full tableBookmarks (my list)
Bookmarks (my list)
Contents users saved to “my list”, active and removed. Read in full on every sync.Table:
bookmarks · Primary key: bookmark_id · Sync: Full tableCompanies and grants
Companies
Companies
Business customers of the organization, with a summary of their employees’ enrollments. Read in full on every sync.Table:
companies · Primary key: id · Sync: Full tableCompany Grants
Company Grants
Discount grants of the organization, which can be shared between companies. Read in full on every sync.Table:
company_grants · Primary key: id · Sync: Full tableCompany Grant Links
Company Grant Links
The grants linked to each company, with the contents or categories they cover. Read with one request per company. Read in full on every sync.Table:
company_grant_links · Primary key: company_id, grant_id · Sync: Full tableImplementation notes
- Full reads. Twygo’s API has no filter by update date, so every table is read in full on every sync. A table is only replaced once it was read completely: when Twygo fails or answers inconsistently in the middle of a table, that table keeps the data of the previous sync and the run says which table failed.
- Changes during a sync. Twygo returns its lists page by page, so a record created, changed or deleted while a list is being read can shift the others between pages. To avoid missing records, the connector reads every list at least twice and combines the reads, reading again while a read still finds records the earlier ones missed. If a list keeps changing in a way the reads cannot settle, that table fails instead of loading with gaps, and the next sync tries again. In rare cases a record changed during the sync only appears in the next sync, and a record deleted during the sync may still appear until the next sync.
- Likes without a date. Likes are identified by user, content and like date. A like Twygo returns without a like date is not loaded, and the sync log says how many.
- Empty answers. If a table that had records in the previous sync suddenly comes back empty, the sync stops that table instead of emptying it. If the data really was removed in Twygo, run a Full sync of the source to accept the empty table.
- Tables Twygo refuses or does not offer. When Twygo answers that a feature is not available for your organization, or that the token’s user is inactive, the tables of that feature are skipped and marked as failed, and the sync log names them. The same happens, with a “not found” message, when Twygo does not offer one of the lists for your organization. If no selected table can be read, or the token is invalid, the run fails.
- Rate limits. Twygo does not document a request limit. The connector sends one request at a time and waits and retries when Twygo asks it to slow down.