Skip to content

Commit 36ee719

Browse files
Recruiter actions
1 parent 9065e5d commit 36ee719

27 files changed

Lines changed: 1080 additions & 13 deletions

‎linkedapi/__init__.py‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@
7474
NvSyncInbox,
7575
NvUnsaveAccount,
7676
NvUnsaveLead,
77+
RcArchiveProject,
78+
RcCreateProject,
79+
RcFetchPerson,
80+
RcFetchPersonMapper,
81+
RcRenameProject,
82+
RcRetrieveProjectCandidates,
83+
RcRetrieveProjects,
84+
RcSaveToProject,
85+
RcSearchPeople,
86+
RcSendMessage,
87+
RcSyncInbox,
7788
ReactToComment,
7889
ReactToPost,
7990
RemoveConnection,
@@ -105,7 +116,7 @@
105116
verify_webhook_signature,
106117
)
107118

108-
__version__ = "1.4.11"
119+
__version__ = "1.5.0"
109120
PredefinedOperation = Operation
110121

111122
__all__ = [
@@ -176,6 +187,17 @@
176187
"NvSyncInbox",
177188
"Operation",
178189
"PredefinedOperation",
190+
"RcArchiveProject",
191+
"RcCreateProject",
192+
"RcFetchPerson",
193+
"RcFetchPersonMapper",
194+
"RcRenameProject",
195+
"RcRetrieveProjectCandidates",
196+
"RcRetrieveProjects",
197+
"RcSaveToProject",
198+
"RcSearchPeople",
199+
"RcSendMessage",
200+
"RcSyncInbox",
179201
"ReactToComment",
180202
"ReactToPost",
181203
"RemoveConnection",

‎linkedapi/client.py‎

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@
4646
NvSyncInbox,
4747
NvUnsaveAccount,
4848
NvUnsaveLead,
49+
RcArchiveProject,
50+
RcCreateProject,
51+
RcFetchPerson,
52+
RcRenameProject,
53+
RcRetrieveProjectCandidates,
54+
RcRetrieveProjects,
55+
RcSaveToProject,
56+
RcSearchPeople,
57+
RcSendMessage,
58+
RcSyncInbox,
4959
ReactToComment,
5060
ReactToPost,
5161
RemoveConnection,
@@ -151,6 +161,17 @@ def __init__(self, config: LinkedApiConfig | HttpClient[Any]) -> None:
151161
self.nv_fetch_company = NvFetchCompany(self.http_client)
152162
self.nv_fetch_person = NvFetchPerson(self.http_client)
153163

164+
self.rc_archive_project = RcArchiveProject(self.http_client)
165+
self.rc_create_project = RcCreateProject(self.http_client)
166+
self.rc_fetch_person = RcFetchPerson(self.http_client)
167+
self.rc_rename_project = RcRenameProject(self.http_client)
168+
self.rc_retrieve_project_candidates = RcRetrieveProjectCandidates(self.http_client)
169+
self.rc_retrieve_projects = RcRetrieveProjects(self.http_client)
170+
self.rc_save_to_project = RcSaveToProject(self.http_client)
171+
self.rc_search_people = RcSearchPeople(self.http_client)
172+
self.rc_send_message = RcSendMessage(self.http_client)
173+
self.rc_sync_inbox = RcSyncInbox(self.http_client)
174+
154175
self.operations = [
155176
self.custom_workflow,
156177
self.send_message,
@@ -211,6 +232,16 @@ def __init__(self, config: LinkedApiConfig | HttpClient[Any]) -> None:
211232
self.nv_search_people,
212233
self.nv_fetch_company,
213234
self.nv_fetch_person,
235+
self.rc_archive_project,
236+
self.rc_create_project,
237+
self.rc_fetch_person,
238+
self.rc_rename_project,
239+
self.rc_retrieve_project_candidates,
240+
self.rc_retrieve_projects,
241+
self.rc_save_to_project,
242+
self.rc_search_people,
243+
self.rc_send_message,
244+
self.rc_sync_inbox,
214245
]
215246

216247
def poll_conversations(
@@ -264,13 +295,14 @@ def poll_inbox(
264295
self,
265296
request: InboxPollRequest | None = None,
266297
) -> MappedResponse[list[InboxMessage]] | MappedResponse[InboxPersonPollResult]:
267-
"""Read the monitored standard or Sales Navigator inbox, newest messages first.
298+
"""Read the monitored standard, Sales Navigator or Recruiter Lite inbox, newest first.
268299
269300
Without ``person_url`` the data is the list of inbox messages across every conversation.
270301
With ``person_url`` (use ``InboxPersonPollRequest``) the data is the whole known
271302
conversation with that person: the messages the inbox captured together with the history
272303
loaded by ``sync_conversation`` / ``nv_sync_conversation``, each message once, plus
273304
``threads`` with ``history_from`` and ``history_complete``.
305+
person_url also accepts a Recruiter profile URL (https://www.linkedin.com/talent/profile/...).
274306
"""
275307

276308
payload = serialize_value(request) if request is not None else {}

‎linkedapi/errors.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@
5353
"mentionNotResolved",
5454
"repostNotAllowed",
5555
"alreadyReposted",
56+
"recruiterSignInRequired",
57+
"recruiterTwoStepVerificationRequired",
58+
"recruiterMultipleSessionsDetected",
59+
"inMailCreditRequired",
60+
"inMailNotAvailable",
61+
"projectNotFound",
5662
"noSalesNavigator",
5763
"salesNavigatorOnboardingRequired",
5864
"conversationsNotSynced",
@@ -111,6 +117,12 @@
111117
"mentionNotResolved",
112118
"repostNotAllowed",
113119
"alreadyReposted",
120+
"recruiterSignInRequired",
121+
"recruiterTwoStepVerificationRequired",
122+
"recruiterMultipleSessionsDetected",
123+
"inMailCreditRequired",
124+
"inMailNotAvailable",
125+
"projectNotFound",
114126
"noSalesNavigator",
115127
"salesNavigatorOnboardingRequired",
116128
"conversationsNotSynced",

‎linkedapi/operations/__init__.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@
3636
from linkedapi.operations.nv_sync_inbox import NvSyncInbox
3737
from linkedapi.operations.nv_unsave_account import NvUnsaveAccount
3838
from linkedapi.operations.nv_unsave_lead import NvUnsaveLead
39+
from linkedapi.operations.rc_archive_project import RcArchiveProject
40+
from linkedapi.operations.rc_create_project import RcCreateProject
41+
from linkedapi.operations.rc_fetch_person import RcFetchPerson, RcFetchPersonMapper
42+
from linkedapi.operations.rc_rename_project import RcRenameProject
43+
from linkedapi.operations.rc_retrieve_project_candidates import RcRetrieveProjectCandidates
44+
from linkedapi.operations.rc_retrieve_projects import RcRetrieveProjects
45+
from linkedapi.operations.rc_save_to_project import RcSaveToProject
46+
from linkedapi.operations.rc_search_people import RcSearchPeople
47+
from linkedapi.operations.rc_send_message import RcSendMessage
48+
from linkedapi.operations.rc_sync_inbox import RcSyncInbox
3949
from linkedapi.operations.react_to_comment import ReactToComment
4050
from linkedapi.operations.react_to_post import ReactToPost
4151
from linkedapi.operations.remove_connection import RemoveConnection
@@ -103,6 +113,17 @@
103113
"NvSyncInbox",
104114
"NvUnsaveAccount",
105115
"NvUnsaveLead",
116+
"RcArchiveProject",
117+
"RcCreateProject",
118+
"RcFetchPerson",
119+
"RcFetchPersonMapper",
120+
"RcRenameProject",
121+
"RcRetrieveProjectCandidates",
122+
"RcRetrieveProjects",
123+
"RcSaveToProject",
124+
"RcSearchPeople",
125+
"RcSendMessage",
126+
"RcSyncInbox",
106127
"ReactToComment",
107128
"ReactToPost",
108129
"RemoveConnection",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from __future__ import annotations
2+
3+
from linkedapi.core import Operation
4+
from linkedapi.mappers import SimpleWorkflowMapper
5+
from linkedapi.types import RcArchiveProjectParams, RcArchiveProjectResult
6+
7+
8+
class RcArchiveProject(Operation[RcArchiveProjectParams, RcArchiveProjectResult]):
9+
"""Archive a Recruiter Lite project.
10+
11+
Requires a Recruiter Lite seat and the Plus plan (plusPlanRequired otherwise).
12+
13+
Action errors: projectNotFound, recruiterSignInRequired,
14+
recruiterTwoStepVerificationRequired, recruiterMultipleSessionsDetected, unexpectedError.
15+
See https://linkedapi.io/docs/action-rc-archive-project/
16+
and https://linkedapi.io/docs/recruiter-lite-overview/
17+
"""
18+
19+
operation_name = "rcArchiveProject"
20+
mapper = SimpleWorkflowMapper[RcArchiveProjectParams, RcArchiveProjectResult](
21+
"rc.archiveProject", result_model=RcArchiveProjectResult
22+
)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from __future__ import annotations
2+
3+
from linkedapi.core import Operation
4+
from linkedapi.mappers import SimpleWorkflowMapper
5+
from linkedapi.types import RcCreatedProject, RcCreateProjectParams
6+
7+
8+
class RcCreateProject(Operation[RcCreateProjectParams, RcCreatedProject]):
9+
"""Create a private Recruiter Lite project by name.
10+
11+
Requires a Recruiter Lite seat and the Plus plan (plusPlanRequired otherwise).
12+
After a failure, check existing projects before creating again: creation may have succeeded.
13+
14+
Action errors: recruiterSignInRequired,
15+
recruiterTwoStepVerificationRequired, recruiterMultipleSessionsDetected, unexpectedError.
16+
See https://linkedapi.io/docs/action-rc-create-project/
17+
and https://linkedapi.io/docs/recruiter-lite-overview/
18+
"""
19+
20+
operation_name = "rcCreateProject"
21+
mapper = SimpleWorkflowMapper[RcCreateProjectParams, RcCreatedProject](
22+
"rc.createProject", result_model=RcCreatedProject
23+
)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from __future__ import annotations
2+
3+
from linkedapi.core import Operation
4+
from linkedapi.mappers import ThenWorkflowMapper
5+
from linkedapi.types import RcOpenPersonPageParams, RcOpenPersonPageResult
6+
7+
8+
class RcFetchPersonMapper(ThenWorkflowMapper[RcOpenPersonPageParams, RcOpenPersonPageResult]):
9+
def __init__(self) -> None:
10+
super().__init__(
11+
action_configs=[],
12+
response_mappings=[],
13+
base_action_type="rc.openPersonPage",
14+
default_params={"basicInfo": True},
15+
result_model=RcOpenPersonPageResult,
16+
)
17+
18+
19+
class RcFetchPerson(Operation[RcOpenPersonPageParams, RcOpenPersonPageResult]):
20+
"""Fetch a Recruiter Lite profile, optionally including recruiting activity.
21+
22+
Requires a Recruiter Lite seat and the Plus plan (plusPlanRequired otherwise).
23+
basic_info defaults to True; recruiting_activity requests the seat's activity counts.
24+
person_url must be a Recruiter profile URL (https://www.linkedin.com/talent/profile/...).
25+
26+
Action errors: personNotFound, limitExceeded, recruiterSignInRequired,
27+
recruiterTwoStepVerificationRequired, recruiterMultipleSessionsDetected, unexpectedError.
28+
See https://linkedapi.io/docs/action-rc-open-person-page/
29+
and https://linkedapi.io/docs/recruiter-lite-overview/
30+
"""
31+
32+
operation_name = "rcFetchPerson"
33+
mapper = RcFetchPersonMapper()
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from __future__ import annotations
2+
3+
from linkedapi.core import Operation
4+
from linkedapi.mappers import VoidWorkflowMapper
5+
from linkedapi.types import RcRenameProjectParams
6+
7+
8+
class RcRenameProject(Operation[RcRenameProjectParams, None]):
9+
"""Rename a Recruiter Lite project and optionally update its description.
10+
11+
Requires a Recruiter Lite seat and the Plus plan (plusPlanRequired otherwise).
12+
13+
Action errors: projectNotFound, recruiterSignInRequired,
14+
recruiterTwoStepVerificationRequired, recruiterMultipleSessionsDetected, unexpectedError.
15+
See https://linkedapi.io/docs/action-rc-rename-project/
16+
and https://linkedapi.io/docs/recruiter-lite-overview/
17+
"""
18+
19+
operation_name = "rcRenameProject"
20+
mapper = VoidWorkflowMapper[RcRenameProjectParams]("rc.renameProject")
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from __future__ import annotations
2+
3+
from linkedapi.core import Operation
4+
from linkedapi.mappers import ArrayWorkflowMapper
5+
from linkedapi.types import RcProjectCandidate, RcRetrieveProjectCandidatesParams
6+
7+
8+
class RcRetrieveProjectCandidates(
9+
Operation[RcRetrieveProjectCandidatesParams, list[RcProjectCandidate]]
10+
):
11+
"""Retrieve candidates from a Recruiter Lite project.
12+
13+
Requires a Recruiter Lite seat and the Plus plan (plusPlanRequired otherwise).
14+
15+
Action errors: projectNotFound, recruiterSignInRequired,
16+
recruiterTwoStepVerificationRequired, recruiterMultipleSessionsDetected, unexpectedError.
17+
See https://linkedapi.io/docs/action-rc-retrieve-project-candidates/
18+
and https://linkedapi.io/docs/recruiter-lite-overview/
19+
"""
20+
21+
operation_name = "rcRetrieveProjectCandidates"
22+
mapper = ArrayWorkflowMapper[RcRetrieveProjectCandidatesParams, RcProjectCandidate](
23+
"rc.retrieveProjectCandidates", RcProjectCandidate
24+
)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from __future__ import annotations
2+
3+
from linkedapi.core import Operation
4+
from linkedapi.mappers import ArrayWorkflowMapper
5+
from linkedapi.types import RcProject, RcRetrieveProjectsParams
6+
7+
8+
class RcRetrieveProjects(Operation[RcRetrieveProjectsParams, list[RcProject]]):
9+
"""Retrieve Recruiter Lite projects.
10+
11+
Requires a Recruiter Lite seat and the Plus plan (plusPlanRequired otherwise).
12+
13+
Action errors: recruiterSignInRequired,
14+
recruiterTwoStepVerificationRequired, recruiterMultipleSessionsDetected, unexpectedError.
15+
See https://linkedapi.io/docs/action-rc-retrieve-projects/
16+
and https://linkedapi.io/docs/recruiter-lite-overview/
17+
"""
18+
19+
operation_name = "rcRetrieveProjects"
20+
mapper = ArrayWorkflowMapper[RcRetrieveProjectsParams, RcProject](
21+
"rc.retrieveProjects", RcProject
22+
)

0 commit comments

Comments
 (0)