OData
OData
The CData Connect Cloud OData API allows you to connect OData-compatible client tools to your data without installing any extra software or drivers. You must configure your OData tables before you can access your data from client tools.
Configure Tables
The OData page of the CData Connect Cloud dashboard allows you to configure your OData API. Before you begin, ensure that you have set up at least one data source on the Connections page and configured permissions as needed.
To configure your OData API, click OData in the navigation bar of the CData Connect Cloud dashboard.
By default, no tables are available in your OData API. You must add the tables from your Connections that you want to access in your OData-connected client tools.
Add Tables
To add tables to your OData API, follow these steps:
-
Above the table list, click Add.
-
A modal appears with a list of all your Connections. Select your desired Connection and click Next.
-
Check the box next to each table that you want to add.
-
Click Submit to add the selected tables.
Note: The OData API does not support the following special characters in table or column names: # . ? &
. These symbols are automatically replaced with underscore characters (_
) in table aliases. Columns that contain these characters cannot be used through the OData API.
Edit Tables
After adding a table to your OData API, you can edit it by clicking the pencil-shaped icon in the list.
When you are finished modifying a table, click Save Changes to save your changes or click the arrow next to Edit OData Table to discard your changes.
Table Alias
The Alias for a table is the name that is used when issuing queries to the table. By default, a table’s Alias is the same as its name in the data source that it comes from. However, if a table name contains special characters (# . ? &
), they are replaced with underscores (_
).
You can modify each table’s Alias as needed. If you update an Alias, ensure that you also update any affected queries or operations downstream because the old Alias will no longer work.
Columns
Table Columns displays a searchable list of all of the columns in a table. By default, all columns in each table are exposed, and you can hide a column by clearing the checkbox next to the column name. Columns that contain special characters (# . ? &
) cannot be used with the OData API.
The table’s Primary Key is marked with a key icon. The primary key cannot be modified in this interface.
To modify a column, click its name or the edit icon in the Table Columns list. You can change the values for Data Type, Max Length and Is Nullable for each column.
Delete Tables
To delete an OData table from your OData API, follow these steps:
-
In the OData table list, check the box next to the table(s) you want to delete. To select all tables, check the box next to the Table header.
-
Above the table list, click Delete.
-
In the confirmation modal that appears, click Delete.
Note: Deleting a table this way only removes it from your OData API. It does not delete the table from the data source.
Authentication
Applications connect to the OData API through Basic Authentication (username and password). When configuring a connection, set the connection properties as follows:
- Set the URL as the OData Service URL (
https://cloud.cdata.com/api/odata/service
). - For the Username, enter your CData Connect Cloud username. This is displayed in the top-right corner of the CData Connect Cloud interface. For example, test@cdata.com.
- For the Password, enter a Personal Access Token (PAT) that you generate on the Settings page.
Connecting from Client Applications
The pages below provide instructions on connecting to the OData API from within popular client applications:
The sections below outline how to connect from cURL and Postman.
cURL
The cURL command line tool provides one of the simplest ways to retrieve OData tables. In your request, pass your username and PAT as Basic Auth credentials in the following format:
curl -u 'test@cdata.com:QpnquoIujrBNunK' https://cloud.cdata.com/api/odata/service/
With this request, cURL returns the OData response directly to the standard output.
Postman
Postman is a testing utility tool that can easily connect to the CData Connect Cloud OData API. To use Postman, set the following settings:
-
Set the HTTP operation to GET
-
Set the request URL to https://cloud.cdata.com/api/odata/service. If desired, you can specify a resource name.
-
In the Authorization tab, set the Auth type to Basic Auth
-
Set the Username and password to the username and authentication token from the Users tab.
-
Click Send to submit your request to Connect
Postman will display the OData results in the response section.