- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 11:43 PM - edited 09-29-2023 12:15 AM
Hi All,
How to send csv file to snow in original format (no binary & no base64) using REST API and attach it to particular record. and is this even possible to send csv file over api in original format. Please suggest.
@Ankur Bawiskar Please share your suggestion.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 02:11 AM
Hi @Obito ,
You can do so by attaching the CSV file to a record in ServiceNow. Here are the general steps:
-
Upload CSV to a Secure Location: First, upload the CSV file to a secure location accessible via a URL. This could be on your server, a cloud storage service, or any location with a publicly accessible URL.
-
Create a ServiceNow Record: Create a new record or update an existing record in ServiceNow that you want to associate with this CSV file. Ensure that this record has a field where you can store the URL of the CSV file.
-
Use REST API to Update the Record: Use the ServiceNow REST API to update the record created in step 2. In the request, include the URL of the CSV file, not the CSV file itself.
Here's an example of how you might structure your REST API request using a tool like cURL:
curl -X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_AUTH_TOKEN" \
-d '{
"csv_url": "https://your-csv-storage.com/path/to/your.csv"
}' \
"https://your-instance.service-now.com/api/now/table/your_table/YOUR_RECORD_SYS_ID"
Thanks,
Ratnakar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 02:11 AM
Hi @Obito ,
You can do so by attaching the CSV file to a record in ServiceNow. Here are the general steps:
-
Upload CSV to a Secure Location: First, upload the CSV file to a secure location accessible via a URL. This could be on your server, a cloud storage service, or any location with a publicly accessible URL.
-
Create a ServiceNow Record: Create a new record or update an existing record in ServiceNow that you want to associate with this CSV file. Ensure that this record has a field where you can store the URL of the CSV file.
-
Use REST API to Update the Record: Use the ServiceNow REST API to update the record created in step 2. In the request, include the URL of the CSV file, not the CSV file itself.
Here's an example of how you might structure your REST API request using a tool like cURL:
curl -X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_AUTH_TOKEN" \
-d '{
"csv_url": "https://your-csv-storage.com/path/to/your.csv"
}' \
"https://your-instance.service-now.com/api/now/table/your_table/YOUR_RECORD_SYS_ID"
Thanks,
Ratnakar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 05:58 AM
Hi Ratnakar,
I am using Basic auth with some username and password so how can i update the above script.
Thank you