Get Posts

Get Social Media Posts

Endpoint:

GET https://app.marketingblocks.co/api/v1/social-sparks/get-posts

This endpoint retrieves posts from multiple social media channels (Facebook, Instagram, Twitter, LinkedIn, YouTube, TikTok). You can filter by channels and limit the number of posts returned.

Requires the social-read-posts permission.


Authentication

Type: Bearer Token

Authorization: Bearer <token>

Request Parameters

Parameter
Type
Required
Description
Example

channels

string

yes

Comma-separated list of channels to fetch posts from. Supported: facebook, instagram, twitter, linkedin, youtube, tiktok

facebook,instagram,twitter

limit

integer

no

Maximum number of posts to return per request. Default varies.

5


Example Request

cURL

curl --location --request GET \
'https://app.marketingblocks.co/api/v1/social-sparks/get-posts?channels=facebook,instagram,twitter,linkedin,youtube,tiktok&limit=5' \
--header 'Authorization: Bearer <token>'

Plain URL

GET https://app.marketingblocks.co/api/v1/social-sparks/get-posts?channels=facebook,instagram,twitter,linkedin,youtube,tiktok&limit=5

Response Structure

The response is a JSON object with two main keys:

  • posts (object): Contains pagination info and list of posts.

  • status (boolean): Indicates whether the request was successful.

Posts Object

Field
Type
Description

current_page

integer

Current page number.

data

array

Array of post objects (see below).

first_page_url

string

URL to the first page.

from

integer

Starting index of results.

last_page

integer

Last page number.

last_page_url

string

URL to the last page.

next_page_url

string

URL to the next page (if available).

path

string

Base path of the request.

per_page

integer

Number of posts per page.

prev_page_url

string

URL to the previous page (or null if none).

to

integer

Ending index of results.

total

integer

Total number of posts available.

Post Object

Field
Type
Description

post_id

integer

Unique ID of the post.

channel_type

string

The channel type (e.g., facebook).

channel_id

string

Unique identifier for the channel.

STATUS

string

Status of the post (published, failed).

permalink

string

URL link to the post.

error

string

Error message (only present if STATUS=failed).


Example Response

{
  "posts": {
    "current_page": 1,
    "data": [
      {
        "post_id": 1246,
        "channel_type": "facebook",
        "channel_id": "254",
        "STATUS": "published",
        "permalink": "https://www.facebook.com/270235986170649/posts/270235986170649_122205223640252453"
      },
      {
        "post_id": 1224,
        "channel_type": "twitter",
        "channel_id": "249",
        "STATUS": "failed",
        "error": "cURL error 56: OpenSSL SSL_read: ... decryption failed or bad record mac ..."
      }
    ],
    "first_page_url": "https://app.marketingblocks.co/api/v1/social-sparks/get-posts?page=1",
    "from": 1,
    "last_page": 16,
    "last_page_url": "https://app.marketingblocks.co/api/v1/social-sparks/get-posts?page=16",
    "next_page_url": "https://app.marketingblocks.co/api/v1/social-sparks/get-posts?page=2",
    "path": "https://app.marketingblocks.co/api/v1/social-sparks/get-posts",
    "per_page": 5,
    "prev_page_url": null,
    "to": 5,
    "total": 77
  },
  "status": true
}

Last updated