-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththree65smsapi.py
63 lines (56 loc) · 2.01 KB
/
three65smsapi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import requests
class three65sms:
def __init__(self, api_key):
self.api_key = api_key
def getnumbersstatus(self, country, operator):
params = {
'api_key': self.api_key,
'action': 'getNumbersStatus',
'country': country,
'operator': operator
}
request = requests.get(url='https://365sms.ru/stubs/handler_api.php', params=params)
return request.json()
def getbalance(self):
params = {
'api_key': self.api_key,
'action': 'getBalance'
}
request = requests.get(url='https://365sms.ru/stubs/handler_api.php', params=params)
return request.text
def buynumber(self, service, country, operator):
params = {
'api_key': self.api_key,
'action': 'getNumber',
'country': country,
'operator': operator,
'service': service
}
request = requests.get(url='https://365sms.ru/stubs/handler_api.php', params=params)
return request.text
def setnumberstatus(self, id, status):
params = {
'api_key': self.api_key,
'action': 'setStatus',
'id': id,
'status': status
}
request = requests.get(url='https://365sms.ru/stubs/handler_api.php', params=params)
return request.text
def getnumberstatus(self, id):
params = {
'api_key': self.api_key,
'action': 'getStatus',
'id': id
}
request = requests.get(url='https://365sms.ru/stubs/handler_api.php', params=params)
return request.text
def getallprices(self, service, country):
params = {
'api_key': self.api_key,
'action': 'getPrices',
'country': country,
'service': service
}
request = requests.get(url='https://365sms.ru/stubs/handler_api.php', params=params)
return request.json()