# Working with the API

### About the demo project

Use this demo project to get familiar with the Web API. This project shows examples of getting product-, variant and category data as well as how to create and update these.

Furthermore, examples are shown on how to search products and work with global lists through the API.

For full documentation of the API, view the [API reference](https://techdoc.struct.com/api-reference/)

### Getting started

The project is a complete Visual Studio solution, using the Struct.PIM.Api.Client, available in Nuget, to fetch data from a Struct PIM instance.

All you need to do, is unzip the downloaded project and set up the Url for your Struct PIM instance as well as an API key for that instance and you are good to go.

{% file src="/files/WO6TgadVGKy7o1mEX3kL" %}
Download demo project here
{% endfile %}

### Autogenerate C# classes

We provide a T4Template which, using the API, can autogenerate C# classes for you matching the models in Struct PIM, yielding strongly typed models for you to use with the API.

{% file src="/files/xTU8Lj35bLKmzvQhoCCX" %}
Download T4Template here
{% endfile %}

### TLS

Depending on the environment you are connecting to you may need to specify TLS.

For the application using the Struct.PIM.Api.Client, specify below:

```csharp
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
```


---

# 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.struct.com/pim3/tutorials/example-projects/working-with-the-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.
