Linkd Master

Linkd Master · GPT Actions

Post on LinkedIn API

This API enables posting content on LinkedIn via ChatGPT. Make post request on post_on_linkedIn route to post on LinkedIn

  • POST /post_on_linkedInShares a post on LinkedIn, immediately or at a scheduled time. Ask User if you want to schedule post or share it immediately because request body depends on that
  • GET /scheduledPosts/getAllRetrieves all posts scheduled by the user.
  • POST /scheduledPosts/deleteByIdDeletes a scheduled post by its ID.
原始 API 定义
{
  "openapi": "3.0.0",
  "info": {
    "title": "Post on LinkedIn API",
    "version": "1.0.0",
    "description": "This API enables posting content on LinkedIn via ChatGPT. Make post request on post_on_linkedIn route to post on LinkedIn",
    "contact": {
      "email": "chandan@thumbnailai.online"
    }
  },
  "servers": [
    {
      "url": "https://strange-fawn-moccasins.cyclic.app"
    }
  ],
  "paths": {
    "/post_on_linkedIn": {
      "post": {
        "summary": "Shares a post on LinkedIn, immediately or at a scheduled time. Ask User if you want to schedule post or share it immediately because request body depends on that",
        "operationId": "PostOnLinkedInOperation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "Text to be posted on LinkedIn."
                  },
                  "scheduleTime": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Optional. This parameter is needed only when user wants to schedule a post rather than share immediately. The time to schedule the post, in a format that can be converted to UTC using new Date(scheduleTime).toISOString(). If not provided, the post is shared immediately."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully posted or scheduled.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "posted"
                }
              }
            }
          },
          "400": {
            "description": "Failed to post or schedule.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "failed"
                }
              }
            }
          }
        }
      }
    },
    "/scheduledPosts/getAll": {
      "get": {
        "summary": "Retrieves all posts scheduled by the user.",
        "operationId": "GetScheduledPostsOperation",
        "responses": {
          "200": {
            "description": "Successfully retrieved scheduled posts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scheduledPosts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string",
                            "description": "This is the unique postId for the scheduled post, to be used later for deletion"
                          },
                          "text": {
                            "type": "string"
                          },
                          "scheduledTime": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "Instructions to display": {
                      "type": "string",
                      "example": "Display the list of posts in tabular markdown manner under heading, postId, scheduledTime, textSummary. Under text Display only summary of the text of the posts"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Failed to retrieve scheduled posts.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "failed"
                }
              }
            }
          }
        }
      }
    },
    "/scheduledPosts/deleteById": {
      "post": {
        "summary": "Deletes a scheduled post by its ID.",
        "operationId": "DeleteScheduledPostByIDOperation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "postId": {
                    "type": "string",
                    "description": "The ID of the post to be deleted. Find this from past response of scheduledPosts/getAll method"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully deleted the post.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "deleted"
                }
              }
            }
          },
          "400": {
            "description": "Failed to delete the post.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "failed"
                }
              }
            }
          }
        }
      }
    }
  }
}