v1

latestOpenAPI 3.0.3raw.githubusercontent.com2024-10-2916802.4 MB
📸 Social Media

Update post

The API endpoint allows users to update a post by passing relevant data, along with the post ID as a path variable.

By accessing this endpoint and providing the necessary data and post ID, users can modify and update the content of a specific post.

NOTE: All the fields in the body and optional but must not be empty if passed in the body.

patch/social-media/posts/{postId}

Response

Update post

messagestring
statusCodenumber
successboolean

Example response

{
  "data": {
    "_id": "64a3e3bc9d02a1e3d365f06a",
    "author": {
      "_id": "64a3daef2aaac053bc597395",
      "account": {
        "_id": "64a3daee2aaac053bc59725b",
        "avatar": {
          "_id": "64a3daee2aaac053bc59725c",
          "url": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/528.jpg"
        },
        "email": "rebeka.bashirian@yahoo.com",
        "username": "delia_zboncak15"
      },
      "bio": "checkbook lover, photographer",
      "countryCode": "+91",
      "coverImage": {
        "_id": "64a3daef2aaac053bc597394",
        "url": "https://via.placeholder.com/800x450.png"
      },
      "createdAt": "2023-07-04T08:40:15.098Z",
      "dob": "2014-10-11T03:26:22.966Z",
      "firstName": "Randall",
      "lastName": "Ortiz",
      "location": "Port Aniyahstad, Aruba",
      "owner": "64a3daee2aaac053bc59725b",
      "phoneNumber": "9928906598",
      "updatedAt": "2023-07-04T08:41:25.069Z"
    },
    "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sapien libero, bibendum sed semper vel, cursus ut enim. Sed a lectus eu ligula varius tincidunt vel vitae odio. Phasellus vel massa odio. Donec in velit eu eros consequat ultrices nec eu nulla.",
    "createdAt": "2023-07-04T09:17:48.597Z",
    "images": [
      {
        "_id": "64a3e3bc9d02a1e3d365f06b",
        "localPath": "public/images/copper-wire168846226828285707.jpeg",
        "url": "http://localhost:8080/images/copper-wire168846226828285707.jpeg"
      },
      {
        "_id": "64a3e3bc9d02a1e3d365f06c",
        "localPath": "public/images/bottle168846226828566137.jpg",
        "url": "http://localhost:8080/images/bottle168846226828566137.jpg"
      },
      {
        "_id": "64a3e3bc9d02a1e3d365f06d",
        "localPath": "public/images/wood168846226851984630.jpeg",
        "url": "http://localhost:8080/images/wood168846226851984630.jpeg"
      },
      {
        "_id": "64a3e45c9d02a1e3d365f08d",
        "localPath": "public/images/plastic168846242818670457.jpeg",
        "url": "http://localhost:8080/images/plastic168846242818670457.jpeg"
      }
    ],
    "tags": [
      "new",
      "software",
      "reactjs"
    ],
    "updatedAt": "2023-07-04T09:20:28.210Z"
  },
  "message": "Post updated successfully",
  "statusCode": 200,
  "success": true
}