DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Building a REST Service That Collects HTML Form Data Using Netbeans, Jersey, Apache Tomcat, and Java
  • Building REST API Backend Easily With Ballerina Language
  • GraphQL vs REST API: Which Is Better for Your Project in 2025?
  • The Critical Role of Data at Rest Encryption in Cybersecurity

Trending

  • Why Your Test Automation Is Always Behind the Code And the Architecture That Fixes It
  • Your AI Agent Tests Are Passing, But Your Agent Is Still Broken
  • Feature Flag Debt: Performance Impact in Enterprise Applications
  • Beyond Manual Annotation: Engineering Self-Correcting Pseudo-Labeling Pipelines
  1. DZone
  2. Data Engineering
  3. Data
  4. Exporting and Importing Data From VBCS With REST Calls

Exporting and Importing Data From VBCS With REST Calls

See how you can move data into and out of your Oracle Visual Build Cloud Service apps in Dev or Prod using some REST calls from the command line.

By 
Shay Shmeltzer user avatar
Shay Shmeltzer
·
Nov. 06, 17 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
7.1K Views

Join the DZone community and get the full member experience.

Join For Free

Visual Builder Cloud Service (VBCS) makes it very easy to create custom objects to store your data. A frequent request we get is for a way to load and export data from these business objects. As John Ceccarelli blogged, we added a feature to support doing this through the command line — John's blog shows you the basic options for the command line.

I recently needed to do this for a customer and thought I'd share some tips that helped me get the functionality working properly in case others need some help skipping bumps in the road.

Here is a demo showing both import and export and how to get them to work.


Exporting Data

Export is quite simple — you use a GET operation on a REST service. The command line for calling this using curl will look like this:

curl -u user:password https://yourserver/design/ExpImp/1.0/resources/datamgr/export > exp.zip


The result is a streaming of a ZIP file, so I just added a > exp.zip file to the command's end. The zip file will contain CSV files for each object in your application.

Don't forget to replace the bold things with your values for username and password, your VBCS server name and the name of the app you are using (ExpImp in my case).

Importing Data

Having the exported CSV file makes it easy to build a CSV file for upload — in the demo, I just replaced and added values in that file. Next, you'll use a similar curl command to call a POST method. It will look like this:

curl -X POST -u user:password https://yourserver/design/ExpImp/1.0/resources/datamgr/import/Employee?filename=Employee.csv -H "Origin:https://yourserver" -H "Content-Type:text/csv" -T Employee.csv -v


A few things to note.

You need to specify which object you want to import into (Employee after the /import/ in the command above), and you also need to provide a filename parameter that tells VBCS which file to import.

In the current release, you need to work around a CORS security limitation — this is why we are adding a header (with the -H option) that indicates that we are sending this from the same server as the one we are running on. In an upcoming version, this won't be needed.

We use the -T option to attach the CSV file to our call.

Note that you should enable the "Enable basic authentication for business object REST APIs" security option for the application (Under Application Settings->Security).

Using Import in Production Apps

In the samples above, we imported and exported into an application that is still being developed — this is why we used the /design/ in our REST path.

If you want to execute things on an application that you published, then replace the /design/ with /deployment/

One special note about live applications: Before you import data into them, you'll need to lock them. You can do this from the home page of VBCS and the drop-down menu on the application.

REST Web Protocols Data (computing)

Published at DZone with permission of Shay Shmeltzer. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Building a REST Service That Collects HTML Form Data Using Netbeans, Jersey, Apache Tomcat, and Java
  • Building REST API Backend Easily With Ballerina Language
  • GraphQL vs REST API: Which Is Better for Your Project in 2025?
  • The Critical Role of Data at Rest Encryption in Cybersecurity

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook