Segment.PublicApi
56.0.0
See the version list below for details.
dotnet add package Segment.PublicApi --version 56.0.0
NuGet\Install-Package Segment.PublicApi -Version 56.0.0
<PackageReference Include="Segment.PublicApi" Version="56.0.0" />
paket add Segment.PublicApi --version 56.0.0
#r "nuget: Segment.PublicApi, 56.0.0"
// Install Segment.PublicApi as a Cake Addin #addin nuget:?package=Segment.PublicApi&version=56.0.0 // Install Segment.PublicApi as a Cake Tool #tool nuget:?package=Segment.PublicApi&version=56.0.0
Segment Public API C# SDK
⚠️ This SDK is currently released as Public Beta. Its use in critical systems is discouraged, but feedback is welcome.
The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs.
All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace.
See the next sections for more information on how to use the Segment Public API.
This C# SDK is automatically generated by the OpenAPI Generator project:
- API version: 56.0.0
- Generator version: 7.0.1
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit https://docs.segmentapis.com
Dependencies
- RestSharp - 112.0.0 or later
- Json.NET - 13.0.2 or later
- JsonSubTypes - 1.8.0 or later
- System.ComponentModel.Annotations - 5.0.0 or later
Getting Started
using System.Collections.Generic;
using System.Diagnostics;
using Segment.PublicApi.Api;
using Segment.PublicApi.Client;
using Segment.PublicApi.Model;
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.segmentapis.com";
// Configure Bearer token for authorization: token
config.AccessToken = "YOUR_BEARER_TOKEN";
WorkspacesApi workspacesApi = new WorkspacesApi(config);
try
{
GetWorkspace200Response workspace200Response = workspacesApi.GetWorkspace();
Console.WriteLine(workspace200Response.Data.Workspace.Slug);
}
catch (ApiException e)
{
Debug.Print("Exception when calling APICallsApi.GetDailyPerSourceAPICallsUsage: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
SourcesApi sourcesApi = new SourcesApi(config);
PaginationInput paginationInput = new PaginationInput(count: 100, cursor: "");
try
{
do
{
ListSources200Response sources200Response = sourcesApi.ListSources(paginationInput);
foreach (SourceV1 source in sources200Response.Data.Sources)
{
// iterate over the sources
}
paginationInput.Cursor = sources200Response.Data.Pagination.Next;
} while (paginationInput.Cursor != null);
}
catch (ApiException e)
{
Debug.Print("Exception when calling APICallsApi.GetDailyPerSourceAPICallsUsage: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- JsonSubTypes (>= 2.0.1)
- Newtonsoft.Json (>= 13.0.3)
- Polly (>= 8.1.0)
- RestSharp (>= 112.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.