Oracle Cloud Infrastructure API


   Oracle Cloud Infrastructure API

Oracle Cloud Infrastructure (OCI) provides a wide range of cloud services, and these services can be managed and configured using OCI’s REST API. Below are some key aspects to consider when working with OCI APIs:


Authentication in OCI typically involves creating a private/public key pair. The public key is uploaded to the Oracle Cloud dashboard, and the private key is used for signing API requests.

API Endpoint

API endpoints differ based on the cloud service you are interacting with and the data center/region. The base format usually looks like:

arduinoCopy code

API Request Format

A typical API request to Oracle Cloud Infrastructure uses HTTPS methods like GET, POST, PUT, and DELETE. Headers usually include Authorization, opc-request-id, and Content-Type.

Code Example

Here’s a Python example using the requests library to list all the instances in a compartment:

pythonCopy code

import requests

from oci import signers

# Initialize the signer with the user’s private key, user OCID, tenant OCID, and public fingerprint

signer = signers.get_api_signer(






# Prepare the request

compartment_id = ‘YOUR_COMPARTMENT_ID’

endpoint = f’{compartment_id}’

method = ‘GET’

headers = {

    ‘Content-Type’: ‘application/json’,

    ‘opc-request-id’: ‘unique-request-id’


# Sign the request

signer.sign(method, headers, None, endpoint)

# Make the API request

response = requests.get(endpoint, headers=headers)

if response.status_code == 200:



    print(f’Failed to list instances: {response.content}’)

Rate Limiting

OCI APIs have rate limits, so when sending bulk requests, ensure to handle 429 – Too Many Requests errors.


OCI Training Demo Day 1 Video:

You can find more information about Oracle Cloud Infrastructure application in this Oracle Docs Link



Unogeeks is the No.1 Training Institute for Oracle Cloud Infrastructure Training. Anyone Disagree? Please drop in a comment

You can check out our other latest blogs on Oracle Cloud Infrastructure (OCI) in this Oracle Cloud Infrastructure (OCI) Blogs

You can check out our Best in Class Oracle Cloud Infrastructure Training details here – Oracle Cloud Infrastructure Training

 Follow & Connect with us:


For Training inquiries:

Call/Whatsapp: +91 73960 33555

Mail us at:

Our Website ➜

Follow us:





Leave a Reply

Your email address will not be published. Required fields are marked *