Comments (8)
AFAIK you need to pass your app_secret
as an additional parameter when calling secure methods. Something like this should work:
VkontakteApi::Client.new(vk_token).secure.getSMS(uid: 41526347, client_secret: Vkontakte.app_secret)
from vkontakte_api.
I'm getting closer. My guess is something messed up with my scopes, although I verified that i am asking for the "notify" scope. Maybe i'm using an old token? Looks like there is a lot of chatter about this method on google, but hard for me to parse with my shitty russian.
[3] pry(main)> u.vk_client.secure.getSMS(uid: 41526347, client_secret: VkontakteApi.app_secret)
VkontakteApi::Error: VKontakte returned an error 5: 'User authorization failed: server method is unavailable with user token.' after calling method 'secure.getSMS' with parameters {"uid"=>"41526347", "client_secret"=>"blah"}.
from vkontakte_api.
ahhh, maybe this is what i need http://vk.com/developers.php?oid=-17680044&p=Application_Server_Authorization
from vkontakte_api.
Yes, you are trying to call secure methods with a token you got from a usual server authorization, but secure methods require an application server authorization.
Try this instead:
vk = VkontakteApi.authorize(type: :app_server)
vk.secure.getSMS(uid: 41526347, client_secret: VkontakteApi.app_secret)
from vkontakte_api.
Getting closer, but it looks like this method is causing problems for a lot of developers
http://vk.com/topic-12254722_22166247
VkontakteApi.authorize(type: :app_server).secure.sendSMSNotification(client_secret: VkontakteApi.app_secret, uid: 41526347, message: "test")
VkontakteApi::Error: VKontakte returned an error 1: 'Unknown error occured' after calling method 'secure.sendSMSNotification' with parameters {"client_secret"=>"blah", "uid"=>"41526347", "message"=>"test"}.
from vkontakte_api.
It is a different method (topic is about secure.sendNotification
and you need secure.sendSMSNotification
). I don't really see what's causing the problem here unfortunately.
from vkontakte_api.
doh, i'm going to fork your https://github.com/7even/vkontakte_on_rails example and try adding a secure.sendSMS as a sanity check. I have a feeling it's a configuration error
from vkontakte_api.
Did you manage to find something out?
from vkontakte_api.
Related Issues (20)
- Непонятная ошибка HOT 2
- Proxy? HOT 1
- Одновременные запросы HOT 1
- cannot load such file -- typhoeus/adapters/faraday HOT 1
- Уберите строгие зависимости гемов HOT 4
- Как посылать сообщения в сообщества? HOT 3
- Rails 5 HOT 3
- Ограничение запросов в секунду HOT 1
- Working with VK stored procedures HOT 3
- Deprecation warning HOT 9
- Hashie::Mash#count Warning HOT 1
- Возвращаемые значения в методе wall.get HOT 1
- Поведение groups.get в test и development environment HOT 2
- :facepalm: HOT 1
- Версия API стала обязательной на вконтакте HOT 6
- Проблема с зависисмотями HOT 5
- Жив ли проект?
- id33266175 HOT 1
- vzl
- 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vkontakte_api.