cURL Access
The examples within this document use cURL to demonstrate how to access the REST API for Content Capture.
To use cURL to access the REST API for Content Capture:
-
Install cURL, as described in Quick Start.
-
When running cURL from a Windows command shell only, set the cURL environment variable,
CURL_CA_BUNDLE
, to the location of an SSL certificate authority (CA) certificate file or bundle to authenticate against the Verisign CA certificate. Alternatively, you can specify the location of your local CA certificate bundle on the command line, using the--cacert
command-line option. Obtain an OAuth token, see Authorization.You can download an SSL CA certificate bundle from http://curl.haxx.se/docs/caextract.html or provide your own. For information about CA certificate verification using cURL, see http://curl.haxx.se/docs/sslcerts.html.
-
Invoke cURL and specify one or more of the command-line options defined in the following table, as required, to direct its execution.
cURL Option Description -d, --data @file.json
Identifies the request document, in JSON format, on the local machine. -F, --form @file.json
Identifies form data, in JSON format, on the local machine. -H Authorization: Bearer {token}
Sets the authorization header in the HTTP quest to a bearer value. This is used to specify the OAuth token for the Oracle Content Management account. Used to define additional HTTP headers in the request. Typically used to define one or both of the following:- Content type of the request document
- Custom header,
X-ID-TENANT-NAME
, to identify the identity domain
-i
Displays response header information. -X
Indicates the type of request ( GET
,POST
,PUT
, orDELETE
).
For example:
curl -i -X GET -H Authorization: Bearer {token} -H request-header:value https://subdomain.domain.com/path/resource-path
Where:
token
is the OAuth token for Oracle Content Management.-
request-header:value
is the request header. -
hostname.com:port
is the host and port where Oracle Content Management is running. -
version
is the version of the REST API. For example,v1
. -
resource-path
is the relative path that defines the resource.