Document Message
curl --request POST \
--url https://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file": "https://example.com/document.pdf",
"caption": "This is caption for document."
}
'import requests
url = "https://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document"
payload = {
"file": "https://example.com/document.pdf",
"caption": "This is caption for document."
}
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({
file: 'https://example.com/document.pdf',
caption: 'This is caption for document.'
})
};
fetch('https://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document', 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://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document",
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([
'file' => 'https://example.com/document.pdf',
'caption' => 'This is caption for document.'
]),
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://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document"
payload := strings.NewReader("{\n \"file\": \"https://example.com/document.pdf\",\n \"caption\": \"This is caption for document.\"\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://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file\": \"https://example.com/document.pdf\",\n \"caption\": \"This is caption for document.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document")
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 \"file\": \"https://example.com/document.pdf\",\n \"caption\": \"This is caption for document.\"\n}"
response = http.request(request)
puts response.read_body{
"status": 201,
"message": "Resource created successfully.",
"data": {}
}{
"message": "Unauthenticated."
}{
"message": "Resource not found.",
"status": 404
}{
"message": "Validation error",
"errors": {}
}Send Messages (Via Id)
Document Message
Send a document message to a specific contact within a workspace.
POST
/
workspaces
/
{workspace}
/
contacts
/
{contact}
/
messages
/
document
Document Message
curl --request POST \
--url https://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file": "https://example.com/document.pdf",
"caption": "This is caption for document."
}
'import requests
url = "https://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document"
payload = {
"file": "https://example.com/document.pdf",
"caption": "This is caption for document."
}
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({
file: 'https://example.com/document.pdf',
caption: 'This is caption for document.'
})
};
fetch('https://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document', 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://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document",
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([
'file' => 'https://example.com/document.pdf',
'caption' => 'This is caption for document.'
]),
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://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document"
payload := strings.NewReader("{\n \"file\": \"https://example.com/document.pdf\",\n \"caption\": \"This is caption for document.\"\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://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file\": \"https://example.com/document.pdf\",\n \"caption\": \"This is caption for document.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lancepilot.com/api/v3/workspaces/{workspace}/contacts/{contact}/messages/document")
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 \"file\": \"https://example.com/document.pdf\",\n \"caption\": \"This is caption for document.\"\n}"
response = http.request(request)
puts response.read_body{
"status": 201,
"message": "Resource created successfully.",
"data": {}
}{
"message": "Unauthenticated."
}{
"message": "Resource not found.",
"status": 404
}{
"message": "Validation error",
"errors": {}
}This endpoint allows you to send an document message to a contact. You can provide the document in two ways:
- Document URL: Pass the document URL in the request body.
- Uploaded File: Send the document as a file using
multipart/form-data.
File Field Requirements
- file:
- Required
- Allowed MIME types:
txt,docx,ppt,pptx,xls,xlsx,doc,pdf - Maximum size: 100 MB (
max:102400KB)
Request Options
-
Document URL Example (JSON):
{ "file": "https://example.com/document.txt" } -
Uploaded File Example (multipart/form-data):
POST /workspaces/{workspace}/contacts/{contact}/messages/document Content-Type: multipart/form-data file: [binary document file]
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the workspace.
ID of the contact.
Body
application/json
Message sending parameters.
⌘I