is there a REST API to create a Data Source?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2023 06:39 AM
My ultimate goal is to be able to use Import Set API to import data from JSON to an existing Target table, doing this in a program using REST API's. The Import Set API is available as a REST API, but a prerequisite for importing to a Target table is to first create a Staging table. In another Developer form thread on the subject of creating a Staging table, one reply was that creating a Data Source automatically creates a Staging table. Is there a REST API to create a Data Source?
I've asked in separate threads whether there is a REST API to clone an existing table, to create a new table, and now I'm narrowing the question down to creating a Staging table for Import Set API. It seems that many of these operations are intended for manual operation via the Service Now web UI, but a number of these operations do not have well documented (or perhaps any) REST API to allow running the operation from a program.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2023 01:12 PM
I don't think it's the best practice to directly create an import set. However you could create this with a few GlideRecords and a custom Scripted REST api. In this scripted REST api you can write any GlideRecord logic you require.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2023 12:08 PM
Similar services such as Salesforce have extensive API sets that allow programs to import data to an instance, without the need for a human to sit at a web browser to configure the import or prerequisites of the import. It seems that Service Now has a REST API (Import Set API) to perform the import itself, but not to setup for the import (such as creation of Staging table, or Data Source). I see that Script REST API involves a human sitting at a web browser to configure the REST API extension. Is there a way for a program to run a script (provided by the program) via REST API?