Download Daily Extract Files
You can download the daily extract files and use them for updating your outbound integration systems that don't require real-time updates.
Let's look at an example to understand the use of Daily Extract.
Vision Corporation is a fs.ocs.oraclecloud.company, which uses its backend system data to perform business analytics and manage scorecards of technicians. Scorecards rank how technicians are performing at their job and how they compare to their peers at a similar career level. The scorecard is used for reviews, promotions and to identify areas of strength and opportunity. This scorecard system is integrated with Oracle Field Service but it doesn't need to be updated in real-time, updating once daily is sufficient. In this case, you can choose to extract the files only once a day in compressed file format using the Daily Extract feature. The extracted files contain data of the entities, such as activities, routes, and so on. Vision Corporation uses the activity and route related information from the extracted files to update the scorecards, allowing the technicians to get daily updates about their performance.
To download daily extract files:
- Retrieve the list of dates for which daily extract files are available.
- Retrieve the list of files for a date for which you want to download the daily extract.
- Download the files.
- (Optional) Resume partial download in case of a network failure.
Retrieve the List of Dates
Suppose you want to download daily extract files, in that case, you first need to retrieve the list of dates for which the files are available. You can retrieve the list of dates as follows:
- Construct the request URL for the 'Get daily extract dates' operation.
- Run the request using the GET HTTP method to retrieve the list of dates. If the request is successful, you get the list of dates for which daily extract files are available.
Example URL
Here's the complete URL with the GET HTTP method.
https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders
Example cURL command
curl -u '<CLIENT_ID>@<INSTANCE_NAME>:<CLIENT_SECRET>'\
-H 'Accept: application/json' \
'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders'
Example Response
Here's an example of the response body in JSON format.
HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Wed, 15 Jul 2015 12:30:56 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
{
"name": "folders",
"folders": {
"items": [
{
"name": "2015-07-01",
"links": [
{
"rel": "canonical",
"href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders/2015-07-01"
}
]
},
{
"name": "2015-07-02",
"links": [
{
"rel": "canonical",
"href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders/2015-07-02"
}
]
}
],
"links": [
{
"rel": "canonical",
"href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders"
}
]
},
"links": [
{
"rel": "canonical",
"href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders"
},
{
"rel": "describedby",
"href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/metadata-catalog/folders"
}
]
}
Retrieve the List of Files for a Date
You can retrieve the list of the files that exist for the selected date. Retrieving the list of files for a date is optional because the list remains the same for any date. You can retrieve the list of files for a date as follows:
- Construct the request URL for the 'Get a list of daily extract files for a date' operation.
- Specify the path parameter
dailyExtractDate
as2015-07-02
in the operation URL. - Run the request using the GET HTTP method to retrieve the list of the files.
Note:
You can ignore this procedure, if you already know the files that you want to download.Example URL
Here's the fs.ocs.oraclecloud.complete URL with the GET HTTP method.
https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders/2015-07-02/files
Example cURL command
curl -u '<CLIENT_ID>@<INSTANCE_NAME>:<CLIENT_SECRET>' \
-H 'Accept: application/json' \
'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders/2015-07-02/files'
Example Response
Here's an example of the response body in JSON format.
HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Wed, 15 Jul 2015 12:30:56 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
{
"name": "files",
"files": {
"items": [
{
"name": "activity-data.tar.gz",
"bytes": "3943529",
"mediaType": "application/octet-stream",
"links": [
{
"rel": "canonical",
"href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders/2015-07-02/files/activity-data.tar.gz"
}
]
},
{
"name": "inventory-data.tar.gz",
"bytes": "32727812",
"mediaType": "application/octet-stream",
"links": [
{
"rel": "canonical",
"href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders/2015-07-02/files/inventory-data.tar.gz"
}
]
}
]
},
"links": [
{
"rel": "canonical",
"href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders/2015-07-02/files"
},
{
"rel": "describedby",
"href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/metadata-catalog/folders"
}
]
}
Download the Files
By default,
the description of the file is returned in JSON format. If you want
to download binary data, then the Accept
header value must be application/octet-stream
. You can download the daily extract
files as follows:
- Construct the request URL for the 'Get a daily extract file' operation.
- Specify the path parameters,
dailyExtractDate
as2015-07-02
anddailyExtractFilename
asactivity-data.tar.gz
in the operation URL. - Run the request using the GET HTTP method to retrieve the list of the files.
Example URL
Here's the complete URL with the GET HTTP method.
https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders/2015-07-02/files/activity-data.tar.gz
Example cURL command
curl -u '<CLIENT_ID>@<INSTANCE_NAME>:<CLIENT_SECRET>' \
-H 'Accept: application/octet-stream' \
'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders/2015-07-02/files/activity-data.tar.gz'
Example Response
Here's an example of the response body in JSON format.
HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Wed, 15 Jul 2015 12:31:55 GMT
Content-Type: application/octet-stream
Content-Length: 3943529
Connection: keep-alive
content-description: File Transfer
content-disposition: attachment; filename="activity-data.tar.gz"
*BINARY DATA*
Resume a Partial Download Process
Sometimes the download of daily extract file may be incomplete because
of a network failure, in such case you can resume the download process.
You need to specify the Range
header value to resume an incomplete download from some offset to
a file. For example, Range: 100000000
indicates that download resumes from an offset of 100000000 bytes
to the end of the file.
Note:
The client combines the remaining file with the partially downloaded file.You can resume a download as follows:
- Construct the request URL for the 'Get a daily extract file' operation.
- Specify the path parameters,
dailyExtractDate
as2015-07-02
anddailyExtractFilename
asactivity-data.tar.gz
in the operation URL. - Run the request using the GET HTTP method to retrieve the list of the files.
Example URL
Here's the complete URL with the GET HTTP method.
https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders/2015-07-02/files/activity-data.tar.gz
Example cURL command
curl -u '<CLIENT_ID>@<INSTANCE_NAME>:<CLIENT_SECRET>' \
-H 'Accept: application/octet-stream' \
-H 'Range: bytes=100000000-' \
'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/folders/dailyExtract/folders/2015-07-02/files/activity-data.tar.gz'
Example Response
Here's an example of the response body in JSON format.
HTTP/1.1 206 PARTIAL CONTENT
Server: nginx/1.6.2
Date: Wed, 15 Jul 2015 12:31:55 GMT
Content-Type: application/octet-stream
Content-Length: 3943529
Connection: keep-alive
content-description: File Transfer
content-disposition: attachment; filename="activity-data.tar.gz"
*BINARY DATA STARTING FROM OFFSET 100,000,000 BYTES INTO THE FILE*