Browse Source

feat: update docs

pull/36/head
Aldino Kemal 3 years ago
parent
commit
19b1af41c5
  1. 122
      docs/openapi.yaml

122
docs/openapi.yaml

@ -1,7 +1,7 @@
openapi: 3.0.0 openapi: 3.0.0
info: info:
title: WhatsApp API MultiDevice title: WhatsApp API MultiDevice
version: 2.5.0
version: 3.0.0
description: This API is used for sending whatsapp via API description: This API is used for sending whatsapp via API
servers: servers:
- url: http://localhost:3000 - url: http://localhost:3000
@ -10,8 +10,8 @@ tags:
description: Initial Connection to Whatsapp server description: Initial Connection to Whatsapp server
- name: user - name: user
description: Getting information description: Getting information
- name: send
description: Send Message (Text/Image/File/Video)
- name: message
description: Send or Manipulate Message (Text/Image/File/Video).
paths: paths:
/app/login: /app/login:
get: get:
@ -118,7 +118,7 @@ paths:
in: query in: query
schema: schema:
type: integer type: integer
example: '6289685024091'
example: '6289685028129@s.whatsapp.net'
responses: responses:
'200': '200':
description: OK description: OK
@ -155,17 +155,17 @@ paths:
status: you are blocked status: you are blocked
picture_id: '1635239861' picture_id: '1635239861'
devices: devices:
- User: '6289685024091'
- User: '6289685028129@s.whatsapp.net'
Agent: 0 Agent: 0
Device: UNKNOWN Device: UNKNOWN
Server: s.whatsapp.net Server: s.whatsapp.net
AD: true AD: true
- User: '6289685024091'
- User: '6289685028129@s.whatsapp.net'
Agent: 0 Agent: 0
Device: SAFARI Device: SAFARI
Server: s.whatsapp.net Server: s.whatsapp.net
AD: true AD: true
- User: '6289685024091'
- User: '6289685028129@s.whatsapp.net'
Agent: 0 Agent: 0
Device: IPAD Device: IPAD
Server: s.whatsapp.net Server: s.whatsapp.net
@ -193,7 +193,7 @@ paths:
in: query in: query
schema: schema:
type: integer type: integer
example: '6289685024091'
example: '6289685028129@s.whatsapp.net'
responses: responses:
'200': '200':
description: OK description: OK
@ -300,7 +300,7 @@ paths:
post: post:
operationId: sendMessage operationId: sendMessage
tags: tags:
- send
- message
summary: Send Message summary: Send Message
requestBody: requestBody:
content: content:
@ -310,14 +310,12 @@ paths:
properties: properties:
phone: phone:
type: integer type: integer
example: '6289685024091'
example: '6289685028129@s.whatsapp.net'
description: Phone number with country code
message: message:
type: string type: string
example: selamat malam example: selamat malam
type:
type: string
example: 'user'
description: 'user/group | default: user'
description: Message to send
responses: responses:
'200': '200':
description: OK description: OK
@ -341,7 +339,7 @@ paths:
post: post:
operationId: sendImage operationId: sendImage
tags: tags:
- send
- message
summary: Send Image summary: Send Image
requestBody: requestBody:
content: content:
@ -351,23 +349,24 @@ paths:
properties: properties:
phone: phone:
type: integer type: integer
example: '6289685024091'
example: '6289685028129@s.whatsapp.net'
description: Phone number with country code
caption: caption:
type: string type: string
example: selamat malam example: selamat malam
description: Caption to send
view_once: view_once:
type: boolean type: boolean
example: false example: false
description: View once
image: image:
type: string type: string
format: binary format: binary
type:
type: string
example: 'user'
description: 'user/group | default: user'
description: Image to send
compress: compress:
type: boolean type: boolean
example: false example: false
description: Compress image
responses: responses:
'200': '200':
description: OK description: OK
@ -391,7 +390,7 @@ paths:
post: post:
operationId: sendFile operationId: sendFile
tags: tags:
- send
- message
summary: Send File summary: Send File
requestBody: requestBody:
content: content:
@ -401,17 +400,16 @@ paths:
properties: properties:
phone: phone:
type: integer type: integer
example: '6289685024091'
example: '6289685028129@s.whatsapp.net'
description: Phone number with country code
caption: caption:
type: string type: string
example: selamat malam example: selamat malam
description: Caption to send
file: file:
type: string type: string
format: binary format: binary
type:
type: string
example: 'user'
description: 'user/group | default: user'
description: File to send
responses: responses:
'200': '200':
description: OK description: OK
@ -435,7 +433,7 @@ paths:
post: post:
operationId: sendVideo operationId: sendVideo
tags: tags:
- send
- message
summary: Send Video summary: Send Video
requestBody: requestBody:
content: content:
@ -445,23 +443,24 @@ paths:
properties: properties:
phone: phone:
type: integer type: integer
example: '6289685024091'
example: '6289685028129@s.whatsapp.net'
description: Phone number with country code
caption: caption:
type: string type: string
example: ini contoh caption video example: ini contoh caption video
description: Caption to send
view_once: view_once:
type: boolean type: boolean
example: 'false' example: 'false'
description: View once
video: video:
type: string type: string
format: binary format: binary
type:
type: string
example: 'user'
description: 'user/group | default: user'
description: Video to send
compress: compress:
type: boolean type: boolean
example: 'false' example: 'false'
description: Compress video
responses: responses:
'200': '200':
description: OK description: OK
@ -485,7 +484,7 @@ paths:
post: post:
operationId: sendContact operationId: sendContact
tags: tags:
- send
- message
summary: Send Contact summary: Send Contact
requestBody: requestBody:
content: content:
@ -495,17 +494,16 @@ paths:
properties: properties:
phone: phone:
type: integer type: integer
example: '6289685024051'
example: '6289685024051@s.whatsapp.net'
description: Phone number with country code
contact_name: contact_name:
type: string type: string
example: Aldino Kemal example: Aldino Kemal
description: Contact name
contact_phone: contact_phone:
type: string type: string
example: '6289685024992' example: '6289685024992'
type:
type: string
example: 'user'
description: 'user/group | default: user'
description: Contact phone number
responses: responses:
'200': '200':
description: OK description: OK
@ -529,7 +527,7 @@ paths:
post: post:
operationId: sendLink operationId: sendLink
tags: tags:
- send
- message
summary: Send Link summary: Send Link
requestBody: requestBody:
content: content:
@ -539,17 +537,55 @@ paths:
properties: properties:
phone: phone:
type: integer type: integer
example: '6289685024051'
example: '6289685024051@s.whatsapp.net'
description: Phone number with country code
link: link:
type: string type: string
example: "https://google.com" example: "https://google.com"
description: Link to send
caption: caption:
type: string type: string
example: 'Halo ini contoh caption' example: 'Halo ini contoh caption'
type:
description: Caption to send
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SendResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorBadRequest'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInternalServer'
/message/:message_id/revoke:
post:
operationId: revokeMessage
tags:
- message
summary: Send Link
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
phone:
type: integer
example: '6289685024051@s.whatsapp.net'
description: Phone number with country code
message_id:
type: string type: string
example: 'user'
description: 'user/group | default: user'
example: "3EB007D87686670344D7"
description: Message ID
responses: responses:
'200': '200':
description: OK description: OK

Loading…
Cancel
Save