track/stream 401

114 views
Skip to first unread message

woeb...@gmail.com

unread,
Apr 26, 2012, 7:55:28 PM4/26/12
to 7digit...@googlegroups.com
I am trying a code for generating track/stream URL in javascript:

function sevDig(trackID)
{
accessor = { consumerSecret: 'secret' },
params = [
['oauth_nonce',OAuth.nonce(11)],
['oauth_timestamp',OAuth.timestamp()],
['oauth_signature_method','HMAC-SHA1'],
['trackId', trackID],
['oauth_consumer_key','7dednkup8zjv'],
['userId','random_string']
]
var message = { 
method: "GET", 
action: base, 
parameters: params
};
OAuth.SignatureMethod.sign(message, accessor);
var url = base + '?' + OAuth.SignatureMethod.normalizeParameters(params) + "&oauth_signature=" +
        OAuth.getParameter(params, "oauth_signature");

return url;
}

filip

unread,
Apr 30, 2012, 12:07:38 PM4/30/12
to 7digital API Developers
Hi,

full-length streaming is a premium API feature and you'll need it
enabled for your API key before you can access the track/stream
endpoint.

Please contact us at sa...@7digital.com for further info.

Many thanks
Filip
7digital

On Apr 27, 12:55 am, woebeg...@gmail.com wrote:
> I am trying a code for generating track/stream URL in javascript:
>
> function sevDig(trackID)
> {
> var base = "http://stream.geo.7digital.com/media/track/stream",
> accessor = { consumerSecret: 'secret' },
> params = [
> ['oauth_nonce',OAuth.nonce(11)],
> ['oauth_timestamp',OAuth.timestamp()],
> ['oauth_signature_method','HMAC-SHA1'],
> ['trackId', trackID],
> ['oauth_consumer_key','7dednkup8zjv'],
> ['userId','random_string']
> ]
> var message = {
> method: "GET",
> action: base,
> parameters: params};
>
> OAuth.SignatureMethod.sign(message, accessor);
> var url = base + '?' + OAuth.SignatureMethod.normalizeParameters(params) +
> "&oauth_signature=" +
>         OAuth.getParameter(params, "oauth_signature");
>
> return url;
>
> }
>
> It works actualy, and returns an URL like this:
>
> http://stream.geo.7digital.com/media/track/stream?oauth_consumer_key=...<http://stream.geo.7digital.com/media/track/stream?oauth_consumer_key=...>
>
> But when i try to open this URL in a browser window, i am facing the error:
>
> Error Code: *401
>
>
>
>
>
>
>
> > *Error Message: Response does not contain a user. Error: Authorization
> > failed for method <GET> and URL
> > <http://stream.geo.7digital.com/media/track/stream?oauth_consumer_key=...>.
> > Access to resource denied.
Reply all
Reply to author
Forward
0 new messages