Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/cute-gobbo/twitter-go-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/cute-gobbo/twitter-go-api

  • v1.0.2
  • Source
  • Go
  • Socket score

Version published
Created
Source

Go API client for swagger

Twitter API v2 available endpoints, generated with the api provided by https://api.twitter.com/2/openapi.json

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 2.43
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen For more information, please visit https://developer.twitter.com/

Installation

Put the package under your project folder and add the following in import:

import "./swagger"

Documentation for API Endpoints

All URIs are relative to https://api.twitter.com

ClassMethodHTTP requestDescription
BookmarksApiGetUsersIdBookmarksGet /2/users/{id}/bookmarksBookmarks by User
BookmarksApiPostUsersIdBookmarksPost /2/users/{id}/bookmarksAdd Tweet to Bookmarks
BookmarksApiUsersIdBookmarksDeleteDelete /2/users/{id}/bookmarks/{tweet_id}Remove a bookmarked Tweet
ComplianceApiCreateBatchComplianceJobPost /2/compliance/jobsCreate compliance job
ComplianceApiGetBatchComplianceJobGet /2/compliance/jobs/{id}Get compliance job
ComplianceApiListBatchComplianceJobsGet /2/compliance/jobsList compliance jobs
GeneralApiGetOpenApiSpecGet /2/openapi.jsonReturns the open api spec document.
ListsApiGetUserListMembershipsGet /2/users/{id}/list_membershipsGet a User's List Memberships
ListsApiListAddMemberPost /2/lists/{id}/membersAdd a List member
ListsApiListIdCreatePost /2/listsCreate List
ListsApiListIdDeleteDelete /2/lists/{id}Delete List
ListsApiListIdGetGet /2/lists/{id}List lookup by List ID
ListsApiListIdUpdatePut /2/lists/{id}Update List
ListsApiListRemoveMemberDelete /2/lists/{id}/members/{user_id}Remove a List member
ListsApiListUserFollowPost /2/users/{id}/followed_listsFollow a List
ListsApiListUserOwnedListsGet /2/users/{id}/owned_listsGet a User's Owned Lists
ListsApiListUserPinPost /2/users/{id}/pinned_listsPin a List
ListsApiListUserPinnedListsGet /2/users/{id}/pinned_listsGet a User's Pinned Lists
ListsApiListUserUnfollowDelete /2/users/{id}/followed_lists/{list_id}Unfollow a List
ListsApiListUserUnpinDelete /2/users/{id}/pinned_lists/{list_id}Unpin a List
ListsApiUserFollowedListsGet /2/users/{id}/followed_listsGet User's Followed Lists
SpacesApiFindSpaceByIdGet /2/spaces/{id}Space lookup by Space ID
SpacesApiFindSpacesByCreatorIdsGet /2/spaces/by/creator_idsSpace lookup by their creators
SpacesApiFindSpacesByIdsGet /2/spacesSpace lookup up Space IDs
SpacesApiSearchSpacesGet /2/spaces/searchSearch for Spaces
SpacesApiSpaceBuyersGet /2/spaces/{id}/buyersRetrieve the list of users who purchased a ticket to the given space
SpacesApiSpaceTweetsGet /2/spaces/{id}/tweetsRetrieve tweets from a Space
TweetsApiAddOrDeleteRulesPost /2/tweets/search/stream/rulesAdd/Delete rules
TweetsApiCreateTweetPost /2/tweetsCreation of a Tweet
TweetsApiDeleteTweetByIdDelete /2/tweets/{id}Tweet delete by Tweet ID
TweetsApiFindTweetByIdGet /2/tweets/{id}Tweet lookup by Tweet ID
TweetsApiFindTweetsByIdGet /2/tweetsTweet lookup by Tweet IDs
TweetsApiFindTweetsThatQuoteATweetGet /2/tweets/{id}/quote_tweetsRetrieve tweets that quote a tweet.
TweetsApiGetRulesGet /2/tweets/search/stream/rulesRules lookup
TweetsApiHideReplyByIdPut /2/tweets/{id}/hiddenHide replies
TweetsApiListsIdTweetsGet /2/lists/{id}/tweetsList Tweets timeline by List ID
TweetsApiSampleStreamGet /2/tweets/sample/streamSample stream
TweetsApiSearchStreamGet /2/tweets/search/streamFiltered stream
TweetsApiSpaceBuyersGet /2/spaces/{id}/buyersRetrieve the list of users who purchased a ticket to the given space
TweetsApiSpaceTweetsGet /2/spaces/{id}/tweetsRetrieve tweets from a Space
TweetsApiTweetCountsFullArchiveSearchGet /2/tweets/counts/allFull archive search counts
TweetsApiTweetCountsRecentSearchGet /2/tweets/counts/recentRecent search counts
TweetsApiTweetsFullarchiveSearchGet /2/tweets/search/allFull-archive search
TweetsApiTweetsRecentSearchGet /2/tweets/search/recentRecent search
TweetsApiUsersIdLikePost /2/users/{id}/likesCauses the user (in the path) to like the specified tweet
TweetsApiUsersIdLikedTweetsGet /2/users/{id}/liked_tweetsReturns Tweet objects liked by the provided User ID
TweetsApiUsersIdMentionsGet /2/users/{id}/mentionsUser mention timeline by User ID
TweetsApiUsersIdRetweetsPost /2/users/{id}/retweetsCauses the user (in the path) to retweet the specified tweet
TweetsApiUsersIdTimelineGet /2/users/{id}/timelines/reverse_chronologicalUser home timeline by User ID
TweetsApiUsersIdTweetsGet /2/users/{id}/tweetsUser Tweets timeline by User ID
TweetsApiUsersIdUnlikeDelete /2/users/{id}/likes/{tweet_id}Causes the user (in the path) to unlike the specified tweet
TweetsApiUsersIdUnretweetsDelete /2/users/{id}/retweets/{source_tweet_id}Causes the user (in the path) to unretweet the specified tweet
UsersApiFindMyUserGet /2/users/meUser lookup me
UsersApiFindUserByIdGet /2/users/{id}User lookup by ID
UsersApiFindUserByUsernameGet /2/users/by/username/{username}User lookup by username
UsersApiFindUsersByIdGet /2/usersUser lookup by IDs
UsersApiFindUsersByUsernameGet /2/users/byUser lookup by usernames
UsersApiListGetFollowersGet /2/lists/{id}/followersReturns user objects that follow a List by the provided List ID
UsersApiListGetMembersGet /2/lists/{id}/membersReturns user objects that are members of a List by the provided List ID
UsersApiTweetsIdLikingUsersGet /2/tweets/{id}/liking_usersReturns user objects that have liked the provided Tweet ID
UsersApiTweetsIdRetweetingUsersGet /2/tweets/{id}/retweeted_byReturns user objects that have retweeted the provided Tweet ID
UsersApiUsersIdBlockPost /2/users/{id}/blockingBlock User by User ID
UsersApiUsersIdBlockingGet /2/users/{id}/blockingReturns user objects that are blocked by provided user ID
UsersApiUsersIdFollowPost /2/users/{id}/followingFollow User
UsersApiUsersIdFollowersGet /2/users/{id}/followersReturns user objects that follow the provided user ID
UsersApiUsersIdFollowingGet /2/users/{id}/followingFollowing by User ID
UsersApiUsersIdMutePost /2/users/{id}/mutingMute User by User ID
UsersApiUsersIdMutingGet /2/users/{id}/mutingReturns user objects that are muted by the provided user ID
UsersApiUsersIdUnblockDelete /2/users/{source_user_id}/blocking/{target_user_id}Unblock User by User ID
UsersApiUsersIdUnfollowDelete /2/users/{source_user_id}/following/{target_user_id}Unfollow User
UsersApiUsersIdUnmuteDelete /2/users/{source_user_id}/muting/{target_user_id}Unmute User by User ID

