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}/posts
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación .
Version
string
default: "2021-07-28"
required
Versión de la API.
Path parameters
locationId
string
default: "ve9EPM428h8vShlRW1KT"
required
Account Id
Body
summary
string
default: "Hello World"
Post Content
The limitations of content as per the platforms is provided through the reference link in API description. The summary will be trimmed based on the limit
Post Media Data
The limitations of media as per the platforms is provided through the reference link in API description caption
string
default: "Caption 1"
type
string
default: "video/mp4 or image/png"
id
string
default: "Edf3323fsfsdsd"
Status must be one of the following values: null, in_progress, draft, failed, published, scheduled, in_review, notification_sent, deleted
Follow Up Comment on platform. It is not allowed on Tiktok and GMB accounts and there is a limit of 280 charecters for twitter account
type
object
default: "post"
required
Post Type must be one of the following values: - post, story, reel
if schedule datetime is updated
categoryId
string
default: "65f151c99bc2bf3aaf970d72"
Category Id
userId
string
default: "sdfdsfdsfEWEsdfsdsW32dd"
required
User ID
Respuestas
201 - Successful response
success
boolean
default: "True"
required
Success or Failure
statusCode
number
default: "201"
required
Status Code
message
string
default: "Created Post"
required
Message
{
"success" : true ,
"statusCode" : 201 ,
"message" : "Created Post"
}
422 - Unprocessable Entity
Ejemplo
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 );