Skip to content

getlate-dev/late-dotnet

Repository files navigation

Late - the C# library for the Late API

API reference for Late. Authenticate with a Bearer API key. Base URL: https://getlate.dev/api

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.1
  • SDK version: 1.0.0
  • Generator version: 7.19.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit https://getlate.dev

Installation

Install via NuGet:

dotnet add package Late

Or via the Package Manager Console:

Install-Package Late

Then add the namespaces to your project:

using Late.Api;
using Late.Client;
using Late.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out Late.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Connections

Each ApiClass (properly the ApiClient inside it) will create an instance of HttpClient. It will use that for the entire lifecycle and dispose it when called the Dispose method.

To better manager the connections it's a common practice to reuse the HttpClient and HttpClientHandler (see here for details). To use your own HttpClient instance just pass it to the ApiClass constructor.

HttpClientHandler yourHandler = new HttpClientHandler();
HttpClient yourHttpClient = new HttpClient(yourHandler);
var api = new YourApiClass(yourHttpClient, yourHandler);

If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory.

HttpClient yourHttpClient = new HttpClient();
var api = new YourApiClass(yourHttpClient);

You'll loose some configuration settings, the features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. You need to either manually handle those in your setup of the HttpClient or they won't be available.

Here an example of DI setup in a sample web project:

