SEND AI GENERATED LINKEDIN VOICE NOTES
Anthony Lee
A.I. Powered Business Automations | Save Time, Save Effort, Save Money with A.I. Process Automations
The Latest Conversion Rate Booster for LI Outreach
I’m not sharing a template that requires a subscription to a new no-code platform. I’m going to instead give you the steps that you can use to execute this on ANY no code or low code platform. You can also run this locally or from software you develop (as it relies primarily on API calls).
You will need one (potentially two, if you decide you like elevenlabs) paid API accounts, however, in addition to your language model API(s).
What you’ll absolutely need to run this...
A Unipile account. (This is a paid account…starts at $55 per month…I am not affiliated) https://www.unipile.com/
* An AI API key (OpenAI, Claude, OpenRouter, etc…you just need something that can programmatically generate text).
* An AI voice generator (can be Elevenlabs https://elevenlabs.io/ OR you can use OpenAI’s voice generator API)
Step 1: Decide who you will message.
==> You can decide to send a message to everyone you are connected with.
You simply need their profile URN (member ID).
You can get this from the Unipile API call GET relations (yea…sounds weird I know).
You’ll find your ‘DSN’ and account ID on the Accounts page in Unipile (after you connect your LinkedIn account…just follow the prompts). You’ll find your API key on the Access Tokens page.
==> You could also use an external database (like Google Sheets) of LinkedIn profiles.
You’d simply feed that list into Unipile’s Retrieve a Profile API endpoint. You’ll need to remove the url components, however, because this endpoint only takes the ‘public identifier’ which is the part of the profile URL after /in/
Just place this identifier in the API URL right after /users/
(Example, my profile is https://www.dhirubhai.net/in/aimarketerguy/ and my public identifier is aimarketerguy).
*Protip, if you use n8n, you can use the following code in a code node to extract the public identifier from the previous node:
// Function to extract LinkedIn public identifier from a URL
function extractLinkedInIdentifier(url) {
try {
// Handle if input is null or undefined
if (!url || typeof url !== 'string') {
return null;
}
// Remove trailing slash if present
const cleanUrl = url.endsWith('/') ? url.slice(0, -1) : url;
// Use regex to extract the identifier
const match = cleanUrl.match(/linkedin\.com\/in\/([^\/\?]+)/);
if (match && match[1]) {
return match[1];
}
return null;
} catch (error) {
console.log('Error processing URL:', error.message);
return null;
}
}
// Function to find LinkedIn URL in an object
function findLinkedInUrl(obj) {
for (const [key, value] of Object.entries(obj)) {
if (typeof value === 'string' && value.includes('linkedin.com/in/')) {
return value;
}
}
return null;
}
// Process all input items
const items = $input.all();
const output = items.map(item => {
const linkedInUrl = findLinkedInUrl(item.json);
if (linkedInUrl) {
// Add the extracted identifier while preserving all existing data
return {
...item,
json: {
...item.json,
linkedinIdentifier: extractLinkedInIdentifier(linkedInUrl)
}
};
}
// If no LinkedIn URL found, return item unchanged
return item;
});
return output;
*OR you can use this Regex in a Match Pattern module in Make:
/in/([^/]+)/?$
==> You may also choose to have this voice-note sequence be a part of a larger campaign that starts with a connection request.
Unipile has an API endpoint for automatically sending connection requests (please be careful when using this as LI has strict rules about sending too many requests).
Simply call this endpoint in your campaign…then later call the endpoint for List All Invitations Sent
curl --request GET \
--url 'https://api1.unipile.com:13111/api/v1/users/invite/sent?account_id=YOUR ACCOUNT ID' \
--header 'X-API-KEY: YOUR API KEY' \
--header 'accept: application/json'
And cross reference the results with your Get Relations API call.
Once you have a means of retrieving LinkedIn IDs, next you can move on to the next step.
Step 2: Generate message.
Now you’ll want A.I. to generate your message. Of course this message needs some context, so in this step we’ll talk about how to retrieve context.
==> You can use Unipile’s API endpoint List All Posts to get all of the posts from the user you wish to message. Then filter the latest few to give the A.I. something to comment on.
curl --request GET \
--url 'https://api1.unipile.com:13111/api/v1/users/provider_ID/posts?account_id=your_account_ID’ \
--header 'X-API-KEY: YOUR API KEY' \
--header 'accept: application/json'
==> You can use Unipile’s API endpoint Retrieve Company Profile to get details about the user’s company that can be great context for the A.I.
领英推荐
curl --request GET \
--url 'https://api1.unipile.com:13111/api/v1/linkedin/company/public_identifier?account_id=your_account_ID' \
--header 'X-API-KEY: YOUR API KEY' \
--header 'accept: application/json'
==> You can scrape the user’s website if you have the url. Using Firecrawl (a paid but very afforable service https://www.firecrawl.dev/) you can
Crawl an entire website -
curl -X POST https://api.firecrawl.dev/v1/crawl \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"url": "https://docs.firecrawl.dev",
"limit": 100,
"scrapeOptions": {
"formats": ["markdown", "html"]
}
}'
Or Scrape a single page -
curl -X POST https://api.firecrawl.dev/v1/scrape \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"url": "https://docs.firecrawl.dev",
"formats" : ["markdown", "html"]
}'
(Firecrawl has a ton more features, definitely check them out and use up all 500 of the free credits you get - https://docs.firecrawl.dev/introduction)
Once you have the context you need to generate a good message, then you feed that to an A.I. and generate your voice “script”.
==> You could simply use one of the native A.I. integrations in a low-code platform.
==> Or you could call an API (like OpenRouter https://openrouter.ai/).
Once you have the text for the “script”, now we move on to generating the voice clip.
Step 3: Generate voice file.
==> The best way to do this is by cloning your voice using Elevenlabs (https://elevenlabs.io/). You can use the UI to clone your voice and then access it via API with the voice ID.
You can even run the Get Voices API call directly from the Elevenlabs API documentation.
Then use the Text to Speech API endpoint to generate your voice file.
==> You can also use OpenAI’s text-to-speech function (though this would NOT be your voice).
Then you can send the voice file using Unipile’s API again.
Step 4: Send the message.
Using Unipile’s Start a New Chat API endpoint, send the voice clip. The voice clip can be any audio file type but must be sent as binary through the API (note, files are automatically converted to binary in n8n…you can also use a binary conversion function in Make).
And that’s it. Using this collection of API calls, you can automate the creation and distribution of voice notes in LinkedIn.
USE RESPONSIBLY!
The ASIN Audit Guy | The Only Mission: Make Amazon FBA sellers like you more money & find your blind spots
1 个月As usual, a ton of value but written by a rocket scientist by rocket scientists! When are you going to start writing for dummies like me?
Product Manager @ Connective3 | Developing AI-powered products to enhance marketing performance??
2 个月Ryan Walker
Building AI Agents to run your Ops // Co-Founder @flowhog - Creator of bestaiagents.ai
2 个月This is gold Anthony! Honestly… My concern is how flodded will dm inboxes be soon when everyone starts using this automations… even more tha now. Sending audios might be a good way to stand out against all other standard ai-generated DMs
Automating Property Management | Founder @ LaunchEngine ??
2 个月Thanks Anthony Lee Always innovating ????
Co-Founder @ Zonder
2 个月This is insane Anthony, thanks for sharing such a workflow!