Pull ServiceNow table records into Semantica using the Table API with Basic or OAuth2 authentication.

Installation

The connector only needs requests, which already ships with Semantica’s core, so the extra is a no-op today; it exists so the dependency is declared explicitly. The module is a lazy export: import semantica.ingest does not load it until you first touch ServiceNowIngestor.

Basic Usage

Use environment variables (or a .env file with python-dotenv) to keep credentials out of source code. ServiceNowIngestor() with no arguments reads from SERVICENOW_* environment variables automatically.

Authentication

  • Basic — the default when only username/password are set.
  • OAuth2 — selected automatically when client_id is set. The token is fetched from <instance_url>/oauth_token.do with the password grant when username/password are also present, otherwise with client_credentials.
Missing configuration raises ValidationError before any network call is made.

Querying a Table

ingest_table maps directly onto the Table API query parameters:
Pagination is offset based (sysparm_limit / sysparm_offset) and is followed until the table is exhausted or limit rows have been collected. Reference-field link objects are dropped by default (sysparm_exclude_reference_link=true); pass exclude_reference_link=False to keep them. CMDB relationships live in cmdb_rel_ci:

Document Output

export_as_documents flattens each record to a dict with id (the record’s sys_id), name (resolved from name, number or short_description), source (the instance URL) and table, plus every field returned by the API, so the output feeds directly into GraphBuilder:

Security

Every outbound HTTP call — including the OAuth2 token request — goes through Semantica’s shared SSRF guard, so a user-supplied instance URL cannot reach private, loopback or link-local address space. Set allow_private_ips=True only for self-hosted deployments that genuinely need it.