Browse Source

chore: update documentation

feat(openapi.yaml): add newsletter support with new paths and schemas
docs(readme.md): update API endpoints including newsletter and images
fix(openapi.yaml): correct duplicated summary text for user my newsletters
pull/204/head
Aldino Kemal 1 year ago
parent
commit
f094a5ff6c
  1. 303
      docs/openapi.yaml
  2. 7
      readme.md

303
docs/openapi.yaml

@ -1,7 +1,7 @@
openapi: 3.0.0
info:
title: WhatsApp API MultiDevice
version: 4.2.0
version: 4.3.0
description: This API is used for sending whatsapp via API
servers:
- url: http://localhost:3000
@ -16,6 +16,8 @@ tags:
description: Message manipulation (revoke/react/update).
- name: group
description: Group setting
- name: newsletter
description: newsletter setting
paths:
/app/login:
get:
@ -212,6 +214,31 @@ paths:
- user
summary: User My List Groups
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/UserGroupResponse'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInternalServer'
/user/my/newsletters:
get:
operationId: userMyNewsletter
tags:
- user
summary: User My List Groups
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/NewsletterResponse'
'500':
description: Internal Server Error
content:
@ -1042,6 +1069,40 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ErrorInternalServer'
/newsletter/unfollow:
post:
operationId: unfollowNewsletter
tags:
- newsletter
summary: Unfollow newsletter
requestBody:
content:
application/json:
schema:
type: object
properties:
newsletter_id:
type: string
example: '120363024512399999@newsletter'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GenericResponse'
'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'
components:
schemas:
@ -1341,4 +1402,242 @@ components:
results:
type: object
example: null
description: 'additional data'
description: 'additional data'
NewsletterResponse:
type: object
properties:
code:
type: string
example: "SUCCESS"
message:
type: string
example: "Success get list newsletter"
results:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Newsletter'
Newsletter:
type: object
properties:
id:
type: string
example: "120363144038483540@newsletter"
state:
type: object
properties:
type:
type: string
example: "active"
thread_metadata:
type: object
properties:
creation_time:
type: string
example: "1688746895"
invite:
type: string
example: "0029Va4K0PZ5a245NkngBA2M"
name:
type: object
properties:
text:
type: string
example: "WhatsApp"
id:
type: string
example: "1688746895480511"
update_time:
type: string
example: "1688746895480511"
description:
type: object
properties:
text:
type: string
example: "WhatsApp’s official channel. Follow for our latest feature launches, updates, exclusive drops and more."
id:
type: string
example: "1689653839450668"
update_time:
type: string
example: "1689653839450668"
subscribers_count:
type: string
example: "0"
verification:
type: string
example: "verified"
picture:
type: object
properties:
url:
type: string
example: ""
id:
type: string
example: "1707950960975554"
type:
type: string
example: "IMAGE"
direct_path:
type: string
example: "/v/t61.24694-24/416962407_970228831134395_8869146381947923973_n.jpg?ccb=11-4&oh=01_Q5AaIIvOIeu3l0HCZWILrmr-dGR_vXFqnhUeytw0-ojPc4hL&oe=670D95B1&_nc_sid=5e03e0&_nc_cat=110"
preview:
type: object
properties:
url:
type: string
example: ""
id:
type: string
example: "1707950960975554"
type:
type: string
example: "PREVIEW"
direct_path:
type: string
example: "/v/t61.24694-24/416962407_970228831134395_8869146381947923973_n.jpg?stp=dst-jpg_s192x192&ccb=11-4&oh=01_Q5AaIHO-DQklqm3q3awF7xwji_WAn9DkgZASQA0B2Ct0qbSa&oe=670D95B1&_nc_sid=5e03e0&_nc_cat=110"
settings:
type: object
properties:
reaction_codes:
type: object
properties:
value:
type: string
example: "ALL"
viewer_metadata:
type: object
properties:
mute:
type: string
example: "off"
role:
type: string
example: "subscriber"
GroupResponse:
type: object
properties:
code:
type: string
example: "SUCCESS"
message:
type: string
example: "Success get list groups"
results:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Group'
Group:
type: object
properties:
JID:
type: string
example: "120363347168689807@g.us"
OwnerJID:
type: string
example: "6288228744537@s.whatsapp.net"
Name:
type: string
example: "Example Group"
NameSetAt:
type: string
format: date-time
example: "2024-10-11T21:27:29+07:00"
NameSetBy:
type: string
example: "6288228744537@s.whatsapp.net"
Topic:
type: string
example: ""
TopicID:
type: string
example: ""
TopicSetAt:
type: string
format: date-time
example: "0001-01-01T00:00:00Z"
TopicSetBy:
type: string
example: ""
TopicDeleted:
type: boolean
example: false
IsLocked:
type: boolean
example: false
IsAnnounce:
type: boolean
example: false
AnnounceVersionID:
type: string
example: "1728656849439709"
IsEphemeral:
type: boolean
example: false
DisappearingTimer:
type: integer
example: 0
IsIncognito:
type: boolean
example: false
IsParent:
type: boolean
example: false
DefaultMembershipApprovalMode:
type: string
example: ""
LinkedParentJID:
type: string
example: ""
IsDefaultSubGroup:
type: boolean
example: false
IsJoinApprovalRequired:
type: boolean
example: false
GroupCreated:
type: string
format: date-time
example: "2024-10-11T21:27:29+07:00"
ParticipantVersionID:
type: string
example: "1728656849439790"
Participants:
type: array
items:
$ref: '#/components/schemas/Participant'
MemberAddMode:
type: string
example: "admin_add"
Participant:
type: object
properties:
JID:
type: string
example: "6288228744537@s.whatsapp.net"
LID:
type: string
example: "20036609675500@lid"
IsAdmin:
type: boolean
example: true
IsSuperAdmin:
type: boolean
example: true
DisplayName:
type: string
example: ""
Error:
type: integer
example: 0
AddRequest:
type: string
example: null

