We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Import set API vs Scripted Rest API

1_DipikaD
Kilo Sage

Hi All ,

 

I have doubt on a few questions mentioned below . Please help me to find the answers.

1 -  Where import set Api is used and where scripted rest api is used ?

2 - Which is better Basic or Auth 2.0 ? While token expires how to get new token and is it a manual or automatic process . If it is automatic then how we can configure it ?

3- What is the significance of co-relation id in integration ?

 

Thank You

2 REPLIES 2

yashkamde
Mega Sage

Hello @1_DipikaD ,

 

 1) Use Import Set for data ingestion and transformation and Use Scripted for custom integrations :

Import Set APIScripted REST API
Used for bulk data loads into ServiceNow from external sourcesUsed for custom integrations and exposing tailored REST endpoints
Works with staging tables and transform mapsAllows custom logic, validations, and controlled responses
Best suited for ETL (Extract, Transform, Load) scenariosBest suited for real-time integrations and external system communication

 

2) Use Basic Auth only for internal use cases. OAuth 2.0 is generally better because it avoids exposing static credentials and supports token lifecycle

Basic AuthOAuth 2.0
Simple, credentials sent with every requestMore secure, token-based authentication
Less secure, not recommended for modern integrationsPreferred for modern integrations
No token expiry handlingAccess tokens expire; refresh tokens automatically renew
Manual credential managementConfigured in ServiceNow via System OAuth → Application Registry with refresh token handling

 

Refer this for detailed understanding :

What is Difference between table api , import set api and scripted rest api with example ? 

Basic Authentication vs OAuth 

Correlation ID 

 

If my response helped mark as helpful and accept the solution.

Ankur Bawiskar
Tera Patron

@1_DipikaD 

responses inline

1 - Where import set Api is used and where scripted rest api is used ? -> scripted rest api is used when 3rd party wants to send request in particular format and response is required as per their format, import set API is mostly used to load data to table

2 - Which is better Basic or Auth 2.0 ? While token expires how to get new token and is it a manual or automatic process . If it is automatic then how we can configure it ? -> OAuth 2.0 is better in terms of security as compared to Basic auth. Before the access token expires 3rd party will have to generate the token again using refresh token. If you are consuming 3rd party using OAuth 2.0 then same process you need to follow

3- What is the significance of co-relation id in integration ? -> it's used to store the unique identifier of 3rd party during integration

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader