Skip to content

Commit c54a986

Browse files
committed
Added links to docs
1 parent 8c2b202 commit c54a986

10 files changed

Lines changed: 168 additions & 22 deletions

File tree

whatsapp_api_client_python/tools/account.py

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def __init__(self, api: "GreenApi"):
1414
def getSettings(self) -> Response:
1515
"""
1616
The method is aimed for getting the current account settings.
17+
18+
https://green-api.com/en/docs/api/account/GetSettings/
1719
"""
1820

1921
return self.api.request(
@@ -27,6 +29,8 @@ def getWaSettings(self) -> Response:
2729
"""
2830
The method is aimed to get information about the WhatsApp
2931
account.
32+
33+
https://green-api.com/en/docs/api/account/GetWaSettings/
3034
"""
3135

3236
return self.api.request(
@@ -37,7 +41,11 @@ def getWaSettings(self) -> Response:
3741
)
3842

3943
def setSettings(self, requestBody: Dict[str, Union[int, str]]) -> Response:
40-
"""The method is aimed for setting account settings."""
44+
"""
45+
The method is aimed for setting account settings.
46+
47+
https://green-api.com/en/docs/api/account/SetSettings/
48+
"""
4149

4250
return self.api.request(
4351
"POST", (
@@ -47,7 +55,11 @@ def setSettings(self, requestBody: Dict[str, Union[int, str]]) -> Response:
4755
)
4856

4957
def getStateInstance(self) -> Response:
50-
"""The method is aimed for getting the account state."""
58+
"""
59+
The method is aimed for getting the account state.
60+
61+
https://green-api.com/en/docs/api/account/GetStateInstance/
62+
"""
5163

5264
return self.api.request(
5365
"GET", (
@@ -60,6 +72,8 @@ def getStatusInstance(self) -> Response:
6072
"""
6173
The method is aimed for getting the status of the account
6274
instance socket connection with WhatsApp.
75+
76+
https://green-api.com/en/docs/api/account/GetStatusInstance/
6377
"""
6478

6579
return self.api.request(
@@ -70,7 +84,11 @@ def getStatusInstance(self) -> Response:
7084
)
7185

7286
def reboot(self) -> Response:
73-
"""The method is aimed for rebooting an account."""
87+
"""
88+
The method is aimed for rebooting an account.
89+
90+
https://green-api.com/en/docs/api/account/Reboot/
91+
"""
7492

7593
return self.api.request(
7694
"GET", (
@@ -79,7 +97,11 @@ def reboot(self) -> Response:
7997
)
8098

8199
def logout(self) -> Response:
82-
"""The method is aimed for logging out an account."""
100+
"""
101+
The method is aimed for logging out an account.
102+
103+
https://green-api.com/en/docs/api/account/Logout/
104+
"""
83105

84106
return self.api.request(
85107
"GET", (
@@ -88,14 +110,22 @@ def logout(self) -> Response:
88110
)
89111

90112
def qr(self) -> Response:
91-
"""The method is aimed for getting QR code."""
113+
"""
114+
The method is aimed for getting QR code.
115+
116+
https://green-api.com/en/docs/api/account/QR/
117+
"""
92118

93119
return self.api.request(
94120
"GET", "{{host}}/waInstance{{idInstance}}/qr/{{apiTokenInstance}}"
95121
)
96122

97123
def setProfilePicture(self, path: str) -> Response:
98-
"""The method is aimed for setting an account picture."""
124+
"""
125+
The method is aimed for setting an account picture.
126+
127+
https://green-api.com/en/docs/api/account/SetProfilePicture/
128+
"""
99129

100130
file_name = Path(path).name
101131
files = {"file": (file_name, open(path, "rb"), "image/jpeg")}

whatsapp_api_client_python/tools/device.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def getDeviceInfo(self) -> Response:
1414
"""
1515
The method is aimed for getting information about the device
1616
(phone) running WhatsApp Business application.
17+
18+
https://green-api.com/en/docs/api/phone/GetDeviceInfo/
1719
"""
1820

1921
return self.api.request(

whatsapp_api_client_python/tools/groups.py

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ def __init__(self, api: "GreenApi"):
1212
self.api = api
1313

1414
def createGroup(self, groupName: str, chatIds: List[str]) -> Response:
15-
"""The method is aimed for creating a group chat."""
15+
"""
16+
The method is aimed for creating a group chat.
17+
18+
https://green-api.com/en/docs/api/groups/CreateGroup/
19+
"""
1620

1721
request_body = self.__handle_parameters(locals())
1822

@@ -24,7 +28,11 @@ def createGroup(self, groupName: str, chatIds: List[str]) -> Response:
2428
)
2529

2630
def updateGroupName(self, groupId: str, groupName: str) -> Response:
27-
"""The method changes a group chat name."""
31+
"""
32+
The method changes a group chat name.
33+
34+
https://green-api.com/en/docs/api/groups/UpdateGroupName/
35+
"""
2836

2937
request_body = self.__handle_parameters(locals())
3038

@@ -36,7 +44,11 @@ def updateGroupName(self, groupId: str, groupName: str) -> Response:
3644
)
3745

3846
def getGroupData(self, groupId: str) -> Response:
39-
"""The method gets group chat data."""
47+
"""
48+
The method gets group chat data.
49+
50+
https://green-api.com/en/docs/api/groups/GetGroupData/
51+
"""
4052

4153
request_body = self.__handle_parameters(locals())
4254

@@ -50,7 +62,11 @@ def getGroupData(self, groupId: str) -> Response:
5062
def addGroupParticipant(
5163
self, groupId: str, participantChatId: str
5264
) -> Response:
53-
"""The method adds a participant to a group chat."""
65+
"""
66+
The method adds a participant to a group chat.
67+
68+
https://green-api.com/en/docs/api/groups/AddGroupParticipant/
69+
"""
5470

5571
request_body = self.__handle_parameters(locals())
5672

@@ -64,7 +80,11 @@ def addGroupParticipant(
6480
def removeGroupParticipant(
6581
self, groupId: str, participantChatId: str
6682
) -> Response:
67-
"""The method removes a participant from a group chat."""
83+
"""
84+
The method removes a participant from a group chat.
85+
86+
https://green-api.com/en/docs/api/groups/RemoveGroupParticipant/
87+
"""
6888

6989
request_body = self.__handle_parameters(locals())
7090

@@ -78,6 +98,8 @@ def removeGroupParticipant(
7898
def setGroupAdmin(self, groupId: str, participantChatId: str) -> Response:
7999
"""
80100
The method sets a group chat participant as an administrator.
101+
102+
https://green-api.com/en/docs/api/groups/SetGroupAdmin/
81103
"""
82104

83105
request_body = self.__handle_parameters(locals())
@@ -93,6 +115,8 @@ def removeAdmin(self, groupId: str, participantChatId: str) -> Response:
93115
"""
94116
The method removes a participant from group chat administration
95117
rights.
118+
119+
https://green-api.com/en/docs/api/groups/RemoveAdmin/
96120
"""
97121

98122
request_body = self.__handle_parameters(locals())
@@ -105,7 +129,11 @@ def removeAdmin(self, groupId: str, participantChatId: str) -> Response:
105129
)
106130

107131
def setGroupPicture(self, groupId: str, path: str) -> Response:
108-
"""The method sets a group picture."""
132+
"""
133+
The method sets a group picture.
134+
135+
https://green-api.com/en/docs/api/groups/SetGroupPicture/
136+
"""
109137

110138
request_body = self.__handle_parameters(locals())
111139

@@ -124,6 +152,8 @@ def setGroupPicture(self, groupId: str, path: str) -> Response:
124152
def leaveGroup(self, groupId: str) -> Response:
125153
"""
126154
The method makes the current account user leave the group chat.
155+
156+
https://green-api.com/en/docs/api/groups/LeaveGroup/
127157
"""
128158

129159
request_body = self.__handle_parameters(locals())

whatsapp_api_client_python/tools/journals.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ def __init__(self, api: "GreenApi"):
1313
def getChatHistory(
1414
self, chatId: str, count: Optional[int] = None
1515
) -> Response:
16-
"""The method returns the chat message history."""
16+
"""
17+
The method returns the chat message history.
18+
19+
https://green-api.com/en/docs/api/journals/GetChatHistory/
20+
"""
1721

1822
request_body = locals()
1923
if count is None:
@@ -28,7 +32,11 @@ def getChatHistory(
2832
)
2933

3034
def getMessage(self, chatId: str, idMessage: str) -> Response:
31-
"""The method returns the chat message."""
35+
"""
36+
The method returns the chat message.
37+
38+
https://green-api.com/en/docs/api/journals/GetMessage/
39+
"""
3240

3341
request_body = locals()
3442
request_body.pop("self")
@@ -43,6 +51,8 @@ def getMessage(self, chatId: str, idMessage: str) -> Response:
4351
def lastIncomingMessages(self, minutes: Optional[int] = None) -> Response:
4452
"""
4553
The method returns the last incoming messages of the account.
54+
55+
https://green-api.com/en/docs/api/journals/LastIncomingMessages/
4656
"""
4757

4858
request_body = None
@@ -59,6 +69,8 @@ def lastIncomingMessages(self, minutes: Optional[int] = None) -> Response:
5969
def lastOutgoingMessages(self, minutes: Optional[int] = None) -> Response:
6070
"""
6171
The method returns the last outgoing messages of the account.
72+
73+
https://green-api.com/en/docs/api/journals/LastOutgoingMessages/
6274
"""
6375

6476
request_body = None

whatsapp_api_client_python/tools/marking.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def readChat(
1515
) -> Response:
1616
"""
1717
The method is aimed for marking messages in a chat as read.
18+
19+
https://green-api.com/en/docs/api/marks/ReadChat/
1820
"""
1921

2022
request_body = locals()

whatsapp_api_client_python/tools/queues.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def showMessagesQueue(self) -> Response:
1414
"""
1515
The method is aimed for getting a list of messages in the queue
1616
to be sent.
17+
18+
https://green-api.com/en/docs/api/queues/ShowMessagesQueue/
1719
"""
1820

1921
return self.api.request(
@@ -27,6 +29,8 @@ def clearMessagesQueue(self) -> Response:
2729
"""
2830
The method is aimed for clearing the queue of messages to be
2931
sent.
32+
33+
https://green-api.com/en/docs/api/queues/ClearMessagesQueue/
3034
"""
3135

3236
return self.api.request(

whatsapp_api_client_python/tools/receiving.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def receiveNotification(self) -> Response:
1414
"""
1515
The method is aimed for receiving one incoming notification
1616
from the notifications queue.
17+
18+
https://green-api.com/en/docs/api/receiving/technology-http-api/ReceiveNotification/
1719
"""
1820

1921
return self.api.request(
@@ -27,6 +29,8 @@ def deleteNotification(self, receiptId: int) -> Response:
2729
"""
2830
The method is aimed for deleting an incoming notification from
2931
the notification queue.
32+
33+
https://green-api.com/en/docs/api/receiving/technology-http-api/DeleteNotification/
3034
"""
3135

3236
url = (
@@ -39,6 +43,8 @@ def deleteNotification(self, receiptId: int) -> Response:
3943
def downloadFile(self, chatId: str, idMessage: str) -> Response:
4044
"""
4145
The method is aimed for downloading incoming and outgoing files.
46+
47+
https://green-api.com/en/docs/api/receiving/files/DownloadFile/
4248
"""
4349

4450
request_body = locals()

0 commit comments

Comments
 (0)