HeyDo - Control WP Website

HeyDo - Control WP Website · GPT 작업

Heydo API

Access to Heydo services, including listing available websites for users and fetching, updating, and creating posts from those websites.

  • GET /wp-json/heydo/v1/list_available_websitesList Available Websites

    Retrieves a list of available websites that the user has access to.

  • POST /wp-json/heydo/v1/fetch_postsFetch Posts

    Retrieves a list of posts from a specific website, specified in the request body. Only the essential fields: id, title, excerpt, and date are returned to optimize performance.

  • POST /wp-json/heydo/v1/fetch_individual_postFetch Individual Post

    Retrieves the full content of an individual post specified by its ID and the website ID. This endpoint returns all detailed fields of the post, including id, title, excerpt, content, date, and author.

  • POST /wp-json/heydo/v1/update_postUpdate Post

    Updates an existing post with new content, title, or excerpt as specified in the request body. The website ID can also be specified, with "default" as the fallback.

  • POST /wp-json/heydo/v1/create_postCreate Post

    Creates a new post on the specified website or on the default website if no website_id is specified in the request body.

  • GET /wp-json/heydo/v1/list_available_workplacesList Available Workplaces

    Retrieves a list of available workplaces that the user has access to.

  • POST /wp-json/heydo/v1/change_default_workplaceChange Default Workplace

    Changes the user's default workplace to the one specified by the workplace_id in the request body.

  • POST /wp-json/heydo/v1/change_default_websiteChange Default Website

    Changes the user's default website to the one specified by the website_id in the request body.

  • POST /wp-json/heydo/v1/create_picspotCreate Picspot

    Creates a Picspot instance to manage content for image requests related to a specific post, first you do a fetchIndividualPost action, than the createPicspot with the data you retrieved and than, a updatePost with the placeholders included in the updated content as well, everything in a sequence.

  • GET /wp-json/heydo/v1/list_user_websites_with_workplacesList User Websites with Workplaces

    Automatically retrieves the list of websites with their corresponding workplaces.

원본 API 스키마
{
  "openapi": "3.0.2",
  "info": {
    "title": "Heydo API",
    "version": "1.0.0",
    "description": "Access to Heydo services, including listing available websites for users and fetching, updating, and creating posts from those websites."
  },
  "servers": [
    {
      "url": "https://heydo.ai"
    }
  ],
  "paths": {
    "/wp-json/heydo/v1/list_available_websites": {
      "get": {
        "operationId": "listAvailableWebsites",
        "summary": "List Available Websites",
        "description": "Retrieves a list of available websites that the user has access to.",
        "responses": {
          "200": {
            "description": "A list of available websites",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableWebsiteList"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/heydo/v1/fetch_posts": {
      "post": {
        "operationId": "fetchPosts",
        "summary": "Fetch Posts",
        "description": "Retrieves a list of posts from a specific website, specified in the request body. Only the essential fields: id, title, excerpt, and date are returned to optimize performance.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "website_id": {
                    "type": "string",
                    "description": "The unique identifier of the website to fetch posts from. Use \"default\" to automatically select the user's default website.",
                    "default": "default"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A list of posts from the specified website with reduced fields to enhance performance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "The unique identifier of the post."
                      },
                      "title": {
                        "type": "string",
                        "description": "The title of the post."
                      },
                      "excerpt": {
                        "type": "string",
                        "description": "A brief excerpt of the post."
                      },
                      "date": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The publication date of the post."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/heydo/v1/fetch_individual_post": {
      "post": {
        "operationId": "fetchIndividualPost",
        "summary": "Fetch Individual Post",
        "description": "Retrieves the full content of an individual post specified by its ID and the website ID. This endpoint returns all detailed fields of the post, including id, title, excerpt, content, date, and author.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "website_id": {
                    "type": "string",
                    "description": "The unique identifier of the website from which to fetch the post. Use \"default\" to automatically select the user's default website.",
                    "default": "default"
                  },
                  "post_id": {
                    "type": "integer",
                    "description": "The unique identifier of the post to fetch."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Full details of the specified post.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "The unique identifier of the post."
                    },
                    "title": {
                      "type": "string",
                      "description": "The title of the post."
                    },
                    "excerpt": {
                      "type": "string",
                      "description": "A brief excerpt of the post."
                    },
                    "content": {
                      "type": "string",
                      "description": "The full content of the post."
                    },
                    "date": {
                      "type": "string",
                      "format": "date-time",
                      "description": "The publication date of the post."
                    },
                    "author": {
                      "type": "string",
                      "description": "The author of the post."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/heydo/v1/update_post": {
      "post": {
        "operationId": "updatePost",
        "summary": "Update Post",
        "description": "Updates an existing post with new content, title, or excerpt as specified in the request body. The website ID can also be specified, with \"default\" as the fallback.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePostRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Post updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad request, e.g., missing required postId or invalid field values."
          },
          "404": {
            "description": "Post not found."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/wp-json/heydo/v1/create_post": {
      "post": {
        "operationId": "createPost",
        "summary": "Create Post",
        "description": "Creates a new post on the specified website or on the default website if no website_id is specified in the request body.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Post created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "This is the unique identifier for the post, not exposed to the client."
                    },
                    "date": {
                      "type": "string",
                      "format": "date-time",
                      "description": "The publication date of the post."
                    },
                    "link": {
                      "type": "string",
                      "description": "Direct link to the post. this should be included in response always."
                    },
                    "status": {
                      "type": "string",
                      "description": "Publishing status of the post."
                    },
                    "title": {
                      "type": "string",
                      "description": "The title of the post after rendering."
                    },
                    "picspot": {
                      "type": "object",
                      "description": "Optional steps to add images to the post via PicSpot.",
                      "properties": {
                        "generate": {
                          "type": "string",
                          "description": "Flag to initiate image upload feature, should be 'yes' to enable."
                        },
                        "message": {
                          "type": "string",
                          "description": "Message prompting user to add images to the post."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/heydo/v1/list_available_workplaces": {
      "get": {
        "operationId": "listAvailableWorkplaces",
        "summary": "List Available Workplaces",
        "description": "Retrieves a list of available workplaces that the user has access to.",
        "responses": {
          "200": {
            "description": "A list of available workplaces",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Name of the workplace."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/heydo/v1/change_default_workplace": {
      "post": {
        "operationId": "changeDefaultWorkplace",
        "summary": "Change Default Workplace",
        "description": "Changes the user's default workplace to the one specified by the workplace_id in the request body.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workplace_id": {
                    "type": "string",
                    "description": "The ID of the workplace to set as the new default."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default workplace updated successfully."
          }
        }
      }
    },
    "/wp-json/heydo/v1/change_default_website": {
      "post": {
        "operationId": "changeDefaultWebsite",
        "summary": "Change Default Website",
        "description": "Changes the user's default website to the one specified by the website_id in the request body.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "website_id": {
                    "type": "string",
                    "description": "The ID of the website to set as the new default."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The default website has been successfully changed."
          }
        }
      }
    },
    "/wp-json/heydo/v1/create_picspot": {
      "post": {
        "operationId": "createPicspot",
        "summary": "Create Picspot",
        "description": "Creates a Picspot instance to manage content for image requests related to a specific post, first you do a fetchIndividualPost action, than the createPicspot with the data you retrieved and than, a updatePost with the placeholders included in the updated content as well, everything in a sequence.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "website_id": {
                    "type": "string",
                    "description": "The unique identifier of the website. Use 'default' if no specific ID is provided.",
                    "default": "default"
                  },
                  "cpt_id": {
                    "type": "string",
                    "description": "The unique identifier of the content post type where the action will be made. Required."
                  },
                  "cpt_name": {
                    "type": "string",
                    "description": "Always 'Article'. Required.",
                    "default": "Article"
                  },
                  "cpt_slug": {
                    "type": "string",
                    "description": "Always 'article'. Required.",
                    "default": "article"
                  },
                  "content_sequence": {
                    "type": "array",
                    "description": "A sequence of content-related image requests.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Unique identifier for each entry in the Picspot content sequence. always must be provided"
                        },
                        "title": {
                          "type": "string",
                          "description": "Title of the image needed for the section."
                        },
                        "description": {
                          "type": "string",
                          "description": "A brief description helping to clarify what is needed."
                        },
                        "query": {
                          "type": "string",
                          "description": "2-5 keywords describing the image, used for searching in an image database like Pexels."
                        },
                        "status": {
                          "type": "string",
                          "description": "Always 'open'. Indicates that the image request is currently active.",
                          "default": "open"
                        }
                      }
                    }
                  },
                  "meta_sequence": {
                    "type": "array",
                    "description": "A sequence of meta-related image requests, typically for feature images.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "meta_name": {
                          "type": "string",
                          "description": "Meta field name, where 'feature_image' is used for key images.",
                          "default": "feature_image"
                        },
                        "title": {
                          "type": "string",
                          "description": "Title for the image, typically used as a label or header."
                        },
                        "description": {
                          "type": "string",
                          "description": "Description of what the image should depict or convey."
                        },
                        "query": {
                          "type": "string",
                          "description": "Keywords used for searching the image, similar to content_sequence."
                        },
                        "status": {
                          "type": "string",
                          "description": "Always 'open'.",
                          "default": "open"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Picspot instance created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "True if the Picspot instance was successfully created."
                    },
                    "message": {
                      "type": "string",
                      "description": "Additional information about the Picspot creation process."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/heydo/v1/list_user_websites_with_workplaces": {
      "get": {
        "operationId": "listUserWebsitesWithWorkplaces",
        "summary": "List User Websites with Workplaces",
        "description": "Automatically retrieves the list of websites with their corresponding workplaces.\n",
        "responses": {
          "200": {
            "description": "A list of user's websites along with their workplaces",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWebsitesWithWorkplaces"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AvailableWebsiteList": {
        "type": "object",
        "properties": {
          "workplace_name": {
            "type": "string",
            "description": "Name of the workplace containing the list of websites."
          },
          "List of websites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "_ID": {
                  "type": "string",
                  "description": "Unique identifier for the website."
                },
                "name": {
                  "type": "string",
                  "description": "Name of the website."
                },
                "is_default": {
                  "type": "boolean",
                  "description": "Indicates whether this website is the default one for the workplace. If `true`, this website is the default."
                }
              }
            }
          }
        }
      },
      "WebsiteDetails": {
        "type": "object",
        "properties": {
          "siteId": {
            "type": "integer",
            "description": "Unique identifier for the website."
          },
          "siteName": {
            "type": "string",
            "description": "Name of the website."
          }
        }
      },
      "PostList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/PostDetails"
        }
      },
      "PostDetails": {
        "type": "object",
        "properties": {
          "postId": {
            "type": "integer",
            "description": "Unique identifier for the post."
          },
          "title": {
            "type": "string",
            "description": "Title of the post."
          },
          "content": {
            "type": "string",
            "description": "Content of the post."
          },
          "author": {
            "type": "string",
            "description": "Author of the post."
          },
          "publishedDate": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time when the post was published."
          }
        }
      },
      "UpdatePostRequest": {
        "type": "object",
        "properties": {
          "website_id": {
            "type": "string",
            "description": "The unique identifier of the website where the post will be updated. Use \"default\" to automatically select the user's default website.",
            "default": "default"
          },
          "postId": {
            "type": "integer",
            "description": "Unique identifier for the post. Required.",
            "example": 13423
          },
          "content": {
            "type": "string",
            "description": "Updated content of the post. Optional.",
            "example": "Updated content here"
          },
          "title": {
            "type": "string",
            "description": "Updated title of the post. Optional.",
            "example": "Updated Title"
          },
          "excerpt": {
            "type": "string",
            "description": "Updated excerpt of the post. Optional.",
            "example": "Updated excerpt here"
          },
          "status": {
            "type": "string",
            "description": "Updated status of the post. Optional. Acceptable values are \"draft\", \"private\", \"publish\", etc.",
            "example": "publish"
          }
        },
        "required": [
          "website_id",
          "postId"
        ]
      },
      "CreatePostRequest": {
        "type": "object",
        "properties": {
          "website_id": {
            "type": "string",
            "description": "Specify the ID of the website where the post should be created. Use \"default\" to automatically select the user's default website. If omitted, the default website is used.",
            "default": "default"
          },
          "title": {
            "type": "string",
            "description": "The title of the post."
          },
          "content": {
            "type": "string",
            "description": "The content of the post, formatted using Gutenberg blocks for compatibility."
          },
          "status": {
            "type": "string",
            "description": "The status of the new post (e.g., \"private\", \"publish\"). Defaults to \"private\" if not provided.",
            "default": "private"
          }
        },
        "required": [
          "title",
          "content"
        ]
      },
      "AddIdeaRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Title of the idea."
          },
          "description": {
            "type": "string",
            "description": "Description of the idea."
          }
        }
      },
      "UserWebsitesWithWorkplaces": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "A message indicating the list of websites found."
          },
          "list_of_websites": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebsiteWithWorkplaceDetails"
            }
          }
        }
      },
      "WebsiteWithWorkplaceDetails": {
        "type": "object",
        "properties": {
          "website_name": {
            "type": "string",
            "description": "Name of the website."
          },
          "website_id": {
            "type": "string",
            "description": "Unique identifier for the website."
          },
          "workplace_name": {
            "type": "string",
            "description": "Name of the workplace associated with the website."
          },
          "workplace_id": {
            "type": "string",
            "description": "Unique identifier for the workplace."
          }
        }
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://heydo.ai/wp-json/moserver/authorize",
            "tokenUrl": "https://heydo.ai/wp-json/moserver/token",
            "scopes": {
              "openid": "OpenID Connect scope",
              "profile": "Access to user's profile",
              "email": "Access to user's email address"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "OAuth2": [
        "openid",
        "profile",
        "email"
      ]
    }
  ]
}