7
readme.md

@ -112,7 +112,8 @@ You can fork or edit this source code !
| ✅ | Devices | GET | /app/devices |
| ✅ | User Info | GET | /user/info |
| ✅ | User Avatar | GET | /user/avatar |
| ✅ | User My Group List | GET | /user/my/groups |
| ✅ | User My Groups | GET | /user/my/groups |
| ✅ | User My Newsletter | GET | /user/my/newsletters |
| ✅ | User My Privacy Setting | GET | /user/my/privacy |
| ✅ | Send Message | POST | /send/message |
| ✅ | Send Image | POST | /send/image |
@ -135,6 +136,7 @@ You can fork or edit this source code !
| ✅ | Remove Participant in Group | POST | /group/participants/remove |
| ✅ | Promote Participant in Group | POST | /group/participants/promote |
| ✅ | Demote Participant in Group | POST | /group/participants/demote |
| ✅ | Unfollow Newsletter | POST | /group/newsletter/unfollow |
```
✅ = Available
@ -145,7 +147,7 @@ You can fork or edit this source code !
| Description | Image |
|--------------------|------------------------------------------------------------------------------------------|
| Homepage | ![Homepage](https://i.ibb.co.com/L0B1LVb/homepage-v4-16.png) |
| Homepage | ![Homepage](https://i.ibb.co.com/Sy0dHZp/homepage-v4-20.png) |
| Login | ![Login](https://i.ibb.co.com/jkcB15R/login.png?v=1) |
| Login With Code | ![Login With Code](https://i.ibb.co.com/rdJGvGw/paircode.png) |
| Send Message | ![Send Message](https://i.ibb.co.com/rc3NXMX/send-message.png?v1) |
@ -167,6 +169,7 @@ You can fork or edit this source code !
| Auto Reply | ![Auto Reply](https://i.ibb.co.com/D4rTytX/IMG-20220517-162500.jpg) |
| Basic Auth Prompt | ![Basic Auth Prompt](https://i.ibb.co.com/PDjQ92W/Screenshot-2022-11-06-at-14-06-29.png) |
| Manage Participant | ![Manage Participant](https://i.ibb.co.com/ynrN7cr/manage-participant.png) |
| My Newsletter | ![List Newsletter](https://i.ibb.co.com/WDg50jJ/image.png) |
### Mac OS NOTE

Loading…
Cancel
Save