Skip to content

Commit 290328e

Browse files
Add LinkedIn Messages API docs (main) (#52)
* Add LinkedIn Messages API docs Co-Authored-By: Adil <adil@lix-it.com> * Update LinkedIn Messages docs and add Conversations docs for main branch Co-Authored-By: Adil <adil@lix-it.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Adil <adil@lix-it.com>
1 parent 75fdd30 commit 290328e

3 files changed

Lines changed: 230 additions & 0 deletions

File tree

source/includes/_conversations.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# LinkedIn Conversations API
2+
3+
Retrieve the list of LinkedIn conversations for a viewer account. `viewer_id` is required.
4+
5+
<aside class="notice">Uses 1 Standard Credit.</aside>
6+
7+
### HTTP Request
8+
9+
`GET https://api.lix-it.com/v1/li/conversations`
10+
11+
### URL Parameters
12+
13+
#### Required Parameters
14+
15+
Parameter | Description
16+
--------- | -----------
17+
viewer_id | The Lix viewer id of the account you would like to fetch conversations for.
18+
19+
#### Optional Parameters
20+
21+
Parameter | Default | Description
22+
--------- | ------- | -----------
23+
sequence_id | | A Lix sequence id returned from a previous request. Pass it back to load the next page of conversations.
24+
count | 20 | Maximum number of conversations to return per page.
25+
26+
```shell
27+
curl "https://api.lix-it.com/v1/li/conversations?viewer_id=YOUR_VIEWER_ID" \
28+
-H "Authorization: lixApiKey"
29+
```
30+
31+
```python
32+
import requests
33+
34+
url = "https://api.lix-it.com/v1/li/conversations?viewer_id=YOUR_VIEWER_ID"
35+
36+
headers = {
37+
'Authorization': 'lixApiKey'
38+
}
39+
40+
response = requests.request("GET", url, headers=headers)
41+
print(response.json())
42+
```
43+
44+
> The above command returns JSON structured like this:
45+
46+
```json
47+
{
48+
"conversations": [
49+
{
50+
"backendUrn": "urn:li:messagingThread:2-...",
51+
"conversationUrn": "urn:li:msg_conversation:(...)",
52+
"title": "Jane Doe",
53+
"createdAt": "1784478668446",
54+
"lastActivityAt": "1784478668446",
55+
"unreadCount": 0,
56+
"read": true,
57+
"groupChat": false,
58+
"conversationUrl": "https://www.linkedin.com/messaging/thread/YOUR_CONVERSATION_ID/",
59+
"participants": [
60+
{
61+
"hostIdentityUrn": "urn:li:fsd_profile:YOUR_VIEWER_ID",
62+
"firstName": "Jane",
63+
"lastName": "Doe",
64+
"headline": "CEO at Example",
65+
"profileUrl": "https://www.linkedin.com/in/YOUR_PUBLIC_ID",
66+
"publicIdentifier": "your-public-id",
67+
"profilePictureUrl": "https://media.licdn.com/dms/image/..."
68+
}
69+
],
70+
"lastMessage": {
71+
"backendUrn": "urn:li:messagingMessage:2-...",
72+
"conversationUrn": "urn:li:msg_conversation:(...)",
73+
"deliveredAt": "1784478668446",
74+
"bodyText": "Hey, we launched a new version of our product...",
75+
"originToken": "f7f4fe26-31b1-483b-b82d-a7f0533a4a56",
76+
"senderHostIdentityUrn": "urn:li:fsd_profile:YOUR_VIEWER_ID",
77+
"senderFirstName": "Jane",
78+
"senderLastName": "Doe"
79+
}
80+
}
81+
],
82+
"sequenceId": "YOUR_SEQUENCE_ID"
83+
}
84+
```

source/includes/_messages.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# LinkedIn Messages API
2+
3+
Retrieve and send LinkedIn messages for a given conversation.
4+
5+
## Get Messages
6+
7+
Retrieve the messages in a LinkedIn conversation. `viewer_id` is required.
8+
9+
<aside class="notice">Uses 1 Standard Credit.</aside>
10+
11+
### HTTP Request
12+
13+
`GET https://api.lix-it.com/v1/li/messages`
14+
15+
### URL Parameters
16+
17+
#### Required Parameters
18+
19+
Parameter | Description
20+
--------- | -----------
21+
viewer_id | The Lix viewer id of the account you would like to view this conversation as.
22+
conversation_id **or** conversation_urn | The Lix conversation id or the full LinkedIn conversation URN. You must provide exactly one of these two parameters.
23+
24+
#### Optional Parameters
25+
26+
Parameter | Default | Description
27+
--------- | ------- | -----------
28+
sequence_id | | A Lix sequence id returned from a previous request. Pass it back to load the next page of messages.
29+
delivered_at | | A timestamp anchor for pagination around a specific message.
30+
count_before | 0 | Number of messages to load before the anchor.
31+
count_after | 0 | Number of messages to load after the anchor.
32+
33+
```shell
34+
curl "https://api.lix-it.com/v1/li/messages?viewer_id=YOUR_VIEWER_ID&conversation_id=YOUR_CONVERSATION_ID" \
35+
-H "Authorization: lixApiKey"
36+
```
37+
38+
```python
39+
import requests
40+
41+
url = "https://api.lix-it.com/v1/li/messages?viewer_id=YOUR_VIEWER_ID&conversation_id=YOUR_CONVERSATION_ID"
42+
43+
headers = {
44+
'Authorization': 'lixApiKey'
45+
}
46+
47+
response = requests.request("GET", url, headers=headers)
48+
print(response.json())
49+
```
50+
51+
> The above command returns JSON structured like this:
52+
53+
```json
54+
{
55+
"messages": [
56+
{
57+
"backendUrn": "urn:li:messagingMessage:2-...",
58+
"conversationUrn": "urn:li:msg_conversation:(...)",
59+
"backendConversationUrn": "urn:li:messagingThread:...",
60+
"deliveredAt": "1784478668446",
61+
"bodyText": "Hey, we launched a new version of our product...",
62+
"originToken": "f7f4fe26-31b1-483b-b82d-a7f0533a4a56",
63+
"senderHostIdentityUrn": "urn:li:fsd_profile:YOUR_VIEWER_ID",
64+
"senderFirstName": "Jane",
65+
"senderLastName": "Doe",
66+
"senderHeadline": "CEO at Example",
67+
"senderProfileUrl": "https://www.linkedin.com/in/YOUR_PUBLIC_ID",
68+
"senderPublicIdentifier": "your-public-id",
69+
"senderProfilePictureUrl": "https://media.licdn.com/dms/image/..."
70+
}
71+
],
72+
"sequenceId": "YOUR_SEQUENCE_ID"
73+
}
74+
```
75+
76+
## Send Message
77+
78+
Send a message to an existing LinkedIn conversation. `viewer_id` is required.
79+
80+
<aside class="notice">Uses 1 Standard Credit.</aside>
81+
82+
### HTTP Request
83+
84+
`POST https://api.lix-it.com/v1/li/messages`
85+
86+
### URL Parameters
87+
88+
#### Required Parameters
89+
90+
Parameter | Description
91+
--------- | -----------
92+
viewer_id | The Lix viewer id of the account you would like to send the message as.
93+
94+
### Body Parameters
95+
96+
Parameter | Description
97+
--------- | -----------
98+
conversation_id **or** conversation_urn | The Lix conversation id or the full LinkedIn conversation URN. You must provide exactly one of these two parameters.
99+
body | The message text to send. Maximum 8,000 characters.
100+
101+
```shell
102+
curl -X POST "https://api.lix-it.com/v1/li/messages?viewer_id=YOUR_VIEWER_ID" \
103+
-H "Authorization: lixApiKey" \
104+
-H "Content-Type: application/json" \
105+
-d '{
106+
"conversation_id": "YOUR_CONVERSATION_ID",
107+
"body": "Hey, we launched a new version of our product."
108+
}'
109+
```
110+
111+
```python
112+
import requests
113+
114+
url = "https://api.lix-it.com/v1/li/messages?viewer_id=YOUR_VIEWER_ID"
115+
116+
payload = {
117+
"conversation_id": "YOUR_CONVERSATION_ID",
118+
"body": "Hey, we launched a new version of our product."
119+
}
120+
121+
headers = {
122+
'Authorization': 'lixApiKey',
123+
'Content-Type': 'application/json'
124+
}
125+
126+
response = requests.request("POST", url, headers=headers, json=payload)
127+
print(response.json())
128+
```
129+
130+
> The above command returns JSON structured like this:
131+
132+
```json
133+
{
134+
"message": {
135+
"backendUrn": "urn:li:messagingMessage:2-...",
136+
"conversationUrn": "urn:li:msg_conversation:(...)",
137+
"backendConversationUrn": "urn:li:messagingThread:...",
138+
"deliveredAt": "1784478668446",
139+
"bodyText": "Hey, we launched a new version of our product.",
140+
"originToken": "f7f4fe26-31b1-483b-b82d-a7f0533a4a56",
141+
"senderHostIdentityUrn": "urn:li:fsd_profile:YOUR_VIEWER_ID"
142+
}
143+
}
144+
```

source/index.html.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ includes:
2020
- enrichment
2121
- activity
2222
- linkedin
23+
- conversations
24+
- messages
2325
- lookc
2426
- ai
2527
- contact

0 commit comments

Comments
 (0)