Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Base URL for LinkedIn's OAuth authentication endpoint. AuthenticationBaseURL = "https://www.linkedin.com/oauth/v2/authorization?" // Base URL for requesting the access token after obtaining the authorization code. AccessTokenBaseURL = "https://www.linkedin.com/uas/oauth2/accessToken?grant_type=authorization_code" )
var (
PostURL = "https://api.linkedin.com/v2/ugcPosts?oauth2_access_token="
)
var (
ProfileURL = "https://api.linkedin.com/v2/me"
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // The response type, set to 'code' by default, which is the standard for authorization flows. ResponseType string // Your LinkedIn app's ClientID, which is obtained after creating a LinkedIn app. ClientID string // Your LinkedIn app's ClientSecret, obtained after creating the LinkedIn app. ClientSecret string // The callback URL you define when setting up your LinkedIn app. It will be used for redirecting users. RedirectURI string // The requested permissions (scopes). Set to 'r_liteprofile', 'r_emailaddress', 'w_member_social', and 'w_share' by default. Scopes []string }
type JobPosting ¶
type JobPosting struct { IntegrationContext string `json:"integrationContext"` CompanyApplyUrl string `json:"companyApplyUrl"` Description string `json:"description"` EmploymentStatus string `json:"employmentStatus"` ExternalJobPostingId string `json:"externalJobPostingId"` ListedAt int `json:"listedAt"` JobPostingOperationType string `json:"jobPostingOperationType"` Title string `json:"title"` Location string `json:"location"` WorkplaceTypes []string `json:"workplaceTypes"` }
type JobValue ¶
type JobValue struct {
JobPosting []JobPosting `json:"elements"`
}
type Linkedin ¶
type Linkedin struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new LinkedIn API client with the given configuration. This requires the Client ID, Redirect URL, and Client Secret, which can be found on the LinkedIn Developer portal. Optionally, permissions (scopes) can be provided. If no config is provided, an error is returned.
func (*Linkedin) GetAuthenticationUrl ¶
GetAuthenticationUrl returns the LinkedIn authorization URL, allowing the client to authenticate users and receive an authorization code.
func (*Linkedin) Profile ¶
func (ln *Linkedin) Profile(token string) (*ProfileInformation, error)
After than Callback, you take Profile information with this function. Create route for this.
func (*Linkedin) RetrieveAccessToken ¶
RetrieveAccessToken exchanges the authorization code for an access token by making an HTTP request to LinkedIn's OAuth API. The access token is required for accessing LinkedIn's API.
type Post ¶
type Post struct { // Author URN for this content Author string `json:"author"` // The state of this content. PUBLISHED is the only accepted field during creation. LifeCycleState string `json:"lifecycleState"` // The content of post. For now you can just define text. SpecificContent SpecificContent `json:"specificContent"` // Visibility restrictions on content. Visibility Visibility `json:"visibility"` }
type ProfileInformation ¶
type ShareCommentary ¶
type ShareCommentary struct {
}type ShareContent ¶
type ShareContent struct {}
type SpecificContent ¶
type SpecificContent struct {
}type Visibility ¶
type Visibility struct {
Code string `json:"com.linkedin.ugc.MemberNetworkVisibility"`
}