Documentation Center

Using C# to connect to the Tridion Docs OpenAPI

This topic explains how to create a Tridion Docs OpenAPI client. This example scenario assumes that you are using Visual Studio to generate a client in C#. To generate a client for another language, find and use a client generator tool for OpenAPI for that language.

Before you begin

To follow the steps in this task, the following must be true:
  • You have Microsoft .NET SDK and Microsoft Visual Studio installed on your system.
  • You know the full URL of the Content Manager web services, which is of the format https://SERVER/ISHWS, where SERVER is the name of the Content Manager server, say, ish.example.com. In the steps below, the full URL of the web services is referred as "the web service URL."

Procedure

  1. Create a Visual Studio project, for example, a Console Application.
  2. In the project's Solution Explorer, add a Connected Service of type OpenAPI:
    1. When asked to provide theOpenAPI specification URL, enter the web service URL followed by /api/api-docs/v3/openapi.json. You can also provided a download openapi.json specification file.
    2. When asked to specify the classname, set it to TridionDocsClient.
    3. The namespace will automatically be set to the name of your project.
    The Visual Studio code generator generates the client.
  3. Obtain an access token to authenticate. The code sample in this documentation uses the client credentials flow and requires a client ID and client secret.
  4. Confirm that you have access to the API by interacting with it.

What to do next

You are now ready to interact with Tridion Docs OpenAPI from your code.