Documentation ¶
Index ¶
Constants ¶
const EndpointEmailAddress = "https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))"
EndpointEmailAddress is the endpoint for email address api.
const EndpointPrimaryContact = "https://api.linkedin.com/v2/clientAwareMemberHandles?q=members&projection=(elements*(primary,type,handle~))"
EndpointPrimaryContact is the endpoint for primary contact api.
const EndpointProfile = "" /* 206-byte string literal not displayed */
EndpointProfile is the endpoint for profile api.
Variables ¶
var EndpointPeopleListParts = []string{"https://api.linkedin.com/rest/people?ids=List(", ")"}
EndpointPeopleListParts are the parts to build the endpoint for people list api.
var EndpointPeopleParts = []string{"https://api.linkedin.com/rest/people/(id:", ")"}
EndpointPeopleParts are the parts to build the endpoint for people api.
Functions ¶
This section is empty.
Types ¶
type BuilderInterface ¶ added in v1.3.0
type BuilderInterface interface { GetAuthURL(state string) string GetClient(ctx context.Context, code string) (ClientInterface, error) }
builderInterface is the interface that wraps the basic GetAuthURL and GetClient methods.
func NewBuilder ¶
func NewBuilder(clientID string, clientSecret string, scopes []string, redirectURL string) BuilderInterface
Newbuilder returns a new linkedin client, not yet authenticated.
type ClientInterface ¶ added in v1.3.0
type ClientInterface interface { Headers() map[string]string SetHeader(key string, value string) UnsetHeader(key string) Get(url string) (resp *http.Response, err error) PrimaryContactRequest() (resp *http.Response, err error) GetPrimaryContact() (r PrimaryContact, err error) GetEmailAddress() (r EmailAddress, err error) EmailAddressRequest() (resp *http.Response, err error) PeopleRequest(personID string) (resp *http.Response, err error) GetPeople(personID string) (r string, err error) PeopleListRequest(personIDs []string) (resp *http.Response, err error) GetPeopleList(personIDs []string) (r string, err error) ProfileRequest() (resp *http.Response, err error) GetProfile() (r Profile, err error) }
type EmailAddress ¶
type EmailAddress struct { ErrorResponse Elements []struct { Handle string `json:"handle"` HandleTilde struct { EmailAddress string `json:"emailAddress"` } `json:"handle~"` } `json:"elements"` }
EmailAddress is the response from email address api.
type ErrorResponse ¶
type ErrorResponse struct { ServiceErrorCode int `json:"serviceErrorCode"` Message string `json:"message"` Status int `json:"status"` }
Common struct for error response in linkedin API
type PrimaryContact ¶
type PrimaryContact struct { ErrorResponse Elements []struct { Handle string `json:"handle"` HandleTilde struct { EmailAddress string `json:"emailAddress"` PhoneNumber struct { Number string `json:"number"` } `json:"phoneNumber"` } `json:"handle~"` Primary bool `json:"primary"` Type string `json:"type"` } `json:"elements"` }
PrimaryContact is the response from primary contact api.
type Profile ¶
type Profile struct { ErrorResponse ID string `json:"id"` LocalizedFirstName string `json:"localizedFirstName"` LocalizedLastName string `json:"localizedLastName"` FirstName struct { Localized struct { EnUS string `json:"en_US"` } `json:"localized"` PreferredLocale struct { Country string `json:"country"` Language string `json:"language"` } `json:"preferredLocale"` } `json:"firstName"` LastName struct { Localized struct { EnUS string `json:"en_US"` } `json:"localized"` PreferredLocale struct { Country string `json:"country"` Language string `json:"language"` } `json:"preferredLocale"` } `json:"lastName"` ProfilePicture struct { DisplayImage string `json:"displayImage"` DisplayImageFull struct { Paging struct { Count int `json:"count"` Start int `json:"start"` Links []any `json:"links"` } `json:"paging"` Elements []struct { Artifact string `json:"artifact"` AuthorizationMethod string `json:"authorizationMethod"` Data struct { ComLinkedinDigitalmediaMediaartifactStillImage struct { MediaType string `json:"mediaType"` RawCodecSpec struct { Name string `json:"name"` Type string `json:"type"` } `json:"rawCodecSpec"` DisplaySize struct { Width float64 `json:"width"` Uom string `json:"uom"` Height float64 `json:"height"` } `json:"displaySize"` StorageSize struct { Width int `json:"width"` Height int `json:"height"` } `json:"storageSize"` StorageAspectRatio struct { WidthAspect float64 `json:"widthAspect"` HeightAspect float64 `json:"heightAspect"` Formatted string `json:"formatted"` } `json:"storageAspectRatio"` DisplayAspectRatio struct { WidthAspect float64 `json:"widthAspect"` HeightAspect float64 `json:"heightAspect"` Formatted string `json:"formatted"` } `json:"displayAspectRatio"` } `json:"com.linkedin.digitalmedia.mediaartifact.StillImage"` } `json:"data"` Identifiers []struct { Identifier string `json:"identifier"` Index int `json:"index"` MediaType string `json:"mediaType"` File string `json:"file"` IdentifierType string `json:"identifierType"` IdentifierExpiresInSeconds int `json:"identifierExpiresInSeconds"` } `json:"identifiers"` } `json:"elements"` } `json:"displayImage~"` } `json:"profilePicture"` Headline struct { Localized struct { EnUS string `json:"en_US"` } `json:"localized"` PreferredLocale struct { Country string `json:"country"` Language string `json:"language"` } `json:"preferredLocale"` } `json:"headline"` LocalizedHeadline string `json:"localizedHeadline"` VanityName string `json:"vanityName"` }
Profile is the response from profile api.