{
  "swagger": "2.0",
  "info": {
    "contact": {}
  },
  "paths": {
    "/v1/history": {
      "get": {
        "description": "query message history",
        "tags": [
          "send"
        ],
        "parameters": [
          {
            "type": "integer",
            "description": "page_index",
            "name": "page_index",
            "in": "query",
            "required": true
          },
          {
            "type": "integer",
            "description": "page_size",
            "name": "page_size",
            "in": "query",
            "required": true
          },
          {
            "type": "integer",
            "description": "start time",
            "name": "start",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "end time",
            "name": "end",
            "in": "query"
          },
          {
            "type": "string",
            "description": "false failed, true sent successfully",
            "name": "status",
            "in": "query"
          },
          {
            "type": "string",
            "description": "sender name",
            "name": "sender",
            "in": "query"
          },
          {
            "type": "string",
            "description": "content",
            "name": "content",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      }
    },
    "/v1/message": {
      "post": {
        "description": "send a new message\nhttps://github.com/veops/messenger?tab=readme-ov-file#发送消息",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "send"
        ],
        "parameters": [
          {
            "description": " ",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/send.message"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "a map with msg info, eg. {msg:ok}",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "/v1/senders": {
      "put": {
        "description": "push a conf to overwrite(POST), update(PUT) or delete(DELETE) existing conf of senders\nhttps://github.com/veops/messenger?tab=readme-ov-file#更新配置",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "conf"
        ],
        "parameters": [
          {
            "description": "senders config, eg. {wechatBot: [{name: yourSenderName, url: https://xxx}]}",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "a map with msg info, eg. {msg:ok}",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      },
      "post": {
        "description": "push a conf to overwrite(POST), update(PUT) or delete(DELETE) existing conf of senders\nhttps://github.com/veops/messenger?tab=readme-ov-file#更新配置",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "conf"
        ],
        "parameters": [
          {
            "description": "senders config, eg. {wechatBot: [{name: yourSenderName, url: https://xxx}]}",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "a map with msg info, eg. {msg:ok}",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      },
      "delete": {
        "description": "push a conf to overwrite(POST), update(PUT) or delete(DELETE) existing conf of senders\nhttps://github.com/veops/messenger?tab=readme-ov-file#更新配置",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "conf"
        ],
        "parameters": [
          {
            "description": "senders config, eg. {wechatBot: [{name: yourSenderName, url: https://xxx}]}",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "a map with msg info, eg. {msg:ok}",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "/v1/uid/getbyphone": {
      "post": {
        "description": "get user's uid by he or she's phone number\nhttps://github.com/veops/messenger?tab=readme-ov-file#查询用户ID",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "send"
        ],
        "parameters": [
          {
            "description": " ",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/send.getUIDByPhoneReq"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "a map with phone as key and uid as value",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "send.getUIDByPhoneReq": {
      "type": "object",
      "required": [
        "phone",
        "sender"
      ],
      "properties": {
        "phone": {
          "type": "string",
          "example": "133123456789"
        },
        "sender": {
          "type": "string",
          "example": "myWechatBot"
        }
      }
    },
    "send.message": {
      "type": "object",
      "required": [
        "content",
        "msgtype",
        "sender"
      ],
      "properties": {
        "at_mobiles": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            "133123456789"
          ]
        },
        "ats": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            "xxx"
          ]
        },
        "ccs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            ""
          ]
        },
        "content": {
          "type": "string",
          "example": "this is a text content"
        },
        "extra": {
          "type": "string",
          "example": "{\"enable_duplicate_check\": 1,\"duplicate_check_interval\": 1800}"
        },
        "msgtype": {
          "type": "string",
          "example": "text"
        },
        "sender": {
          "type": "string",
          "example": "myWechatBot"
        },
        "simple": {
          "type": "boolean",
          "example": true
        },
        "sync": {
          "type": "boolean",
          "example": true
        },
        "title": {
          "type": "string",
          "example": ""
        },
        "tos": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            ""
          ]
        }
      }
    }
  },
  "externalDocs": {
    "description": "Messenger README",
    "url": "https://github.com/veops/messenger?tab=readme-ov-file#messenger"
  }
}