> For the complete documentation index, see [llms.txt](https://interfacing.gitbook.io/interfacing-help-files/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://interfacing.gitbook.io/interfacing-help-files/solutions-developers/api-and-information-repository/rest-apis/api-reference-swagger.md).

# API Reference (Swagger)

## How to Access the API Platform

IMS’s full API documentation is hosted on Swagger. It provides access to all available endpoints and detailed request/response structures.\
\
You can explore the documentation directly at: **`https://YOURIMS.interfacing.com/api/v1/swagger`**

{% hint style="info" %}
If the user is not already authenticated, they will need to log in first. Learn how to authenticate [here.](/interfacing-help-files/solutions-developers/api-and-information-repository/rest-apis.md#authentication-and-token-management)
{% endhint %}

***

## How to Use Swagger

The Swagger interface organizes API endpoints by module or subject area. Expand a category to see all related API operations. Each endpoint includes usage details, expected parameters, and example responses.

There are four primary types of API requests:

* **GET** — Retrieve data (equivalent to a SQL `SELECT`)
* **POST** — Create new objects (SQL `CREATE`)
* **PUT** — Update existing objects (SQL `UPDATE`)
* **DELETE** — Remove objects (SQL `DELETE`)

Each endpoint section provides:

1. **A sample request payload**&#x20;

<figure><img src="https://1488562728-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTx7AmE0d2Q4ja20EYjF5%2Fuploads%2FYAkH4eHeOTJHbAuHz82O%2Fswagger%20payload.png?alt=media&amp;token=4cc95038-8665-4beb-b56d-e99110736630" alt=""><figcaption></figcaption></figure>

2. **A list of query parameters** — some are required, others are optional for filtering or refining the request

<figure><img src="https://1488562728-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTx7AmE0d2Q4ja20EYjF5%2Fuploads%2FLdCDtPBRZCMW5SaDHcYa%2Fswagger%20query%20param.png?alt=media&amp;token=2934956b-f5de-41d4-900d-866e5c294faf" alt=""><figcaption></figcaption></figure>

***

## Java Code Example: Full API Client with Spring Boot

<pre class="language-java"><code class="lang-java"><strong>package com.interfacing.ims.sync.bpc.service;
</strong>
import java.util.Collection;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.util.MultiValueMap;
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.client.WebClient;
import lombok.RequiredArgsConstructor;
import reactor.core.publisher.Mono;
import com.interfacing.bpc.api.domain.BaseElement;
import com.interfacing.bpc.api.domain.NodeElement;
import com.interfacing.bpc.api.domain.patch.PatchOperation;

@Service
@RequiredArgsConstructor
public class ItemService {
    private final WebClient bpcClient;
    private final MultiValueMap&#x3C;String, String> defaultQueryParams;
    private final MultiValueMap&#x3C;String, String> defaultEditParams;

    public Mono&#x3C;BaseElement> findBaseElement(@NotNull String nodeId) {
        return bpcClient.get()
                .uri(uriBuilder -> uriBuilder.path("/items/{nodeId}").queryParams(defaultQueryParams).build(nodeId))
                .retrieve()
                .bodyToMono(new ParameterizedTypeReference&#x3C;>() {});
    }

    public &#x3C;T extends NodeElement> Mono&#x3C;T> findElement(@NotNull String nodeId, Class&#x3C;T> clazz) {
        return bpcClient.get()
                .uri(uriBuilder -> uriBuilder.path("/items/{nodeId}")
                .queryParams(defaultQueryParams)
                .queryParam("detail", true).build(nodeId))
                .retrieve()
                .bodyToMono(new ParameterizedTypeReference&#x3C;>() {});
    }

    public Mono&#x3C;String> findDescription(@NotNull String nodeId) {
        return bpcClient.get()
                .uri(uriBuilder -> uriBuilder.path("/items/{nodeId}/description")
                .queryParams(defaultQueryParams).build(nodeId))
                .retrieve()
                .bodyToMono(new ParameterizedTypeReference&#x3C;>() {});
    }

    public Mono&#x3C;String> findRichTextDescription(@NotNull String nodeId) {
        return bpcClient.get()
                .uri(uriBuilder -> uriBuilder.path("/items/{nodeId}/richTextDescription")
                .queryParams(defaultQueryParams).build(nodeId))
                .retrieve()
                .bodyToMono(new ParameterizedTypeReference&#x3C;>() {});
    }

    public Mono&#x3C;String> findWebappUrl(@NotNull String nodeId) {
        return bpcClient.get()
                .uri(uriBuilder -> uriBuilder.path("/items/{nodeId}/url/webapp")
                .queryParams(defaultQueryParams).build(nodeId))
                .retrieve()
                .bodyToMono(new ParameterizedTypeReference&#x3C;>() {});
    }

    public Mono&#x3C;BaseElement> createItem(@NotNull NodeElement nodeElement) {
        return bpcClient.post()
                .uri(uriBuilder -> uriBuilder.path("/items").queryParams(defaultEditParams).build())
                .contentType(MediaType.APPLICATION_JSON)
                .body(BodyInserters.fromValue(nodeElement))
                .retrieve()
                .bodyToMono(new ParameterizedTypeReference&#x3C;>() {});
    }

    public Mono&#x3C;BaseElement> updateItem(@NotNull NodeElement nodeElement) {
        return bpcClient.put()
                .uri(uriBuilder -> uriBuilder.path("/items/{nodeId}")
                .queryParams(defaultEditParams).build(nodeElement.getNodeId()))
                .contentType(MediaType.APPLICATION_JSON)
                .body(BodyInserters.fromValue(nodeElement))
                .retrieve()
                .bodyToMono(new ParameterizedTypeReference&#x3C;>() {});
    }

    public Mono&#x3C;Collection&#x3C;BaseElement>> patchItem(@NotNull String nodeId, @NotEmpty Collection&#x3C;PatchOperation> patchOperations) {
        return bpcClient.patch()
                .uri(uriBuilder -> uriBuilder.path("/items/{nodeId}")
                .queryParams(defaultEditParams).build(nodeId))
                .contentType(MediaType.APPLICATION_JSON)
                .body(BodyInserters.fromValue(patchOperations))
                .retrieve()
                .bodyToMono(new ParameterizedTypeReference&#x3C;>() {});
    }
}
</code></pre>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://interfacing.gitbook.io/interfacing-help-files/solutions-developers/api-and-information-repository/rest-apis/api-reference-swagger.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
