{
  "openapi": "3.0.0",
  "info": {
    "title": "Notifier by WhatsAble API",
    "description": "Notifier by WhatsAble API Documentation - A comprehensive API for sending WhatsApp messages programmatically",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.insightssystem.com/api:-GWQv5aM",
      "description": "Notifier API"
    }
  ],
  "paths": {
    "/send": {
      "post": {
        "summary": "Send a WhatsApp message",
        "description": "Send a WhatsApp message with optional attachments (images, videos, documents)",
        "operationId": "sendMessage",
        "tags": ["Messages"],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageRequest"
              },
              "examples": {
                "textOnly": {
                  "value": {
                    "phone": "+1234567890",
                    "text": "Hello, this is a test message from Notifier!"
                  }
                },
                "withAttachment": {
                  "value": {
                    "phone": "+1234567890",
                    "text": "Hello, this is a test message from Notifier!",
                    "attachment": "https://example.com/image.jpg",
                    "filename": "image.jpg"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "source": "curl -X POST https://api.insightssystem.com/api:-GWQv5aM/send \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Bearer YOUR_TOKEN_HERE\" \\\n-d '{\n  \"phone\": \"+1234567890\",\n  \"text\": \"Hello, this is a test message from Notifier!\",\n  \"attachment\": \"https://example.com/image.jpg\",\n  \"filename\": \"image.jpg\"\n}'"
          },
          {
            "lang": "JavaScript",
            "source": "fetch(\"https://api.insightssystem.com/api:-GWQv5aM/send\", {\n  method: \"POST\",\n  headers: {\n    \"Content-Type\": \"application/json\",\n    \"Authorization\": \"Bearer YOUR_TOKEN_HERE\"\n  },\n  body: JSON.stringify({\n    phone: \"+1234567890\",\n    text: \"Hello, this is a test message from Notifier!\",\n    attachment: \"https://example.com/image.jpg\",\n    filename: \"image.jpg\"\n  })\n})\n  .then((response) => response.json())\n  .then((data) => console.log(data))\n  .catch((error) => console.error(error));"
          },
          {
            "lang": "Python",
            "source": "import requests\nimport json\n\nurl = \"https://api.insightssystem.com/api:-GWQv5aM/send\"\nheaders = {\n    \"Content-Type\": \"application/json\",\n    \"Authorization\": \"Bearer YOUR_TOKEN_HERE\"\n}\npayload = {\n    \"phone\": \"+1234567890\",\n    \"text\": \"Hello, this is a test message from Notifier!\",\n    \"attachment\": \"https://example.com/image.jpg\",\n    \"filename\": \"image.jpg\"\n}\n\nresponse = requests.post(url, headers=headers, data=json.dumps(payload))\nprint(response.json())"
          },
          {
            "lang": "Go",
            "source": "package main\n\nimport (\n    \"bytes\"\n    \"fmt\"\n    \"net/http\"\n)\n\nfunc main() {\n    url := \"https://api.insightssystem.com/api:-GWQv5aM/send\"\n    payload := []byte(`{\n        \"phone\": \"+1234567890\",\n        \"text\": \"Hello, this is a test message from Notifier!\",\n        \"attachment\": \"https://example.com/image.jpg\",\n        \"filename\": \"image.jpg\"\n    }`)\n\n    req, err := http.NewRequest(\"POST\", url, bytes.NewBuffer(payload))\n    if err != nil {\n        fmt.Println(\"Error creating request:\", err)\n        return\n    }\n\n    req.Header.Set(\"Content-Type\", \"application/json\")\n    req.Header.Set(\"Authorization\", \"Bearer YOUR_TOKEN_HERE\")\n\n    client := &http.Client{}\n    resp, err := client.Do(req)\n    if err != nil {\n        fmt.Println(\"Error sending request:\", err)\n        return\n    }\n    defer resp.Body.Close()\n\n    fmt.Println(\"Response Status:\", resp.Status)\n}"
          },
          {
            "lang": "Java",
            "source": "import java.io.OutputStream;\nimport java.net.HttpURLConnection;\nimport java.net.URL;\n\npublic class Main {\n    public static void main(String[] args) {\n        try {\n            URL url = new URL(\"https://api.insightssystem.com/api:-GWQv5aM/send\");\n            HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n            conn.setRequestMethod(\"POST\");\n            conn.setRequestProperty(\"Content-Type\", \"application/json\");\n            conn.setRequestProperty(\"Authorization\", \"Bearer YOUR_TOKEN_HERE\");\n            conn.setDoOutput(true);\n\n            String payload = \"{\\\"phone\\\": \\\"+1234567890\\\", \\\"text\\\": \\\"Hello, this is a test message from Notifier!\\\", \\\"attachment\\\": \\\"https://example.com/image.jpg\\\", \\\"filename\\\": \\\"image.jpg\\\"}\";\n\n            try (OutputStream os = conn.getOutputStream()) {\n                byte[] input = payload.getBytes(\"utf-8\");\n                os.write(input, 0, input.length);\n            }\n\n            int responseCode = conn.getResponseCode();\n            System.out.println(\"Response Code: \" + responseCode);\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n    }\n}"
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your Notifier API Token"
      }
    },
    "schemas": {
      "MessageRequest": {
        "type": "object",
        "required": ["phone", "text"],
        "properties": {
          "phone": {
            "type": "string",
            "description": "The recipient's phone number in E.164 format (e.g., +1234567890)"
          },
          "text": {
            "type": "string",
            "description": "The message content you want to send"
          },
          "attachment": {
            "type": "string",
            "description": "A public URL to an attachment (e.g., image, PDF, video)"
          },
          "filename": {
            "type": "string",
            "description": "The name of the attachment file"
          }
        }
      },
      "MessageResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "A message describing the result of the operation"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message with details about what went wrong"
          }
        }
      },
      "MediaTypes": {
        "type": "object",
        "description": "Supported media types and their specifications",
        "properties": {
          "images": {
            "type": "object",
            "description": "Image file specifications",
            "properties": {
              "maxSize": {
                "type": "string",
                "example": "5 MB"
              },
              "formats": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "extension": {
                      "type": "string",
                      "example": ".jpeg"
                    },
                    "mimeType": {
                      "type": "string",
                      "example": "image/jpeg"
                    }
                  }
                }
              }
            }
          },
          "videos": {
            "type": "object",
            "description": "Video file specifications",
            "properties": {
              "maxSize": {
                "type": "string",
                "example": "16 MB"
              },
              "formats": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "extension": {
                      "type": "string",
                      "example": ".mp4"
                    },
                    "mimeType": {
                      "type": "string",
                      "example": "video/mp4"
                    }
                  }
                }
              }
            }
          },
          "documents": {
            "type": "object",
            "description": "Document file specifications",
            "properties": {
              "maxSize": {
                "type": "string",
                "example": "100 MB"
              },
              "formats": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "extension": {
                      "type": "string",
                      "example": ".pdf"
                    },
                    "mimeType": {
                      "type": "string",
                      "example": "application/pdf"
                    }
                  }
                }
              }
            }
          },
          "audio": {
            "type": "object",
            "description": "Audio file specifications",
            "properties": {
              "maxSize": {
                "type": "string",
                "example": "16 MB"
              },
              "formats": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "extension": {
                      "type": "string",
                      "example": ".mp3"
                    },
                    "mimeType": {
                      "type": "string",
                      "example": "audio/mpeg"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
} 