# API Reference

## Overview

This documentation provides a detailed guide on how to visualize and interact with the Open Data Discovery (ODD) API. It covers the usage of the OpenAPI Specification for understanding the API's structure and Swagger UI for testing and interacting with the API endpoints

## OpenAPI Specification

The Platform has 2 distinct specifications that serve different aspects and both adhere to the OpenAPI Specification:

1. **Ingest specification**: An open standards specification that unifies metadata formats and allows multiple data sources and participants of the data discovery landscape to exchange metadata effectively, transparently, and consistently. It describes the semantics of the data discovery process as we envision it. It is data source agnostic by design and is intentionally not tied to the specifics of any particular data source or data catalog. Reference to the description of the specification: <https://github.com/opendatadiscovery/opendatadiscovery-specification/blob/main/specification/specification.md>.
2. **Platform specification:** This specification outlines the available endpoints, request methods, response codes, and other necessary details to interact with objects within ODD Platform. The full OpenAPI Specification for the ODD API can be accessed at [GitHub Repository OpenAPI Specification](https://github.com/opendatadiscovery/odd-platform/blob/main/odd-platform-specification/openapi.yaml).

* **Learning Resource**: For more in-depth knowledge about the OpenAPI, visit the [OpenAPI Resource Guide](https://swagger.io/resources/open-api/).

## Using the Swagger UI

You can utilize the Swagger UI for an interactive experience with the ODD API.

**Swagger UI Access**: The Swagger UI can be accessed on your deployed ODD platform at `{platform-base-url}/api/v3/api-docs`. Additionally, a demo version is available at [ODD Platform Demo Swagger UI](https://demo.oddp.io/api/v3/api-docs).\\

<figure><img src="https://3630572601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGZJ5RdCEQxq16TnRL3Tq%2Fuploads%2FHeMyRmg34jjjjLo7UAHW%2FSample%20list%20of%20API%20Enpoints.png?alt=media&#x26;token=9a8e901f-58ee-4f8b-b84f-1a6ab820536a" alt=""><figcaption><p>Sample list of API Endpoints</p></figcaption></figure>

### **Interacting with the API via Swagger UI**

**Select a definition**: There are two definitions:

* **ingestion-api:** describes all ingestion endpoints that are used by collectors.
* **platform-api:** describes all endpoints for the ODD platform, that can be used to access ODD resources.

<figure><img src="https://3630572601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGZJ5RdCEQxq16TnRL3Tq%2Fuploads%2FCPoNzHlcY9JCraQvg5oB%2FScreenshot%202024-01-15%20at%2015.10.57.png?alt=media&#x26;token=edab3708-08fd-4751-8319-fa5c905a4900" alt=""><figcaption><p>Select a definition</p></figcaption></figure>

#### **Start a Request**: Navigate to an API endpoint in the Swagger UI and click "Try it out".

<figure><img src="https://3630572601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGZJ5RdCEQxq16TnRL3Tq%2Fuploads%2FkyKb2BQcpAeUQ0Ynwvya%2FTry%20it%20out.png?alt=media&#x26;token=af8435d4-3045-493b-88c3-075ab9c2f021" alt=""><figcaption><p>Try it out</p></figcaption></figure>

#### **Enter Required Information**: Ensure all mandatory fields (marked with an asterisk \*) are completed.

<figure><img src="https://3630572601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGZJ5RdCEQxq16TnRL3Tq%2Fuploads%2FAjIlhVyaD0C3e610mnD7%2FFilling%20requred%20fields.png?alt=media&#x26;token=efcd9d58-312c-4aa7-bcc2-defe1135485d" alt=""><figcaption><p>Filling required fields</p></figcaption></figure>

#### **Send the Request**: Click the “Execute” button to submit the request.

<figure><img src="https://3630572601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGZJ5RdCEQxq16TnRL3Tq%2Fuploads%2Fs8cy3b1gTyC7dFSqqgH1%2FSend%20the%20Request.png?alt=media&#x26;token=4e7d3674-af9b-47f8-9593-aacd2edd72bf" alt=""><figcaption><p>Executing API Request</p></figcaption></figure>

### **Responses in Swagger UI**

* **Response Body**: The API response will be shown in the "Response body" section.
* **Response Codes and Examples**: Examples of response objects for each response code can be found in the "Responses" section.

<figure><img src="https://3630572601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGZJ5RdCEQxq16TnRL3Tq%2Fuploads%2Fs8cy3b1gTyC7dFSqqgH1%2FSend%20the%20Request.png?alt=media&#x26;token=4e7d3674-af9b-47f8-9593-aacd2edd72bf" alt=""><figcaption><p>API Response Example</p></figcaption></figure>

### **Further Information**

Learn more about how to use Swagger UI with the [Swagger UI documentation](https://swagger.io/tools/swagger-ui/).


---

# 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.opendatadiscovery.org/developer-guides/api-reference.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.
