Download Daily Extract Files via REST Core API

You can use the Core API REST interface to access the Daily Extract files.

Important: This information only applies to Oracle Field Service environments. You can verify whether you've Oracle Field Service or Oracle Fusion Field Service, by signing in and checking on the About page.

To access Daily Extract files using the Core API, you must install the cURL utility. You must also install the jq command-line processor if the target file list is unknown and the files are to be obtained from Oracle Field Service.

Example files are shown below and might be changed according to your needs.

Note: For simplification of the sample code, these demo scripts have omitted argument and response validation.

credentials.sh

The credentials file must contain the company name, API user, and a valid password.

#!/bin/sh

# Credentials
export COMPANY=""
export LOGIN="api_user_name"
export PASSWORD=""

# API URL
export URL="https://<environment_name>.fs.ocs.oraclecloud.com"

file_list.sh<DATE>

To see a list of exported files, use the sample code with the date argument in YYYY-MM-DD format.

#!/bin/sh
# Arguments
DATE="$1"
 
. ./credentials.sh
 
curl -u ${LOGIN}:${PASSWORD} ${URL}/rest/ofscCore/v1/folders/dailyExtract/folders/${DATE}/files/?company=${COMPANY} | jq -r '.files.items[].name' 

get_file.sh<DATE><FILENAME>

#!/bin/sh
# Arguments
DATE="$1"
FILENAME="$2"
 
. ./credentials.sh
 
curl -u ${LOGIN}:${PASSWORD} ${URL}/rest/ofscCore/v1/folders/dailyExtract/folders/${DATE}/files/${FILENAME}?company=${COMPANY} -o ${FILENAME}

all_files.sh<DATE>

#!/bin/sh -x
# Arguments
DATE="$1"
 
for filename in `./file_list.sh ${DATE}`
do
    ./get_file.sh ${DATE} $filename
done

More information about APIs