# REST API

The TRUE Connector will use two protocols (http and https) as described by the Docker Compose File. Overview of all available endpoints:

*NOTE* Endpoints are protected with credentials, for more details, please check [this link](https://github.com/Engineering-Research-and-Development/true-connector-execution_core_container/blob/1.14.8/doc/SECURITY.md)

| **Method** | **Endpoint**                           | **Usage**                                          | **Returns**                      |
| ---------- | -------------------------------------- | -------------------------------------------------- | -------------------------------- |
| POST       | /proxy                                 | Utility endpoint for starting communication        | Response from provider connector |
| GET        | /                                      | Get connector self description                     | Connector                        |
| GET        | /about/version                         | Return version of deployed ECC                     | -                                |
| GET        | /notification/content/{hash}           | Hash string from path variable                     | String                           |
| GET        | /notification/password/{password}      | Hash plain text password                           | String                           |
| GET        | /api/selfDescription/                  | Self description document without validation       | Connector                        |
| GET        | /api/offeredResource/{resourceId}      | Get requested resource                             | Resource                         |
| POST       | /api/offeredResource/{catalogId}       | Add new or update existing resource                | Connector                        |
| PUT        | /api/offeredResource/{catalogId}       | Update existing resource                           | Connector                        |
| DELETE     | /api/offeredResource/{resourceId}      | Delete existing resource                           | Connector                        |
| GET        | /api/representation/{representationId} | Get requested resource representation              | Representation                   |
| POST       | /api/representation/{resourceId}       | Add new or update existing resource representation | Connector                        |
| PUT        | /api/representation/{resourceId}       | Update existing resource representation            | Connector                        |
| DELETE     | /api/representation/{representationId} | Delete existing representation                     | Connector                        |
| GET        | /api/contractOffer/{contractOfferId}   | Get requested contract offer                       | Representation                   |
| POST       | /api/contractOffer/{resourceId}        | Add new or update existing contract offer          | Connector                        |
| PUT        | /api/contractOffer/{resourceId}        | Update existing contract offer                     | Connector                        |
| DELETE     | /api/contractOffer/{representationId}  | Delete existing contract offer                     | Connector                        |

Offered resources CRUD operations:

![Offered resource](https://1095228197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw1Z0xRYmpkm82aQ3Ng7y%2Fuploads%2Fgit-blob-fa546e1cc61f08f2615fb2f9fe44ec5ab289c98e%2FOffered_Resource_Swagger.jpg?alt=media)

Contract offer CRUD operations:

![Contract offer](https://1095228197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw1Z0xRYmpkm82aQ3Ng7y%2Fuploads%2Fgit-blob-80421b3b7d749317d0861bfb7c2977571bd9801c%2FContract_Offer_Swagger.jpg?alt=media)

Representation CRUD operations:

![Resource representation](https://1095228197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw1Z0xRYmpkm82aQ3Ng7y%2Fuploads%2Fgit-blob-9db1d1f4748309c47aecb5a79403c2f71fb911e1%2FResource_Representation_Swagger.jpg?alt=media)

On following [link](https://github.com/Engineering-Research-and-Development/true-connector-execution_core_container/blob/1.14.8/doc/SELF_DESCRIPTION.md), you can find more detailed explanation of endpoints, with example requests.


---

# 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://engineering-ing-inf-rd.gitbook.io/true-connector/advanced-doc/rest_api.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.
