Create posts for all supported platforms. It is possible to create customized posts per channel by using the same platform account IDs in a request and hitting the create post API multiple times with different summaries and account IDs per platform.
The content and media limitations, as well as platform rate limiters corresponding to the respective platforms, are provided in the following reference link:
Link: Platform Limitations
POST https://services.leadconnectorhq.com/social-media-posting/{locationId}/postsAuthorization Path parameters Body media (object[]): Post Media Data The limitations of media as per the platforms is provided through the reference link in API description
url (string, required): Example: https://i0.wp.com/www.lifeofanarchitect.com/wp-content/uploads/2021/10/architectural-model-making-stairs.jpg
caption (string): Example: Caption 1
type (string): Example: video/mp4 or image/png
thumbnail (string): Example: https://storage.googleapis.com/test/test/media/test.jpeg
defaultThumb (string): Example: https://storage.googleapis.com/test/test/media/test.jpeg
id (string): Example: Edf3323fsfsdsd
Responses 201 - Successful response success (boolean, required): Success or Failure Example: True
statusCode (number, required): Status Code Example: 201
message (string, required): Message Example: Created Post
results (object): Requested Results
{
"success" : true ,
"statusCode" : 201 ,
"message" : "Created Post"
}400 - Bad Request 401 - Unauthorized 422 - Unprocessable Entity Example curl -X POST 'https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"accountIds" : [
"aF3KhyL8JIuBwzK3m7Ly_iVrVJ2uoXNF0wzcBzgl5_12554616564525983496"
],
"summary" : "Hello World" ,
"media" : [
{
"url" : "https://i0.wp.com/www.lifeofanarchitect.com/wp-content/uploads/2021/10/architectural-model-making-stairs.jpg" ,
"caption" : "Caption 1" ,
"type" : "video/mp4 or image/png" ,
"thumbnail" : "https://storage.googleapis.com/test/test/media/test.jpeg" ,
"defaultThumb" : "https://storage.googleapis.com/test/test/media/test.jpeg" ,
"id" : "Edf3323fsfsdsd"
}
],
"status" : "draft" ,
"scheduleDate" : "string" ,
"createdBy" : "string" ,
"followUpComment" : "First comment" ,
"type" : "post" ,
"scheduleTimeUpdated" : true ,
"tags" : [
"65f151c99bc2bf3aaf970d72"
],
"categoryId" : "65f151c99bc2bf3aaf970d72" ,
"userId" : "sdfdsfdsfEWEsdfsdsW32dd"
}'const response = await fetch ('https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts' , {
method : 'POST' ,
headers : {
Authorization : `Bearer ${process.env.LEADWAY_TOKEN}` ,
Version : '2021-07-28' ,
'Content-Type' : 'application/json' ,
},
body : JSON.stringify ({"accountIds" : ["aF3KhyL8JIuBwzK3m7Ly_iVrVJ2uoXNF0wzcBzgl5_12554616564525983496" ], "summary" : "Hello World" , "media" : [{"url" : "https://i0.wp.com/www.lifeofanarchitect.com/wp-content/uploads/2021/10/architectural-model-making-stairs.jpg" , "caption" : "Caption 1" , "type" : "video/mp4 or image/png" , "thumbnail" : "https://storage.googleapis.com/test/test/media/test.jpeg" , "defaultThumb" : "https://storage.googleapis.com/test/test/media/test.jpeg" , "id" : "Edf3323fsfsdsd" }], "status" : "draft" , "scheduleDate" : "string" , "createdBy" : "string" , "followUpComment" : "First comment" , "type" : "post" , "scheduleTimeUpdated" : true , "tags" : ["65f151c99bc2bf3aaf970d72" ], "categoryId" : "65f151c99bc2bf3aaf970d72" , "userId" : "sdfdsfdsfEWEsdfsdsW32dd" }),
});
const data = await response.json ();import os, requests
response = requests.request (
'POST' ,
'https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts' ,
headers ={
'Authorization' : f"Bearer {os.environ['LEADWAY_TOKEN']}" ,
'Version' : '2021-07-28' ,
'Content-Type' : 'application/json' ,
},
json ={"accountIds" : ["aF3KhyL8JIuBwzK3m7Ly_iVrVJ2uoXNF0wzcBzgl5_12554616564525983496" ], "summary" : "Hello World" , "media" : [{"url" : "https://i0.wp.com/www.lifeofanarchitect.com/wp-content/uploads/2021/10/architectural-model-making-stairs.jpg" , "caption" : "Caption 1" , "type" : "video/mp4 or image/png" , "thumbnail" : "https://storage.googleapis.com/test/test/media/test.jpeg" , "defaultThumb" : "https://storage.googleapis.com/test/test/media/test.jpeg" , "id" : "Edf3323fsfsdsd" }], "status" : "draft" , "scheduleDate" : "string" , "createdBy" : "string" , "followUpComment" : "First comment" , "type" : "post" , "scheduleTimeUpdated" : true , "tags" : ["65f151c99bc2bf3aaf970d72" ], "categoryId" : "65f151c99bc2bf3aaf970d72" , "userId" : "sdfdsfdsfEWEsdfsdsW32dd" },
)
data = response.json ()<?php
$ch = curl_init ('https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts' );
curl_setopt_array ($ch, [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv ('LEADWAY_TOKEN' ),
'Version: 2021-07-28' ,
'Content-Type: application/json' ,
],
CURLOPT_POSTFIELDS => json_encode ({'accountIds' : ['aF3KhyL8JIuBwzK3m7Ly_iVrVJ2uoXNF0wzcBzgl5_12554616564525983496' ], 'summary' : 'Hello World' , 'media' : [{'url' : 'https://i0.wp.com/www.lifeofanarchitect.com/wp-content/uploads/2021/10/architectural-model-making-stairs.jpg' , 'caption' : 'Caption 1' , 'type' : 'video/mp4 or image/png' , 'thumbnail' : 'https://storage.googleapis.com/test/test/media/test.jpeg' , 'defaultThumb' : 'https://storage.googleapis.com/test/test/media/test.jpeg' , 'id' : 'Edf3323fsfsdsd' }], 'status' : 'draft' , 'scheduleDate' : 'string' , 'createdBy' : 'string' , 'followUpComment' : 'First comment' , 'type' : 'post' , 'scheduleTimeUpdated' : true , 'tags' : ['65f151c99bc2bf3aaf970d72' ], 'categoryId' : '65f151c99bc2bf3aaf970d72' , 'userId' : 'sdfdsfdsfEWEsdfsdsW32dd' }),
]);
$data = json_decode (curl_exec ($ch), true );