So I was able to get the authentication token from STALKER w
ith a POST to http://stalker_middleware.com/stalker_portal/auth/token :{"token_type":"bearer","access_token":"2.796e02f87c2ddde0e8092c9595964924","refresh_token":"fdd99efcf87825e10d57bd5642c658ab","user_id":2,"expires_in":86400,"portal_url":"\/stalker_portal\/","api":{"v2":{"token_type":"bearer"},"v3":{"token_type":"mac","mac_algorithm":"hmac-hash-version","mac_key":"a3f5b9fbf7db1db0a79655cfd2f3e01f"}}}
Now how can I use this to get the list of tv-channels?
From what I understand we can query
http://stalker_middleware.com/stalker_portal/api/v3/users/2/tv-channels and either use MAC scheme or BEARER scheme.
If we're to use the MAC scheme we must use the following authorization pattern:
"
"MAC id=\"received_token\",ts=\"epoch_in_seconds\",nonce=\"unique_string\",mac=\"?????????????????????????????\"";Now how do we calculate the mac needed here? I think it's a SHA-1 but on what?
If we are to use the BEARER scheme we must use the following authorization:
"Bearer ???????????????????";
What are we supposed to use here? It's again probably a SHA-1 but I don't know on what.
If we use the received token we get "error":"UnauthorizedError","message":"Wrong hash version."
If we use the refresh_token we get "error":"UnauthorizedError","message":"Authorization required. Session not found."
Does anybody have any experience with this and can shed some light on it?