Open Babel

Open Babel · GPT-Aktionen

drift bottle manage api document

You can create drift bottles, pick up drift bottles, view your own list of drift bottles, reply to picked up drift bottles, and view replies in your own drift bottles.

  • GET /api/gateway/commentsGetCommentByBottleId

    Get the comments of bottle

  • POST /api/gateway/commentsCreateComment

    create a comment for bottle

  • GET /api/gateway/bottlesGetBottleList

    Used to get a list of the user's bottles, but can also be used to get a random bottle placed by someone else; use pick_type in the parameter to either retrieve a list of your own bottles (pick_type=2) or a random bottle from someone else (pick_type=1).

  • POST /api/gateway/bottlesCreateBottle

    create a new bottle

Ursprüngliches API-Schema
{
  "openapi": "3.1.0",
  "info": {
    "title": "drift bottle manage api document",
    "description": "You can create drift bottles, pick up drift bottles, view your own list of drift bottles, reply to picked up drift bottles, and view replies in your own drift bottles.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://api.open-babel.com"
    }
  ],
  "paths": {
    "/api/gateway/comments": {
      "get": {
        "description": "Get the comments of bottle",
        "operationId": "GetCommentByBottleId",
        "x-openai-isConsequential": false,
        "parameters": [
          {
            "name": "bottle_id",
            "in": "query",
            "description": "The unique id of the bottle, can get it from bottle list",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Current page number, used for paging; incremented from 0, can get the next page;default value is 0",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Current page size, control the number of items returned per page;default value is 10",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "response": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentListResponse"
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "post": {
        "description": "create a comment for bottle",
        "operationId": "CreateComment",
        "x-openai-isConsequential": false,
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentRequestParam"
              }
            }
          },
          "required": true
        },
        "response": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodeAndMessageResponse"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/api/gateway/bottles": {
      "get": {
        "description": "Used to get a list of the user's bottles, but can also be used to get a random bottle placed by someone else; use pick_type in the parameter to either retrieve a list of your own bottles (pick_type=2) or a random bottle from someone else (pick_type=1).",
        "operationId": "GetBottleList",
        "x-openai-isConsequential": false,
        "parameters": [
          {
            "name": "pick_type",
            "in": "query",
            "description": "Used to control whether to get a list of your own bottles or one of someone else's, used to get a random bottle of someone else's when pick_type=1, used to get a list of your own bottles when pick_type=2",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["1", "2"]
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Current page number, used for paging; incremented from 0, can get the next page;default value is 0",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Current page size, control the number of items returned per page;default value is 10",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "response": {
          "200": {
            "description": "When the business is processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BottleListResponse"
                }
              }
            }
          },
          "400": {
            "description": "When a business process fails, it is usually a request parameter error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodeAndMessageResponse"
                }
              }
            }
          },
          "500": {
            "description": "When a business process fails, it is usually a service error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodeAndMessageResponse"
                }
              }
            }
          },
          "501": {
            "description": "When a business process fails, it is usually a service error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodeAndMessageResponse"
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "post": {
        "description": "create a new bottle",
        "operationId": "CreateBottle",
        "x-openai-isConsequential": false,
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BottleRequestParam"
              }
            }
          },
          "required": true
        },
        "response": {
          "200": {
            "description": "When the business is processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodeAndMessageResponse"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "components": {
    "schemas": {
      "CommentListResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "description": "the bottle info is in 'bottle_info' field,the comment list in 'comments' field",
            "properties": {
              "bottle_info": {
                "type": "object",
                "properties": {
                  "owner_id": {
                    "type": "string",
                    "description": "the bottle's owner id",
                    "format": "uuid"
                  },
                  "content": {
                    "type": "string"
                  },
                  "participants": {
                    "type": "integer",
                    "description": "number of participants"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "the utc format"
                  },
                  "updated_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "bottle_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "the unique id of the bottle"
                  },
                  "owner_name": {
                    "type": "string",
                    "description": "the bottle's owner name"
                  }
                }
              },
              "comments": {
                "type": "object",
                "description": "the comment list data is in the 'data' field ",
                "properties": {
                  "total": {
                    "type": "integer",
                    "description": "the total number of comments"
                  },
                  "data": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "comment_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "the unique id of comment"
                        },
                        "bottle_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "the unique id of the bottle"
                        },
                        "content": {
                          "type": "string"
                        },
                        "unread": {
                          "type": "boolean",
                          "description": "indicate whether the comment has been read,true:unread ,false:has been read"
                        },
                        "author_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "the commenter's ID"
                        },
                        "author_name": {
                          "type": "string",
                          "description": "the commenter's name"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  },
                  "page": {
                    "type": "integer"
                  },
                  "size": {
                    "type": "integer"
                  },
                  "has_more":{
                    "type": "boolean",
                    "description": "indicate whether there is more data, true:has more data,false:no more data"
                  }
                }
              }
            },
            "required": ["bottle_info", "comments"]
          }
        },
        "required": ["code", "message", "result"]
      },
      "CommentRequestParam": {
        "type": "object",
        "properties": {
          "bottle_id": {
            "type": "string",
            "description": "The unique id of the bottle, can get it from bottle list"
          },
          "content": {
            "type": "string",
            "description": "user responses to this bottle"
          }
        }
      },
      "BottleRequestParam": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string",
            "description": "Ideas, opinions, feelings that users want to share with others. Don't change the user's original content."
          }
        }
      },
      "CodeAndMessageResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "BottleListResponse": {
        "type": "object",
        "required": ["code", "message", "result"],
        "properties": {
          "code": {
            "type": "integer",
            "default": 0,
            "examples": [0]
          },
          "message": {
            "type": "string",
            "default": "",
            "description": "Reminder of this request"
          },
          "result": {
            "type": "object",
            "description": "The result object,the response data is in the 'data' field",
            "required": ["data", "total", "page", "size"],
            "properties": {
              "data": {
                "type": "array",
                "description": "The bottle info list",
                "items": {
                  "type": "object",
                  "description": "bottle info",
                  "required": [
                    "owner_id",
                    "content",
                    "participants",
                    "created_at",
                    "updated_at",
                    "bottle_id",
                    "owner_name"
                  ],
                  "properties": {
                    "owner_id": {
                      "type": "string",
                      "description": "The bottle's owner_id"
                    },
                    "content": {
                      "type": "string",
                      "description": "The bottle's content"
                    },
                    "participants": {
                      "type": "integer",
                      "default": 0,
                      "description": "number of participants"
                    },
                    "created_at": {
                      "type": "string",
                      "default": "",
                      "description": "the bottle created at use utc format"
                    },
                    "updated_at": {
                      "type": "string",
                      "default": "",
                      "description": "the bottle updated at use utc format"
                    },
                    "bottle_id": {
                      "type": "string",
                      "default": "",
                      "description": "the unique id of the bottle"
                    },
                    "owner_name": {
                      "type": "string",
                      "default": "",
                      "description": "The bottle's owner_name"
                    },
                    "unread_comments": {
                      "type": "integer",
                      "default": 0,
                      "description": "Total number of unread messages, returned when viewing your own bottle list only pick_type=2"
                    }
                  }
                }
              },
              "total": {
                "type": "integer",
                "default": 0,
                "description": "the number of bottle list"
              },
              "page": {
                "type": "integer",
                "default": 0,
                "description": "the currently page number"
              },
              "size": {
                "type": "integer",
                "default": 0,
                "description": "the currently page size"
              },
              "has_more":{
                "type": "boolean",
                "description": "indicate whether there is more data, true:has more data,false:no more data"
              }
            }
          }
        }
      }
    }
  }
}