Best Practices for Using Various API Styles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Our customer is currently designing a connection from a ServiceNow instance to API endpoints.
The request and response formats under consideration are as follows.
<Response Formats>
- JSON
- XML
- CSV
- INI format (*)
<Request Formats>
- GET with Query Parameters
- POST with Form Data
- POST with JSON Body
- Path Parameters
*Example of INI Format
- zipcode=1231234
- address=<Japanese address in Kanji>
- tel_no=0312345678
My Questions are;
1.
We understand that JSON and XML responses can be parsed using standard JavaScript capabilities provided by ServiceNow.
However, can ServiceNow also parse CSV and INI-style responses like the example above without additional implementation?
(Background: Our understanding is that libraries and modules that are typically available in a Node.js environment, including those imported using require(), cannot be utilized within ServiceNow.)
2.
Or would CSV and INI formats require custom parsing logic to be developed on the ServiceNow side?
3.
If custom processing is required, the customer currently appears to be using an API layer similar to a BFF (Backend for Frontend) that abstracts and normalizes response formats. In that case, would it be considered a best practice to place a BFF in front of ServiceNow and have it convert CSV or INI responses into JSON or XML before passing them to ServiceNow?
Alternatively, is there another recommended approach that would be preferable to using a BFF in this scenario?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @tomioyamash
I guess using new sn_impex.CSVParser() we will be able to parse CSV formatted response.
Read .CSV formatted files in ServiceNow
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti