shadowsocks/shadowsocks-hub-api

traffic api 401 Unauthorized

rchen9012 opened this issue · 1 comments

  1. I send request to retrieve traffic history as depicted in document:

curl -ik -H "Content-Type: application/json" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkCI6IjEzZmFlMjNiLTg3MjItNDVlOS1iZDg2LTVkNjkyNTA4OGE3YyIsInJvbGUiOiJ1c2VyIiwiaWF0IjoxNTM4MjA0ODUxLCJleHAiOjE1MzgyMDU3NTF9.WdPUM8Ojjh8U45OiwWfB8yvHh-x-k7GJ1E-BojhVjCk" https://localhost:8000/api/traffic/history?id=13fae23b-8722-45e9-bd86-5d6925088a7c
HTTP/1.1 401 Unauthorized
X-Powered-By: Express
X-RateLimit-Limit: 50
X-RateLimit-Remaining: 47
Date: Sat, 29 Sep 2018 07:31:45 GMT
Connection: keep-alive
Transfer-Encoding: chunked

both traffic API has the same problem.

  1. in sshub database structure where is the table relates user_id to account_id ? only Get Accounts by User Id? BTW, https://host_name:port/api/account/accounts_by_user_id?id=account_id should be https://host_name:port/api/account/accounts_by_user_id?id=user_id

Thanks for spotting the typo!

Your request looks failed because the token was not accepted (401 Unauthorized). You may try get a fresh token and try again. Note that there are two types of tokens token and refreshtoken. You should use token here.