array ( 'status' => 'ERROR', 'results' => NULL, 'error' => 'Empty resource', )
POST /stalker_portal/auth/token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded
grant_type=password&username=<username>&password=<password>Here is example (http flow):
POST / stalker_portal / auth / token
If everything OK you should receive JSON response
On Thursday, September 5, 2013 6:23:58 PM UTC +3, orioni wrote:
Hi to allsince the documentation is in russian (i tried via google translate but cant understand) can someone show us an example
how to authorize via API v2?i tried also the developer key but didnt worked for me
thanks
On Saturday, January 26, 2013 7:27:06 PM UTC +1, siegfried mohr wrote:
Maybe who knows?where you can take the documentation for the REST API v2I want to write a plugin for Android.
Looks like you have not installed or Properly Configured mod_rewrite in Apache.
When you Open / stalker_portal / auth / token in the Browser you Should See message " Method not allowed " On Friday, September 6, 2013 4:04:09 PM UTC +3 , orioni wrote:thanks, tried but got this
a2dismod mod_negotiation
Просмотреть это обсуждение в Сети можно по адресу https://groups.google.com/d/msgid/stalker-middleware/a0cecb05-ad3a-4489-9d9e-c3e95545078a%40googlegroups.com.--
Вы получили это сообщение, поскольку подписаны на группу Stalker Middleware.
Чтобы отказаться от подписки на эту группу и перестать получать из нее сообщения, отправьте электронное письмо на адрес stalker-middlew...@googlegroups.com.
Чтобы добавлять сообщения в эту группу, отправьте письмо по адресу stalker-m...@googlegroups.com.
{"status":"OK","results":{"login":"o","full_name":"oo","phone":"","account_number":"124","tariff_plan":"1","stb_sn":"","stb_mac":"","stb_type":"","status":1,"online":"0","ip":"","version":"","comment":"","subscribed":[],"subscribed_id":[]}}You can use IT for authorization, but Without working mod_rewrite API v2 would not work. On Friday, September 6, 2013 4:36:35 PM UTC +3, orioni wrote:
I Get the Method not allowed
strange cause i havent changed the. htacess and the mod_rewrite seems to be enabled and working for other requestsie if i go to
{"status":"OK","results":{"login":"o","full_name":"oo","phone":"","account_number":"124","tariff_plan":"1","stb_sn":"","stb_mac":"","stb_type":"","status":1,"online":"0","ip":"","version":"","comment":"","subscribed":[],"subscribed_id":[]}}
On Friday, September 6, 2013 3:39:33 PM UTC +2, Aleksey Zhurbitsky wrote:
$ Dd = strlen ($ obj-> access_token); if ($ dd == 37) { $ Html. = "<b Style='color:green;'> Ok </ b>"; $ Done_test + +; } else { $ Html. = "<b Style='color:red;'> Invalid length. </ B>"; <------------------------------------------------ $ Fail_test + +; }What do you mean by "invalid length"?
Responses are both correct. On Friday, September 6, 2013 4:54:08 PM UTC +3, orioni wrote:using the auth / token.php Directly I Get thisand the Files on the test / rest_api I Get the token but IT says "Invalid length"
{"token_type":"bearer","access_token":"5.5c98c3e0b4795406cb0fd88ac44be1ca","refresh_token":"b1d674570401a19cd29ccd9c5fefc0a3","user_id":5,"expires_in":86400}but using the informir URL it gives the correct access_token lenght
I do not know What is IT. On Friday, September 6, 2013 5:08:05 PM UTC +3, orioni wrote:
its from this
$ Dd = strlen ($ obj-> access_token);if ($ dd == 37) {$ Html. = "<b Style='color:green;'> Ok </ b>";$ Done_test + +;}else {$ Html. = "<b Style='color:red;'> Invalid length. </ B>"; <--------------------------- - -------------------
$ Fail_test + +;}
What do you mean by "invalid length"?
Responses are both correct. On Friday, September 6, 2013 4:54:08 PM UTC +3, orioni wrote:
using the auth / token.php Directly I Get this
and the Files on the test / rest_api I Get the token but IT says "Invalid length"{"token_type":"bearer","access_token":"5.5c98c3e0b4795406cb0fd88ac44be1ca","refresh_token":"b1d674570401a19cd29ccd9c5fefc0a3","user_id":5,"expires_in":86400}but using the informir URL it gives the correct access_token lenght
Friday, September 6, 2013 3:45:19 PM UTC +2, orioni wrote:
strange Cause I havent changed the. htacess and the mod_rewrite Seems to be enabled and working for Other requests
This is old code not used. On Friday, September 6, 2013 5:14:23 PM UTC +3, orioni wrote:
its on the index.php file on
/ Stalker_portal / test / rest_api / index.php
On Friday, September 6, 2013 4:10:38 PM UTC +2, Aleksey Zhurbitsky wrote:
I do not know What is IT. On Friday, September 6, 2013 5:08:05 PM UTC +3, orioni wrote:
its from this
$ Dd = strlen ($ obj-> access_token);if ($ dd == 37) {$ Html. = "<b Style='color:green;'> Ok </ b>";$ Done_test + +;}else {
$ Html. = "Invalid length <b Style='color:red;'>. </ B>"; <------------------------ ---- -------------------$ Fail_test + +;}
array (
'status' => 'ERROR',
'results' => NULL,
'error' => 'Authorization required',
)
Opening http://v2.api.stalker. COM / token / Via Browser I Get
array (
'status' => 'ERROR' ,
'results' => NULL ,
'error' => 'Authorization required' ,
)
On Friday, September 6, 2013 4:34:24 PM UTC +2, orioni wrote:
i added the virtual host on apache with a config file like thisadded the hostname to the / etc / hosts
so When I Ping v2.api.stalker.com IT Shows the IP of the Server where STALKER is installed
now doing test i get
PHP Warning: file_get_contents ( http://v2.api.stalker.com/ token / ): failed to Open Stream: HTTP Request failed! HTTP/1.1 406 Not Acceptable
I On Friday, September 6, 2013 4:16:04 PM UTC +2, Aleksey Zhurbitsky wrote:
POST /stalker_portal/auth/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=password&username=<username>&password=<password>
GET /users/<user_id>/tv-channels
Accept: application/json
Authorization: Bearer <access_token>Для начала нужно создать домен вида v2.api.ваш домен.tdl. Ключевыми является "v2.api", по этому вхождению происходит роутинг на API v2.В принципе можно обращаться и к url http://.../stalker_portal/api/api_v2.php?_resource=..., но данный способ не проверялся.Перед обращением к API необходимо пройти процедуру авторизации (п 2.1.1 или 2.1.2) или использовать api_key (только для отладки, п 2.1.4), который нужно предварительно добавить в таблицу developer_api_key с привязкой к конкретному пользователю.
On Tuesday, January 29, 2013 4:12:44 AM UTC+2, siegfried mohr wrote:Большое спасибо за доку. , но немогу разобратся как правильно делать запросы по HTTP.Пробую по запросу: http://xxx.xxx.xxx.xxx/stalker_portal/api/api_v2/...... (accounts или settings или tv-channels)Постоянно получаю одну и ту же информацию.array ( 'status' => 'ERROR', 'results' => NULL, 'error' => 'Empty resource', )Am Montag, 28. Januar 2013 09:51:30 UTC+1 schrieb Aleksey Zhurbitsky:https://docs.google.com/document/d/1Q9aK62XSGEcvYMzlcJ2cIppZhwy824JuCtCfkiIJQu4/edit
1. Какой правильный URL надо указывать для доступа к api?
2. Можно ли через api менять пользователю дополнительные параметры, например, сервер вещания?
3. Запрос на авторизацию и получение токена выполняется сравнительно долго - чуть больше секунды
https://docs.google.com/document/d/1Q9aK62XSGEcvYMzlcJ2cIppZhwy824JuCtCfkiIJQu4/edit
On Saturday, January 26, 2013 8:27:06 PM UTC+2, siegfried mohr wrote:Может кто знает?где можно взять Документацию для REST API v2хочу для Андроид plugin написать.
--
Вы получили это сообщение, поскольку подписаны на группу "Stalker Middleware".
Чтобы отменить подписку на эту группу и больше не получать от нее сообщения, отправьте письмо на электронный адрес stalker-middlew...@googlegroups.com.
Чтобы отправлять сообщения в эту группу, отправьте письмо на электронный адрес stalker-m...@googlegroups.com.
Чтобы посмотреть обсуждение на веб-странице, перейдите по ссылке https://groups.google.com/d/msgid/stalker-middleware/8935b7e7-a854-4f6a-9a8a-d0e9b0fa5ae2%40googlegroups.com.
Чтобы настроить другие параметры, перейдите по ссылке https://groups.google.com/d/optout.