# Oracle Cloud Fusion (Legacy)

{% hint style="info" %}
The following reference documentation is for the **Legacy** Oracle Cloud Fusion book. Refer to the latest version [here](https://docs.kognitos.com/legacy/legacy-experience/books/reference/oracle-fusion).
{% endhint %}

## Overview

The **Oracle Cloud Fusion Book** integrates with Oracle Cloud Fusion, enabling seamless automation of business processes.

## Prerequisites

1. **Oracle Fusion Account**: You need to have an active Oracle Fusion account. If you do not have one, you can sign up for an Oracle Fusion trial account to get started.
2. **API Access**: Ensure that your Oracle Fusion account has API access enabled. API access is required for Kognitos to communicate with Oracle Fusion.
3. **Credentials**: Obtain your Oracle Fusion instance URL, username, and password. These credentials are necessary for establishing a secure connection to Oracle Fusion.

#### Required Credentials

To connect to Oracle Fusion, you will need the following credentials:

1. **Fusion Instance URL**: The base URL of your Oracle Fusion instance. This URL is unique to your organization and can be found in the address bar when you are logged into Oracle Fusion. It typically follows the format `https://<your_instance>.oraclecloud.com`.
2. **Username**: The email address or username associated with your Oracle Fusion account.
3. **Password**: The password for your Oracle Fusion account.

### Learning the Oracle Cloud Fusion Book

To use the **Oracle Cloud Fusion Book**, you must first **learn** it in your agent.

1. Navigate to **Books → All Books.**
2. Search for `Oracle Cloud Fusion`.
3. Click on **Add Connection.**
4. Enter your credentials when prompted.

## Procedures

### Fetching Data

To fetch data from Oracle Fusion:

```
get a fusionobject's {thing}
```

```
get fusion's {thing}
```

### Adding Records

To add a new record to Oracle Fusion, you need to specify the type of object you're creating and provide the necessary field values. For example:

```
create a thing in fusion with
    the thing's name is "New Purchase Order"
    the thing's date is "2023-12-31"
    the thing's status is "Pending"
```

This creates a new purchase order with the specified name, date, and status.

### Updating Records

To update an existing Oracle Fusion object, you must identify the object by its ID and specify the fields you want to update. For example:

```
the fusionobject's ID is "12345"
change the fusionobject's status to "Approved"
```

This updates the status of the specified purchase order to "Approved".

### Deleting Objects

#### Single Deletion

To delete a specific Oracle Fusion object, you need to specify the object and its ID. For example:

```
the fusionobject's ID is "12345"
delete the fusionobject
```

This deletes the Oracle Fusion object with the specified ID.

### Attaching Files to Oracle Fusion Objects

**Example: Attaching a PDF Document to an Invoice**

```
create invoice's attachment with
    the file path is "/path/to/document.pdf"
    the invoice's ID is "67890"
    the file type is "PDF"
```

This specifies the file to attach (`document.pdf`), identifies the Oracle Fusion invoice by its ID, and indicates the file type. Kognitos handles the process of attaching the file to the specified Oracle Fusion invoice.

### Downloading Files

#### Example: Downloading a Document Attached to an Invoice

```
get invoice's attachment with
    the invoice's ID is "67890"
    the file name is "document.pdf"
```

This retrieves an attached file (`document.pdf`) from a specified Oracle Fusion invoice. Kognitos facilitates the download process, making the file available for local use or review.
