# IBM Cloud Object Storage

### Before You Connect <a href="#before-you-connect" id="before-you-connect"></a>

Before you can connect to IBM Cloud Object Storage, you need to register a IBM Cloud Object Storage instance, then find and note your IBM Cloud Object Storage API Key and CRN.

#### Register a New Instance of Cloud Object Storage <a href="#register-a-new-instance-of-cloud-object-storage" id="register-a-new-instance-of-cloud-object-storage"></a>

If you do not already have Cloud Object Storage in your IBM Cloud account, you can follow the procedure below to install an instance of SQL Query in your account:

1. Log in to your IBM Cloud account.
2. Navigate to the [Cloud Object Storage](https://console.bluemix.net/catalog/services/cloud-object-storage) page, choose a name for your instance and click Create. You will be redirected to the instance of Cloud Object Storage you just created.

#### API Key <a href="#api-key" id="api-key"></a>

You can obtain your ApiKey as follows:

1. Log in to your IBM Cloud account.
2. Navigate to the [Platform API Keys](https://cloud.ibm.com/iam/apikeys) page.
3. On the middle-right corner, click Create an IBM Cloud API Key to create a new API Key.
4. In the pop-up window, specify the API Key name and click Create. Note the API Key as you can never access it again from the dashboard.

#### Cloud Object Storage CRN <a href="#cloud-object-storage-crn" id="cloud-object-storage-crn"></a>

By default, the provider will attempt to automatically determine a Cloud Object Storage CRN. However, if you have multiple accounts, you will need to specify the CloudObjectStorageCRN explicitly. You can obtain this value in one of two ways:

* Query the [Services](https://cdn.cdata.com/help/GMH/ado/pg_table-services.htm) view. This will list your IBM Cloud Object Storage instances along with the CRN for each.
* Locate the CRN directly in IBM Cloud. To do so, navigate to your [IBM Cloud Dashboard](https://cloud.ibm.com/resources). In the Resource List, under Storage, select your Cloud Object Storage resource to get its CRN.

### Connecting to IBM Cloud Object Storage <a href="#connecting-to-ibm-cloud-object-storage" id="connecting-to-ibm-cloud-object-storage"></a>

You can now set the following to connect to data:

* InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
* ApiKey: Set this to your API key which was noted during setup.
* CloudObjectStorageCRN (Optional): Set this to your noted cloud object storage CRN. While the provider attempts to retrieve this automatically, specifying this explicitly is recommended if you have more than one Cloud Object Storage account.

When you connect, the provider completes the OAuth process.

1. Extracts the access token and authenticates requests.
2. Saves OAuth values in OAuthSettingsLocation to be persisted across connections.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appstrategy.com/apprules-r-documentation/platform/platform-features/system-settings/data-sources/connection-settings/cloudstorage/ibmcloudobjectstorage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
