Create Post
curl --request POST \
--url https://api.aisa.one/apis/v1/unipile/linkedin/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'account_id=<string>' \
--form 'text=<string>' \
--form video_thumbnail=@example-fileimport requests
url = "https://api.aisa.one/apis/v1/unipile/linkedin/posts"
files = { "video_thumbnail": ("example-file", open("example-file", "rb")) }
payload = {
"account_id": "<string>",
"text": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('account_id', '<string>');
form.append('text', '<string>');
form.append('video_thumbnail', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.aisa.one/apis/v1/unipile/linkedin/posts', 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/posts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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/posts"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/posts")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/unipile/linkedin/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"object": "PostCreated",
"post_id": "<string>"
}帖子
Create Post
以已连接账号发布 LinkedIn 帖子。
POST
https://api.aisa.one
/
apis
/
v1
/
unipile
/
linkedin
/
posts
Create Post
curl --request POST \
--url https://api.aisa.one/apis/v1/unipile/linkedin/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'account_id=<string>' \
--form 'text=<string>' \
--form video_thumbnail=@example-fileimport requests
url = "https://api.aisa.one/apis/v1/unipile/linkedin/posts"
files = { "video_thumbnail": ("example-file", open("example-file", "rb")) }
payload = {
"account_id": "<string>",
"text": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('account_id', '<string>');
form.append('text', '<string>');
form.append('video_thumbnail', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.aisa.one/apis/v1/unipile/linkedin/posts', 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/posts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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/posts"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/posts")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/unipile/linkedin/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"object": "PostCreated",
"post_id": "<string>"
}以已连接账号发布帖子。写操作,结果在 LinkedIn 上公开可见,请视为不可撤销。请求必须是
multipart/form-data:上游解析附件时 JSON body 会被拒。加图用 -F "attachments=@image.jpg";提及某人时在正文写 {{0}} 并传 mentions[0][profile_id] 与 mentions[0][name];代公司发文则传 as_organization(需是该主页管理员)。
当前价格请查看费用说明;支持报价的接口可按实际请求获取报价。
请求规范
- 方法与路径: POST /apis/v1/unipile/linkedin/posts
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/unipile/linkedin/posts
{
"operationId": "post_unipile_linkedin_create_post",
"method": "POST",
"path": "/apis/v1/unipile/linkedin/posts",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"properties": {
"account_id": {
"description": "The id of the account to perform the request from.",
"minLength": 1,
"type": "string"
},
"as_organization": {
"description": "`Linkedin only` Provide the ID of an organization over which you have control to perform the action on its behalf.",
"minLength": 1,
"type": "string"
},
"attachments": {
"description": "On `linkedin`, image file resolution is limited to 6012px x 6012px max.",
"items": {
"format": "binary",
"type": "string"
},
"type": "array"
},
"external_link": {
"description": "`Linkedin only` An external link that should be displayed within a preview card. The URL must also be included in the post textual content. Otherwise, it will be automatically added at the end.",
"pattern": "^https?://",
"type": "string"
},
"include_job_posting": {
"description": "`Linkedin only` The ID of a job posting that should be displayed within a preview card.",
"type": "string"
},
"location": {
"description": "`Instagram only`: The location to tag in the post. The best match for the query is used, and a query matching no place leaves the post untagged. On a story, the location is also drawn on the media as a tappable sticker.",
"type": "string"
},
"mentions": {
"description": "`Linkedin only`",
"items": {
"properties": {
"is_company": {
"type": "boolean"
},
"name": {
"description": "The name of the user as it will be displayed in your message.",
"type": "string"
},
"profile_id": {
"description": "The provider ID of the user, which begins with ACo/ADo for individuals and is a series of digits for companies.",
"type": "string"
}
},
"required": [
"name",
"profile_id"
],
"type": "object"
},
"type": "array"
},
"post_type": {
"anyOf": [
{
"enum": [
"feed"
],
"type": "string"
},
{
"enum": [
"story"
],
"type": "string"
},
{
"enum": [
""
],
"type": "string"
}
],
"description": "`Instagram only`: Publish as a regular feed post or as a story. Defaults to `feed` when omitted or empty."
},
"repost": {
"description": "The id of an existing LinkedIn post to publish as repost. For a simple repost without commentary, `text` should be an empty string.",
"type": "string"
},
"targeted_audience": {
"description": "`Linkedin only` A set of filters to adjust the target audience of your posts.",
"properties": {
"headcount": {
"description": "Linkedin native filter : COMPANY SIZE.",
"items": {
"properties": {
"max": {
"enum": [
1,
10,
50,
200,
500,
1000,
5000,
10000
],
"type": "number"
},
"min": {
"enum": [
2,
11,
51,
201,
501,
1001,
5001,
10001
],
"type": "number"
}
},
"type": "object"
},
"type": "array"
},
"industry": {
"description": "The ID of the parameter. Use type INDUSTRY on the List search parameters route to find out the right ID.\nLinkedin native filter : INDUSTRY.",
"items": {
"pattern": "^\\d+$",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"job_function": {
"description": "The ID of the parameter. Use type POST_JOB_FUNCTION on the List search parameters route to find out the right ID.\nLinkedin native filter : JOB FUNCTION.",
"items": {
"pattern": "^\\d+$",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"language": {
"description": "The ID of the parameter. Use type LANGUAGE on the List search parameters route to find out the right ID.\nLinkedin native filter : LANGUAGE.",
"items": {
"pattern": "^[a-z]+_[A-Z]+$",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"location": {
"description": "The ID of the parameter. Use type LOCATION on the List search parameters route to find out the right ID.\nLinkedin native filter : LOCATION.",
"items": {
"pattern": "^\\d+$",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"region": {
"description": "The ID of the parameter. Use type REGION on the List search parameters route to find out the right ID.\nLinkedin native filter : REGION.",
"items": {
"pattern": "^\\d+$",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"school": {
"description": "The ID of the parameter. Use type SCHOOL on the List search parameters route to find out the right ID.\nLinkedin native filter : UNIVERSITY.",
"items": {
"pattern": "^\\d+$",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"seniority": {
"description": "The ID of the parameter. Use type SENIORITY on the List search parameters route to find out the right ID.\nLinkedin native filter : SENIORITY.",
"items": {
"pattern": "^\\d+$",
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"type": "object"
},
"text": {
"description": "`Linkedin`: You can add a mention by inserting the index of the corresponding entry from the mentions array between two double braces. Example: Hey {{0}}, check this out ! <br> `Instagram`: To mention a user, use the @ symbol followed by their username. On a story, each mention is drawn on the media as a tappable `@username` sticker and the user is notified; the surrounding text is not displayed. A username that matches no account is left as plain text. Up to 10 mentions per story.",
"type": "string"
},
"video_thumbnail": {
"format": "binary",
"type": "string"
}
},
"required": [
"account_id",
"text"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
公开参考价格:每次成功请求 $0.02 USD。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。授权
请求体
multipart/form-data
Linkedin: You can add a mention by inserting the index of the corresponding entry from the mentions array between two double braces. Example: Hey {{0}}, check this out !
Instagram: To mention a user, use the @ symbol followed by their username. On a story, each mention is drawn on the media as a tappable @username sticker and the user is notified; the surrounding text is not displayed. A username that matches no account is left as plain text. Up to 10 mentions per story.