services.AddHttpClient<YourApiClass>(httpClient =>
   new PetApi(httpClient));

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Late.Api;
using Late.Client;
using Late.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://getlate.dev/api";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new APIKeysApi(httpClient, config, httpClientHandler);
            var createApiKeyRequest = new CreateApiKeyRequest(); // CreateApiKeyRequest | 

            try
            {
                // Create key
                CreateApiKey201Response result = apiInstance.CreateApiKey(createApiKeyRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling APIKeysApi.CreateApiKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://getlate.dev/api

Class Method HTTP request Description
APIKeysApi CreateApiKey POST /v1/api-keys Create key
APIKeysApi DeleteApiKey DELETE /v1/api-keys/{keyId} Delete key
APIKeysApi ListApiKeys GET /v1/api-keys List keys
AccountGroupsApi CreateAccountGroup POST /v1/account-groups Create group
AccountGroupsApi DeleteAccountGroup DELETE /v1/account-groups/{groupId} Delete group
AccountGroupsApi ListAccountGroups GET /v1/account-groups List groups
AccountGroupsApi UpdateAccountGroup PUT /v1/account-groups/{groupId} Update group
AccountSettingsApi DeleteInstagramIceBreakers DELETE /v1/accounts/{accountId}/instagram-ice-breakers Delete IG ice breakers
AccountSettingsApi DeleteMessengerMenu DELETE /v1/accounts/{accountId}/messenger-menu Delete FB persistent menu
AccountSettingsApi DeleteTelegramCommands DELETE /v1/accounts/{accountId}/telegram-commands Delete TG bot commands
AccountSettingsApi GetInstagramIceBreakers GET /v1/accounts/{accountId}/instagram-ice-breakers Get IG ice breakers
AccountSettingsApi GetMessengerMenu GET /v1/accounts/{accountId}/messenger-menu Get FB persistent menu
AccountSettingsApi GetTelegramCommands GET /v1/accounts/{accountId}/telegram-commands Get TG bot commands
AccountSettingsApi SetInstagramIceBreakers PUT /v1/accounts/{accountId}/instagram-ice-breakers Set IG ice breakers
AccountSettingsApi SetMessengerMenu PUT /v1/accounts/{accountId}/messenger-menu Set FB persistent menu
AccountSettingsApi SetTelegramCommands PUT /v1/accounts/{accountId}/telegram-commands Set TG bot commands
AccountsApi DeleteAccount DELETE /v1/accounts/{accountId} Disconnect account
AccountsApi GetAccountHealth GET /v1/accounts/{accountId}/health Check account health
AccountsApi GetAllAccountsHealth GET /v1/accounts/health Check accounts health
AccountsApi GetFollowerStats GET /v1/accounts/follower-stats Get follower stats
AccountsApi ListAccounts GET /v1/accounts List accounts
AccountsApi UpdateAccount PUT /v1/accounts/{accountId} Update account
AnalyticsApi GetAnalytics GET /v1/analytics Get post analytics
AnalyticsApi GetBestTimeToPost GET /v1/analytics/best-time Get best times to post
AnalyticsApi GetContentDecay GET /v1/analytics/content-decay Get content performance decay
AnalyticsApi GetDailyMetrics GET /v1/analytics/daily-metrics Get daily aggregated metrics
AnalyticsApi GetFollowerStats GET /v1/accounts/follower-stats Get follower stats
AnalyticsApi GetLinkedInAggregateAnalytics GET /v1/accounts/{accountId}/linkedin-aggregate-analytics Get LinkedIn aggregate stats
AnalyticsApi GetLinkedInPostAnalytics GET /v1/accounts/{accountId}/linkedin-post-analytics Get LinkedIn post stats
AnalyticsApi GetLinkedInPostReactions GET /v1/accounts/{accountId}/linkedin-post-reactions Get LinkedIn post reactions
AnalyticsApi GetPostTimeline GET /v1/analytics/post-timeline Get post analytics timeline
AnalyticsApi GetPostingFrequency GET /v1/analytics/posting-frequency Get posting frequency vs engagement
AnalyticsApi GetYouTubeDailyViews GET /v1/analytics/youtube/daily-views Get YouTube daily views
CommentsApi DeleteInboxComment DELETE /v1/inbox/comments/{postId} Delete comment
CommentsApi GetInboxPostComments GET /v1/inbox/comments/{postId} Get post comments
CommentsApi HideInboxComment POST /v1/inbox/comments/{postId}/{commentId}/hide Hide comment
CommentsApi LikeInboxComment POST /v1/inbox/comments/{postId}/{commentId}/like Like comment
CommentsApi ListInboxComments GET /v1/inbox/comments List commented posts
CommentsApi ReplyToInboxPost POST /v1/inbox/comments/{postId} Reply to comment
CommentsApi SendPrivateReplyToComment POST /v1/inbox/comments/{postId}/{commentId}/private-reply Send private reply
CommentsApi UnhideInboxComment DELETE /v1/inbox/comments/{postId}/{commentId}/hide Unhide comment
CommentsApi UnlikeInboxComment DELETE /v1/inbox/comments/{postId}/{commentId}/like Unlike comment
ConnectApi CompleteTelegramConnect PATCH /v1/connect/telegram Check Telegram status
ConnectApi ConnectBlueskyCredentials POST /v1/connect/bluesky/credentials Connect Bluesky account
ConnectApi GetConnectUrl GET /v1/connect/{platform} Get OAuth connect URL
ConnectApi GetFacebookPages GET /v1/accounts/{accountId}/facebook-page List Facebook pages
ConnectApi GetGmbLocations GET /v1/accounts/{accountId}/gmb-locations List GBP locations
ConnectApi GetLinkedInOrganizations GET /v1/accounts/{accountId}/linkedin-organizations List LinkedIn orgs
ConnectApi GetPendingOAuthData GET /v1/connect/pending-data Get pending OAuth data
ConnectApi GetPinterestBoards GET /v1/accounts/{accountId}/pinterest-boards List Pinterest boards
ConnectApi GetRedditFlairs GET /v1/accounts/{accountId}/reddit-flairs List subreddit flairs
ConnectApi GetRedditSubreddits GET /v1/accounts/{accountId}/reddit-subreddits List Reddit subreddits
ConnectApi GetTelegramConnectStatus GET /v1/connect/telegram Generate Telegram code
ConnectApi HandleOAuthCallback POST /v1/connect/{platform} Complete OAuth callback
ConnectApi InitiateTelegramConnect POST /v1/connect/telegram Connect Telegram directly
ConnectApi ListFacebookPages GET /v1/connect/facebook/select-page List Facebook pages
ConnectApi ListGoogleBusinessLocations GET /v1/connect/googlebusiness/locations List GBP locations
ConnectApi ListLinkedInOrganizations GET /v1/connect/linkedin/organizations List LinkedIn orgs
ConnectApi ListPinterestBoardsForSelection GET /v1/connect/pinterest/select-board List Pinterest boards
ConnectApi ListSnapchatProfiles GET /v1/connect/snapchat/select-profile List Snapchat profiles
ConnectApi SelectFacebookPage POST /v1/connect/facebook/select-page Select Facebook page
ConnectApi SelectGoogleBusinessLocation POST /v1/connect/googlebusiness/select-location Select GBP location
ConnectApi SelectLinkedInOrganization POST /v1/connect/linkedin/select-organization Select LinkedIn org
ConnectApi SelectPinterestBoard POST /v1/connect/pinterest/select-board Select Pinterest board
ConnectApi SelectSnapchatProfile POST /v1/connect/snapchat/select-profile Select Snapchat profile
ConnectApi UpdateFacebookPage PUT /v1/accounts/{accountId}/facebook-page Update Facebook page
ConnectApi UpdateGmbLocation PUT /v1/accounts/{accountId}/gmb-locations Update GBP location
ConnectApi UpdateLinkedInOrganization PUT /v1/accounts/{accountId}/linkedin-organization Switch LinkedIn account type
ConnectApi UpdatePinterestBoards PUT /v1/accounts/{accountId}/pinterest-boards Set default Pinterest board
ConnectApi UpdateRedditSubreddits PUT /v1/accounts/{accountId}/reddit-subreddits Set default subreddit
GMBAttributesApi GetGoogleBusinessAttributes GET /v1/accounts/{accountId}/gmb-attributes Get attributes
GMBAttributesApi UpdateGoogleBusinessAttributes PUT /v1/accounts/{accountId}/gmb-attributes Update attributes
GMBFoodMenusApi GetGoogleBusinessFoodMenus GET /v1/accounts/{accountId}/gmb-food-menus Get food menus
GMBFoodMenusApi UpdateGoogleBusinessFoodMenus PUT /v1/accounts/{accountId}/gmb-food-menus Update food menus
GMBLocationDetailsApi GetGoogleBusinessLocationDetails GET /v1/accounts/{accountId}/gmb-location-details Get location details
GMBLocationDetailsApi UpdateGoogleBusinessLocationDetails PUT /v1/accounts/{accountId}/gmb-location-details Update location details
GMBMediaApi CreateGoogleBusinessMedia POST /v1/accounts/{accountId}/gmb-media Upload photo
GMBMediaApi DeleteGoogleBusinessMedia DELETE /v1/accounts/{accountId}/gmb-media Delete photo
GMBMediaApi ListGoogleBusinessMedia GET /v1/accounts/{accountId}/gmb-media List media
GMBPlaceActionsApi CreateGoogleBusinessPlaceAction POST /v1/accounts/{accountId}/gmb-place-actions Create action link
GMBPlaceActionsApi DeleteGoogleBusinessPlaceAction DELETE /v1/accounts/{accountId}/gmb-place-actions Delete action link
GMBPlaceActionsApi ListGoogleBusinessPlaceActions GET /v1/accounts/{accountId}/gmb-place-actions List action links
GMBReviewsApi GetGoogleBusinessReviews GET /v1/accounts/{accountId}/gmb-reviews Get reviews
InvitesApi CreateInviteToken POST /v1/invite/tokens Create invite token
LinkedInMentionsApi GetLinkedInMentions GET /v1/accounts/{accountId}/linkedin-mentions Resolve LinkedIn mention
LogsApi GetPostLogs GET /v1/posts/{postId}/logs Get post logs
LogsApi ListConnectionLogs GET /v1/connections/logs List connection logs
LogsApi ListPostsLogs GET /v1/posts/logs List publishing logs
MediaApi GetMediaPresignedUrl POST /v1/media/presign Get presigned upload URL
MessagesApi EditInboxMessage PATCH /v1/inbox/conversations/{conversationId}/messages/{messageId} Edit message
MessagesApi GetInboxConversation GET /v1/inbox/conversations/{conversationId} Get conversation
MessagesApi GetInboxConversationMessages GET /v1/inbox/conversations/{conversationId}/messages List messages
MessagesApi ListInboxConversations GET /v1/inbox/conversations List conversations
MessagesApi SendInboxMessage POST /v1/inbox/conversations/{conversationId}/messages Send message
MessagesApi UpdateInboxConversation PUT /v1/inbox/conversations/{conversationId} Update conversation status
PostsApi BulkUploadPosts POST /v1/posts/bulk-upload Bulk upload from CSV
PostsApi CreatePost POST /v1/posts Create post
PostsApi DeletePost DELETE /v1/posts/{postId} Delete post
PostsApi GetPost GET /v1/posts/{postId} Get post
PostsApi ListPosts GET /v1/posts List posts
PostsApi RetryPost POST /v1/posts/{postId}/retry Retry failed post
PostsApi UnpublishPost POST /v1/posts/{postId}/unpublish Unpublish post
PostsApi UpdatePost PUT /v1/posts/{postId} Update post
ProfilesApi CreateProfile POST /v1/profiles Create profile
ProfilesApi DeleteProfile DELETE /v1/profiles/{profileId} Delete profile
ProfilesApi GetProfile GET /v1/profiles/{profileId} Get profile
ProfilesApi ListProfiles GET /v1/profiles List profiles
ProfilesApi UpdateProfile PUT /v1/profiles/{profileId} Update profile
QueueApi CreateQueueSlot POST /v1/queue/slots Create schedule
QueueApi DeleteQueueSlot DELETE /v1/queue/slots Delete schedule
QueueApi GetNextQueueSlot GET /v1/queue/next-slot Get next available slot
QueueApi ListQueueSlots GET /v1/queue/slots List schedules
QueueApi PreviewQueue GET /v1/queue/preview Preview upcoming slots
QueueApi UpdateQueueSlot PUT /v1/queue/slots Update schedule
RedditSearchApi GetRedditFeed GET /v1/reddit/feed Get subreddit feed
RedditSearchApi SearchReddit GET /v1/reddit/search Search posts
ReviewsApi DeleteInboxReviewReply DELETE /v1/inbox/reviews/{reviewId}/reply Delete review reply
ReviewsApi ListInboxReviews GET /v1/inbox/reviews List reviews
ReviewsApi ReplyToInboxReview POST /v1/inbox/reviews/{reviewId}/reply Reply to review
ToolsApi CheckInstagramHashtags POST /v1/tools/instagram/hashtag-checker Check IG hashtag bans
ToolsApi DownloadBlueskyMedia GET /v1/tools/bluesky/download Download Bluesky media
ToolsApi DownloadFacebookVideo GET /v1/tools/facebook/download Download Facebook video
ToolsApi DownloadInstagramMedia GET /v1/tools/instagram/download Download Instagram media
ToolsApi DownloadLinkedInVideo GET /v1/tools/linkedin/download Download LinkedIn video
ToolsApi DownloadTikTokVideo GET /v1/tools/tiktok/download Download TikTok video
ToolsApi DownloadTwitterMedia GET /v1/tools/twitter/download Download Twitter/X media
ToolsApi DownloadYouTubeVideo GET /v1/tools/youtube/download Download YouTube video
ToolsApi GetYouTubeTranscript GET /v1/tools/youtube/transcript Get YouTube transcript
UsageApi GetUsageStats GET /v1/usage-stats Get plan and usage stats
UsersApi GetUser GET /v1/users/{userId} Get user
UsersApi ListUsers GET /v1/users List users
ValidateApi ValidateMedia POST /v1/tools/validate/media Validate media URL
ValidateApi ValidatePost POST /v1/tools/validate/post Validate post content
ValidateApi ValidatePostLength POST /v1/tools/validate/post-length Validate post character count
ValidateApi ValidateSubreddit GET /v1/tools/validate/subreddit Check subreddit existence
WebhooksApi CreateWebhookSettings POST /v1/webhooks/settings Create webhook
WebhooksApi DeleteWebhookSettings DELETE /v1/webhooks/settings Delete webhook
WebhooksApi GetWebhookLogs GET /v1/webhooks/logs Get delivery logs
WebhooksApi GetWebhookSettings GET /v1/webhooks/settings List webhooks
WebhooksApi TestWebhook POST /v1/webhooks/test Send test webhook
WebhooksApi UpdateWebhookSettings PUT /v1/webhooks/settings Update webhook

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer Authentication

connectToken

  • Type: API key
  • API key parameter name: X-Connect-Token
  • Location: HTTP header

About

Late API - Official .NET SDK

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages