Strap UI

Strap UI · Ações GPT

Strap UI Server API

API for managing HTML content and exceptional sites

  • POST /receive-contentReceive and store content
  • PATCH /update-content/{id}Update content
  • GET /content/{id}Retrieve content by ID
  • PATCH /remove-html-tags/{id}Remove specified HTML tags from content
  • POST /add-exceptional-siteAdd an exceptional site
  • GET /top-sitesRetrieve the top 100 sites
  • GET /resourcesList all resources
  • GET /health-checkCheck server health
Esquema API original
{
  "openapi": "3.1.0",
  "info": {
    "title": "Strap UI Server API",
    "version": "1.0.0",
    "description": "API for managing HTML content and exceptional sites"
  },
  "servers": [
    {
      "url": "https://strapui.onrender.com",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/receive-content": {
      "post": {
        "operationId": "receiveContent",
        "summary": "Receive and store content",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string",
                    "description": "Content to store"
                  },
                  "contentType": {
                    "type": "string",
                    "description": "Type of the content (html, css, js)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Content received successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request format or missing content"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/update-content/{id}": {
      "patch": {
        "operationId": "updateContent",
        "summary": "Update content",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique ID of the content"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string",
                    "description": "Content to update"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Content updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request format or missing content"
          },
          "404": {
            "description": "Content not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/content/{id}": {
      "get": {
        "operationId": "getContentById",
        "summary": "Retrieve content by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique ID of the content"
          }
        ],
        "responses": {
          "200": {
            "description": "Content retrieved successfully",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "text/css": {
                "schema": {
                  "type": "string"
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Content not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/remove-html-tags/{id}": {
      "patch": {
        "operationId": "removeHtmlTags",
        "summary": "Remove specified HTML tags from content",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique ID of the HTML content"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tag": {
                    "type": "string",
                    "description": "HTML tag to remove from content"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Specified HTML tag removed successfully"
          },
          "400": {
            "description": "Invalid request format or missing tag"
          },
          "404": {
            "description": "Content not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/add-exceptional-site": {
      "post": {
        "operationId": "addExceptionalSite",
        "summary": "Add an exceptional site",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "URL of the exceptional site"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Exceptional site added successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "siteId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request format or missing URL"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/top-sites": {
      "get": {
        "operationId": "getTopSites",
        "summary": "Retrieve the top 100 sites",
        "responses": {
          "200": {
            "description": "Top sites retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "site_id": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string"
                      },
                      "clicks": {
                        "type": "integer"
                      },
                      "changes": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/resources": {
      "get": {
        "operationId": "getResources",
        "summary": "List all resources",
        "responses": {
          "200": {
            "description": "Resources retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/health-check": {
      "get": {
        "operationId": "healthCheck",
        "summary": "Check server health",
        "responses": {
          "200": {
            "description": "Server is running"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    }
  }
}