Send a unibox LinkedIn message
Sends a LinkedIn message in a unibox thread. Provide chatId and message in the body. chatId is the internal unibox thread id returned as id by GET /v1/unibox/threads; it is not the LinkedIn conversationUrn. Optional multipart fields: file, voiceMessage.
curl --request POST \
--url https://ext.gojiberry.ai/v1/unibox/messages/send-message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'chatId=<string>' \
--form 'message=Hi, thanks for your reply.' \
--form file=@example-file \
--form voiceMessage=@example-fileimport requests
url = "https://ext.gojiberry.ai/v1/unibox/messages/send-message"
files = {
"file": ("example-file", open("example-file", "rb")),
"voiceMessage": ("example-file", open("example-file", "rb"))
}
payload = {
"chatId": "<string>",
"message": "Hi, thanks for your reply."
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('chatId', '<string>');
form.append('message', 'Hi, thanks for your reply.');
form.append('file', '<string>');
form.append('voiceMessage', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://ext.gojiberry.ai/v1/unibox/messages/send-message', 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://ext.gojiberry.ai/v1/unibox/messages/send-message",
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=\"chatId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nHi, thanks for your reply.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voiceMessage\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\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://ext.gojiberry.ai/v1/unibox/messages/send-message"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"chatId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nHi, thanks for your reply.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voiceMessage\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\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://ext.gojiberry.ai/v1/unibox/messages/send-message")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"chatId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nHi, thanks for your reply.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voiceMessage\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://ext.gojiberry.ai/v1/unibox/messages/send-message")
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=\"chatId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nHi, thanks for your reply.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voiceMessage\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": 123,
"threadId": 123,
"userId": 123,
"senderIsSelf": true,
"createdAt": "2023-11-07T05:31:56Z",
"seatId": 123,
"linkedinMessageBackendUrn": "<string>",
"senderUrn": "<string>",
"senderFullName": "<string>",
"content": "<string>",
"attachments": [
{
"id": "<string>",
"url": "<string>",
"type": "img",
"name": "<string>",
"size": 123
}
],
"deliveredAt": "2023-11-07T05:31:56Z"
}Authorizations
API key from Settings → API. Send it as Authorization: Bearer .
Headers
ID of an organization member to act on behalf of. The API key user must be the owner of the organization and the target user must belong to the same organization.
Body
Internal unibox thread id returned as id by GET /v1/unibox/threads. This is not the LinkedIn conversationUrn.
Text message to send. Optional only when sending a file or voiceMessage.
"Hi, thanks for your reply."
Optional file attachment. Do not send together with voiceMessage.
Optional voice message attachment. Do not send together with file.
Response
Message sent successfully.
Incremental message id
Parent thread id
Owner user id
True when the sender is the seat owner
Timestamp the row was persisted in Gojiberry
LinkedIn seat id that received/sent the message
LinkedIn's message backend URN (urn:li:messagingMessage:…).
LinkedIn URN of the sender
Full name of the sender
Message content
Attachments attached to the message
Show child attributes
Show child attributes
Timestamp LinkedIn assigned when the message was delivered.
curl --request POST \
--url https://ext.gojiberry.ai/v1/unibox/messages/send-message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'chatId=<string>' \
--form 'message=Hi, thanks for your reply.' \
--form file=@example-file \
--form voiceMessage=@example-fileimport requests
url = "https://ext.gojiberry.ai/v1/unibox/messages/send-message"
files = {
"file": ("example-file", open("example-file", "rb")),
"voiceMessage": ("example-file", open("example-file", "rb"))
}
payload = {
"chatId": "<string>",
"message": "Hi, thanks for your reply."
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('chatId', '<string>');
form.append('message', 'Hi, thanks for your reply.');
form.append('file', '<string>');
form.append('voiceMessage', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://ext.gojiberry.ai/v1/unibox/messages/send-message', 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://ext.gojiberry.ai/v1/unibox/messages/send-message",
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=\"chatId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nHi, thanks for your reply.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voiceMessage\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\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://ext.gojiberry.ai/v1/unibox/messages/send-message"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"chatId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nHi, thanks for your reply.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voiceMessage\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\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://ext.gojiberry.ai/v1/unibox/messages/send-message")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"chatId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nHi, thanks for your reply.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voiceMessage\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://ext.gojiberry.ai/v1/unibox/messages/send-message")
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=\"chatId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\nHi, thanks for your reply.\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voiceMessage\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": 123,
"threadId": 123,
"userId": 123,
"senderIsSelf": true,
"createdAt": "2023-11-07T05:31:56Z",
"seatId": 123,
"linkedinMessageBackendUrn": "<string>",
"senderUrn": "<string>",
"senderFullName": "<string>",
"content": "<string>",
"attachments": [
{
"id": "<string>",
"url": "<string>",
"type": "img",
"name": "<string>",
"size": 123
}
],
"deliveredAt": "2023-11-07T05:31:56Z"
}.png?fit=max&auto=format&n=fLzJlZyi7L0nfF9B&q=85&s=7dc539f8ea9f771a09a9750c1227ebdb)
.png?fit=max&auto=format&n=fLzJlZyi7L0nfF9B&q=85&s=e742bcbb4bd47cd295da36c48cdd6089)