Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

C# SDK for Public API

License

NotificationsYou must be signed in to change notification settings

segmentio/public-api-sdk-csharp

Repository files navigation

⚠️ This SDK is currently released asPublic Beta. Its use in critical systems is discouraged, butfeedback 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 theOpenAPI Generator project:

  • API version: 58.13.0
  • Generator version: 7.0.1
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegenFor more information, please visithttps://docs.segmentapis.com

Dependencies

Getting Started

usingSystem.Collections.Generic;usingSystem.Diagnostics;usingSegment.PublicApi.Api;usingSegment.PublicApi.Client;usingSegment.PublicApi.Model;publicclassExample{publicstaticvoidMain(){Configurationconfig=newConfiguration();config.BasePath="https://api.segmentapis.com";// Configure Bearer token for authorization: tokenconfig.AccessToken="YOUR_BEARER_TOKEN";WorkspacesApiworkspacesApi=newWorkspacesApi(config);try{GetWorkspace200Responseworkspace200Response=workspacesApi.GetWorkspace();Console.WriteLine(workspace200Response.Data.Workspace.Slug);}catch(ApiExceptione){Debug.Print("Exception when calling APICallsApi.GetDailyPerSourceAPICallsUsage: "+e.Message);Debug.Print("Status Code: "+e.ErrorCode);Debug.Print(e.StackTrace);}SourcesApisourcesApi=newSourcesApi(config);PaginationInputpaginationInput=newPaginationInput(count:100,cursor:"");try{do{ListSources200Responsesources200Response=sourcesApi.ListSources(paginationInput);foreach(SourceV1sourceinsources200Response.Data.Sources){// iterate over the sources}paginationInput.Cursor=sources200Response.Data.Pagination.Next;}while(paginationInput.Cursor!=null);}catch(ApiExceptione){Debug.Print("Exception when calling APICallsApi.GetDailyPerSourceAPICallsUsage: "+e.Message);Debug.Print("Status Code: "+e.ErrorCode);Debug.Print(e.StackTrace);}}}

About

C# SDK for Public API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp