Install and Use cURL

You can use cURL to access the Oracle Communications UIM REST API from the command line, as shown in the examples throughout this document.

Install cURL

Download and install the SSL-enabled version of cURL for your operating system from: http://curl.haxx.se/download.html.

Install the CA Certificate and Set the Environment Variable for cURL

To run cURL from a command shell, you must provide an SSL certificate authority (CA) file or bundle to authenticate against the Verisign CS certificate:

  1. Go to the cURL CA certifications page:

    http://curl.haxx.se/docs/caextract.html

  2. Download the cacert.pem CA certificate bundle to the folder where you installed cURL.

  3. At the command line, go to the directory where you installed cURL.

  4. Set the cURL environment variable, CURL_CA_BUNDLE, to the location of cacert.pem. For example:

    C:\curl> set CURL_CA_BUNDLE=cacert.pem

For information about CA certificate verification using cURL, see:

http://curl.haxx.se/docs/sslcerts.html

Use cURL

Use cURL at the command line to access the UIM REST API.

You can invoke cURL with one or more of these command-line options:

cURL Option Description
-d, --data

Specifies the body of the POST request.

For short requests, such as a POST request to create a telephone number without any relationship, you can include the body data in JSON format directly in the request.

For long requests, such as creating a logical device with many relationships, use -d @file.json , where file is a JSON document on your local system that contains your request body. The examples in this document use this option, regardless of length.

-H

Specifies the headers to use, which define the content type and authorization details.

See Supported Methods for more information.

-i Specifies that the response should include header information.
-X Specifies the type of request: GET, POST, PATCH, PUT, or DELETE.

For example, the cURL command to create a telephone number might look like:

curl -i -X PATCH http://hostname:port/InventoryRSOpenAPI/resourceInventoryManagement/version/logicalDevice/ID -H 'Authorization: Basic credentials' -d ''{ "@type": "TelephoneNumber", "resourceSpecification": { "id": "BATTNSpec" }, "telephoneNumber": "1000000001" }''
where:
  • hostname is the URL for your UIM REST server.
  • port is the port for your UIM REST server.
  • version is the version of the API you're using, such as v1. See "Versioning".
  • credentials is the base64 encoding of ID and password joined by a single colon (ID:password).

The methods described in this document include examples of cURL requests and the corresponding JSON responses.