Start Chat
curl --request POST \
--url https://api.aisa.one/apis/v1/unipile/linkedin/chats/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "<string>",
"attendees_ids": [
"<string>"
],
"text": "<string>"
}
'import requests
url = "https://api.aisa.one/apis/v1/unipile/linkedin/chats/send"
payload = {
"account_id": "<string>",
"attendees_ids": ["<string>"],
"text": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '<string>', attendees_ids: ['<string>'], text: '<string>'})
};
fetch('https://api.aisa.one/apis/v1/unipile/linkedin/chats/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/unipile/linkedin/chats/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_id' => '<string>',
'attendees_ids' => [
'<string>'
],
'text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/unipile/linkedin/chats/send"
payload := strings.NewReader("{\n \"account_id\": \"<string>\",\n \"attendees_ids\": [\n \"<string>\"\n ],\n \"text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/unipile/linkedin/chats/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"<string>\",\n \"attendees_ids\": [\n \"<string>\"\n ],\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/unipile/linkedin/chats/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"<string>\",\n \"attendees_ids\": [\n \"<string>\"\n ],\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "MessageSent"
}Messaging
发起会话
发起新会话并发送首条消息。
POST
https://api.aisa.one
/
apis
/
v1
/
unipile
/
linkedin
/
chats
/
send
Start Chat
curl --request POST \
--url https://api.aisa.one/apis/v1/unipile/linkedin/chats/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "<string>",
"attendees_ids": [
"<string>"
],
"text": "<string>"
}
'import requests
url = "https://api.aisa.one/apis/v1/unipile/linkedin/chats/send"
payload = {
"account_id": "<string>",
"attendees_ids": ["<string>"],
"text": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '<string>', attendees_ids: ['<string>'], text: '<string>'})
};
fetch('https://api.aisa.one/apis/v1/unipile/linkedin/chats/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/unipile/linkedin/chats/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_id' => '<string>',
'attendees_ids' => [
'<string>'
],
'text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/unipile/linkedin/chats/send"
payload := strings.NewReader("{\n \"account_id\": \"<string>\",\n \"attendees_ids\": [\n \"<string>\"\n ],\n \"text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/unipile/linkedin/chats/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"<string>\",\n \"attendees_ids\": [\n \"<string>\"\n ],\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/unipile/linkedin/chats/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"<string>\",\n \"attendees_ids\": [\n \"<string>\"\n ],\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "MessageSent"
}一次调用创建新会话并发出首条消息。LinkedIn 规则:收件人必须已是一度人脉——先用「人脉列表」端点列出已有连接并使用其中的 provider id。给非人脉在此端点发消息会收到 403
subscription_required(LinkedIn 只允许与一度人脉开新会话,InMail 除外),账号自己的资料也不是有效收件人。要触达尚未连接的人,请用「发送建联邀请」端点——它不受此限制;对方接受后再回来发消息。写操作:与「发送消息」相同的每日限额。收件人传 provider id(ACoAA…),可先用「用户资料」端点从公共标识解析出来。若调用超时,先通过「会话列表」和已发建联列表核实实际结果,再决定是否重试。
参考价格:每次成功请求 $0.02 USD。授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
响应
Success
可用选项:
MessageSent