requests.post('https://api.vk.com/method/wall.post', params={'access_token': token,
'owner_id': owner_id_group,
'from_group': 1,
'message': foo,
'signed': 0,
'v':"5.52"}).json()
import vk
session = vk.Session(access_token = 'ea75a2b8ea75a2b8ea75a2b8444a28d865eea75ea7772b8b309c12bd7e647f652e8245a')
api = vk.API(session)
api.messages.send(user_id=165275777, message='тест, если сработало, спасибо')
Traceback (most recent call last):
File "C:\Users\Djeday\Desktop\idle3 - копия.py", line 5, in <module>
api.messages.send(user_id=165275777, message='тест, если сработало, спасибо')
File "C:\Python34\lib\site-packages\vk\api.py", line 173, in __call__
return self._api._session.make_request(self)
File "C:\Python34\lib\site-packages\vk\api.py", line 102, in make_request
raise error
vk.exceptions.VkAPIError: 28. Application authorization failed: method is unavailable with service token.. request_params = {'user_id': '165275777', 'method': 'messages.send', 'message': 'тест, если сработало, спасибо', 'oauth': '1'}
2017-08-03 21:50:13,701 vk mixins:127 INFO: Getting permissions
2017-08-03 21:50:13,764 vk mixins:142 ERROR: Permissions obtained
Traceback (most recent call last):
File "C:\Users\Djeday\Desktop\idle3 - копия.py", line 4, in <module>
session = vk.AuthSession(app_id, login, password, scope='wall')
File "C:\Python34\lib\site-packages\vk\mixins.py", line 32, in __init__
self.access_token = self.get_access_token()
File "C:\Python34\lib\site-packages\vk\mixins.py", line 70, in get_access_token
auth_response_url_query = self.oauth2_authorization()
File "C:\Python34\lib\site-packages\vk\mixins.py", line 143, in oauth2_authorization
raise VkAuthError(error_message)
vk.exceptions.VkAuthError: OAuth2 grant access error
import vk
app_id, login, password = '6126377', 'pass', 'login'
session = vk.AuthSession(app_id, login, password, scope='messages')
api = vk.API(session, v='5.67')
api.messages.send(user_id='280604197', message='любое_сообщение')
2017-08-03 21:58:53,182 vk mixins:127 INFO: Getting permissions
2017-08-03 21:58:53,194 vk mixins:142 ERROR: Permissions obtained
Traceback (most recent call last):
File "C:\Users\Djeday\Desktop\idle3 - копия.py", line 4, in <module>
session = vk.AuthSession(app_id, login, password, scope='messages')
File "C:\Python34\lib\site-packages\vk\mixins.py", line 32, in __init__
self.access_token = self.get_access_token()
File "C:\Python34\lib\site-packages\vk\mixins.py", line 70, in get_access_token
auth_response_url_query = self.oauth2_authorization()
File "C:\Python34\lib\site-packages\vk\mixins.py", line 143, in oauth2_authorization
raise VkAuthError(error_message)
vk.exceptions.VkAuthError: OAuth2 grant access error
i = 1
while i < ids:
print (result['response'][i]['src'])
i += 1
"activityLocationUrl":"http://mnemonlk132.wixsite.com/mysite","activityType":"contact/contact-form","contactUpdate":{"name":{"first":"My","last":"name"},"emails":[{"tag":"main","email":"Myemail@mail.ru"}]},"createdAt":"2017-07-19T13:48:14.361Z"}
{"activityDetails":{"additionalInfoUrl":null,"summary":"<strong>Theme </strong><br>Text message"},"activityInfo":{"fields":[{"name":"name","value":"My name"},{"name":"email","value":"Myemail@mail.ru"},{"name":"subject","value":"Theme "},{"name":"message","value":"Text message"}]},"activityLocationUrl":"http://mnemonlk132.wixsite.com/mysite","activityType":"contact/contact-form","contactUpdate":{"name":{"first":"My","last":"name"},"emails":[{"tag":"main","email":"Myemail@mail.ru"}]},"createdAt":"2017-07-19T13:48:14.361Z"}
import requests
s = requests.Session()
r = requests.post('http://mnemonlk132.wixsite.com/mysite', data = {'name':'My name', 'email':'Myemail@mail.ru', 'subject':'Test', 'message':'Text message'})