Documentation For Models

Documentation For Authorization

BearerToken

OAuth2UserToken

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://api.twitter.com/2/oauth2/authorize
  • Scopes:
  • tweet.read: Allows the app to view any Tweets the authenticated user can see, including Tweets from protected accounts.
  • tweet.write: Allows the app to tweet and retweet for the authenticated user.
  • users.read: Allows the app to view any account the authenticated user can see, including protected accounts.
  • list.write: Allows the app to create and manage lists for the authenticated user.
  • list.read: Allows the app to view any lists the authenticated user has created and lists they are a member of, including private lists.
  • like.read: Allows the app to read Tweets that the authenticated user has liked.
  • like.write: Allows the app to like and un-likes Tweets for the authenticated user.
  • mute.read: Allows the app to read the users the authenticated user has muted.
  • mute.write: Allows the app to mute and unmute users for the authenticated user.
  • block.read: Allows the app to read the users the authenticated user has blocked.
  • block.write: Allows the app to block and unblock users for the authenticated user.
  • tweet.moderate.write: Allows the app to hide and unhide replies to the authenticated user's Tweets.
  • follows.read: Allows the app to read the users who follow the authenticated user and users that they follow.
  • follows.write: Allows the app to follow and unfollow users for the authenticated user.
  • space.read: Allows the app to read the Spaces the authenticated user can see.
  • offline.access: Allows the app to request a refresh token.
  • bookmark.read: Allows the app to read bookmarked Tweets
  • bookmark.write: Allows the app to add/remove Tweets to/from bookmarks

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

UserToken

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
	UserName: "username",
	Password: "password",
})
r, err := client.Service.Operation(auth, args)

Author

FAQs

Package last updated on 05 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc