-
-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_connection no longer works: 301-Ressource moved #448
Comments
Same happening here |
I tried to debug also but could not found a way. On website I couldn't find any similiar api that they are using behind the scene when connection request is sent. So, I tried to mimic add_connection method by using _post in same class (Linkedin class) and that is giving {'data': {'status': 422}, 'included': []} as a res.json() output. Here's code: import random
import base64
def generate_trackingId() -> str:
random_int_array = [random.randrange(256) for _ in range(16)]
rand_byte_array = bytearray(random_int_array)
return str(base64.b64encode(rand_byte_array))[2:-1]
trackingId = generate_trackingId()
payload = {
"trackingId": trackingId,
"message": None,
"invitations": [],
"excludeInvitations": [],
"invitee": {
"com.linkedin.voyager.growth.invitation.InviteeProfile": {
"profileId": <SOME URN ID>
}
},
}
api = Linkedin(link_username, link_password, cookies=cookie_jar)
res = api._post(
"/growth/normInvitations",
data=json.dumps(payload),
headers={"accept": "application/vnd.linkedin.normalized+json+2.1"},
)
print(res.json()) Someone, please look into it and find a way through it. |
Sam happening to me; please lets collaborate to solve this issue! |
Hi guys, I have resolved the issue and tested the same. Also I have raised the Pull Request #453 to address this issue. @BirT356 @Alegrossi2001 @dahani9091 @yash-exela Kindly do the needful for merge. |
Since yesterday, endpoint for add connection seems to be still there, but the
"invitee": {"com.linkedin.voyager.growth.invitation.InviteeProfile": {"profileId": <profile_urn_id>}},
seems to throw an error: with the code 301 - Ressource Moved.
Where is actually this endpoint on the browser? I can't find it anywhere. The one in the browser (voyager-relationship endpoint ) always invalidates the client which is really annoying.
Orginal code:
tracking_id = generate_trackingId() payload = { "trackingId": tracking_id, "message": message, "invitations": [], "excludeInvitations": [], "invitee": {"com.linkedin.voyager.growth.invitation.InviteeProfile": {"profileId": profile_urn_id}}, } res = self._post( "/growth/normInvitations", data=json.dumps(payload), headers={"accept": "application/vnd.linkedin.normalized+json+2.1"}, )
The text was updated successfully, but these errors were encountered: