Skip to content

Commit

Permalink
add integrated swagger api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaskiddo committed May 9, 2022
1 parent 3017a93 commit 3ea0b64
Show file tree
Hide file tree
Showing 8 changed files with 708 additions and 73 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ The build result will shown in build directory

You can access any endpoint under **BASE_URL** environment variable which by default located at *.env* file.

Integrated API Documentation can be accessed in **BASE_URL**/docs/index.html or by default it's in `127.0.0.1:3000/api/v1/whatsapp/docs/index.html`

## Built With

* [Go](https://golang.org/) - Go Programming Languange
Expand Down
249 changes: 233 additions & 16 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ const docTemplate = `{
"/api/v1/whatsapp": {
"get": {
"description": "Get The Server Status",
"consumes": [
"*/*"
],
"produces": [
"application/json"
],
Expand All @@ -48,9 +45,6 @@ const docTemplate = `{
}
],
"description": "Get Authentication Token",
"consumes": [
"*/*"
],
"produces": [
"application/json"
],
Expand All @@ -74,7 +68,7 @@ const docTemplate = `{
],
"description": "Get QR Code for WhatsApp Multi-Device Login",
"consumes": [
"*/*"
"multipart/form-data"
],
"produces": [
"application/json",
Expand All @@ -94,7 +88,7 @@ const docTemplate = `{
"default": "html",
"description": "Change Output Format in HTML or JSON",
"name": "output",
"in": "query"
"in": "formData"
}
],
"responses": {
Expand All @@ -112,16 +106,191 @@ const docTemplate = `{
}
],
"description": "Make Device Logout from WhatsApp Multi-Device",
"produces": [
"application/json"
],
"tags": [
"WhatsApp"
],
"summary": "Logout Device from WhatsApp Multi-Device",
"responses": {
"200": {
"description": ""
}
}
}
},
"/api/v1/whatsapp/send/audio": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Send Audio Message to Spesific Phone Number",
"consumes": [
"*/*"
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"WhatsApp"
],
"summary": "Logout Device from WhatsApp Multi-Device",
"summary": "Send Audio Message",
"parameters": [
{
"type": "string",
"description": "Destination Phone Number",
"name": "msisdn",
"in": "formData",
"required": true
},
{
"type": "file",
"description": "Audio File",
"name": "audio",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": ""
}
}
}
},
"/api/v1/whatsapp/send/document": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Send Document Message to Spesific Phone Number",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"WhatsApp"
],
"summary": "Send Document Message",
"parameters": [
{
"type": "string",
"description": "Destination Phone Number",
"name": "msisdn",
"in": "formData",
"required": true
},
{
"type": "file",
"description": "Document File",
"name": "document",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": ""
}
}
}
},
"/api/v1/whatsapp/send/image": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Send Image Message to Spesific Phone Number",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"WhatsApp"
],
"summary": "Send Image Message",
"parameters": [
{
"type": "string",
"description": "Destination Phone Number",
"name": "msisdn",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Caption Image Message",
"name": "caption",
"in": "formData",
"required": true
},
{
"type": "file",
"description": "Image File",
"name": "image",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": ""
}
}
}
},
"/api/v1/whatsapp/send/location": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Send Location Message to Spesific Phone Number",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"WhatsApp"
],
"summary": "Send Location Message",
"parameters": [
{
"type": "string",
"description": "Destination Phone Number",
"name": "msisdn",
"in": "formData",
"required": true
},
{
"type": "number",
"description": "Location Latitude",
"name": "latitude",
"in": "formData",
"required": true
},
{
"type": "number",
"description": "Location Longitude",
"name": "longitude",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": ""
Expand All @@ -136,30 +305,78 @@ const docTemplate = `{
"BearerAuth": []
}
],
"description": "Make Device Logout from WhatsApp Multi-Device",
"description": "Send Text Message to Spesific Phone Number",
"consumes": [
"*/*"
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"WhatsApp"
],
"summary": "Logout Device from WhatsApp Multi-Device",
"summary": "Send Text Message",
"parameters": [
{
"type": "string",
"description": "Destination Phone Number",
"name": "msisdn",
"in": "query",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Text Message Content",
"description": "Text Message",
"name": "message",
"in": "query",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": ""
}
}
}
},
"/api/v1/whatsapp/send/video": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Send Video Message to Spesific Phone Number",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"WhatsApp"
],
"summary": "Send Video Message",
"parameters": [
{
"type": "string",
"description": "Destination Phone Number",
"name": "msisdn",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Caption Video Message",
"name": "caption",
"in": "formData",
"required": true
},
{
"type": "file",
"description": "Video File",
"name": "video",
"in": "formData",
"required": true
}
],
Expand Down
Loading

0 comments on commit 3ea0b64

Please sign in to comment.