OAuth authentication error: Resource not found.

313 views
Skip to first unread message

costi...@gmail.com

unread,
Oct 6, 2014, 6:17:59 AM10/6/14
to 7digit...@googlegroups.com
Hello,

I am trying to implement a two legged authentication, but I receive this error all the time:

Marco Bettiolo

unread,
Oct 6, 2014, 6:48:08 AM10/6/14
to 7digit...@googlegroups.com
Hi Costi,
The link you are generating is wrong, it is missing the endpoint part. What is the flow you are trying to implement? What is the endpoint that you are trying to access?

Here you can find more documentation about OAuth: http://developer.7digital.com/resources/api-docs/oauth-authentication

And this is an example that does OAuth signed requests: http://developer.7digital.com/resources/guides/technical/access-locker-and-download-tracks

Marco

--
You received this message because you are subscribed to the Google Groups "7digital API Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 7digital-api...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




This email, including attachments, is private and confidential. If you have received this email in error please notify the sender and delete it from your system. Emails are not secure and may contain viruses. No liability can be accepted for viruses that might be transferred by this email or any attachment. Any unauthorised copying of this message or unauthorised distribution and publication of the information contained herein are prohibited.

7digital Limited. Registered office: 69 Wilson Street, London EC2A 2BB.
Registered in
England and Wales. Registered No. 04843573.

Costi

unread,
Oct 6, 2014, 7:00:47 AM10/6/14
to 7digit...@googlegroups.com
Thanks for you quick reply, I am trying to get the previews of the tracks, for example: 

clip/{trackId}

Marco Bettiolo

unread,
Oct 6, 2014, 7:36:19 AM10/6/14
to 7digit...@googlegroups.com
Hi Costi,
You are not signing the correct url, you can find that endpoints documentation at this link: http://developer.7digital.com/resources/api-docs/media-delivery-api#Preview_Clips


You can use our OAuth reference page to make test calls to that endpoint: https://7digital.github.io/oauth-reference-page/

Hope this helps :)

Marco

On 6 October 2014 12:00, Costi <costi...@gmail.com> wrote:
Thanks for you quick reply, I am trying to get the previews of the tracks, for example: 

clip/{trackId}

--
You received this message because you are subscribed to the Google Groups "7digital API Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 7digital-api...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Costi

unread,
Oct 6, 2014, 9:17:22 AM10/6/14
to 7digit...@googlegroups.com

Andrés G. Aragoneses

unread,
Oct 6, 2014, 9:19:06 AM10/6/14
to 7digit...@googlegroups.com
You're missing the clip number. Marco used the example number of "1234" in his link.

Costi

unread,
Oct 6, 2014, 9:29:51 AM10/6/14
to 7digit...@googlegroups.com

Alex

unread,
Oct 6, 2014, 9:41:14 AM10/6/14
to 7digit...@googlegroups.com
Andres is correct. The trackId is a URL parameter not a query string parameter.
Before signing, the URL should be something like this:


(Don't forget country, which is a required parameter - check the documentation here: http://developer.7digital.com/resources/api-docs/media-delivery-api#Preview_Clips)

After signing, you should get something like this:


Costi, in your post above, you need a question mark '?' instead of slash '/' after the trackId.

Costi

unread,
Oct 6, 2014, 10:38:48 AM10/6/14
to 7digit...@googlegroups.com
Ok now the link works, thank you very much. Still an other question, how is the signature generated, from what I understand to generate it there are used the following parameters:

countryCode=17111839&oauth_consumer_key=CONSUMER_KEY&oauth_nonce=468402220&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1412606080&oauth_version=1.0

I will base encode this parameters and I'll get the signature, right, or am I missing something?

Alex

unread,
Oct 6, 2014, 11:21:57 AM10/6/14
to 7digit...@googlegroups.com
Hi Costi,

First you should delete "countryCode=17111839" and replace it with "country=GB" (or some other country).

The signature is generated from the entire HTTP request, including the HTTP method (GET), URL and parameters. You must include all these elements when generating the signature, not just the query string parameters. See this for some guidance: http://developer.7digital.com/resources/api-docs/oauth-authentication
As it says on that page, you really should use an OAuth library to generate the signature, rather than doing it yourself (it is complicated!). It is not as simple as just encoding the parameters (a hashing algorithm is used, together with your consumer secret).

Which programming language are you using? We might be able to point you towards some code snippets.

Since you are accessing the preview endpoint, I need to remind you of the conditions of use, especially:
Unless explicitly approved by 7digital and/or content providers any use of preview clips must be associated with a buy button or affiliate links to 7digital's store
Alex

Costi

unread,
Oct 6, 2014, 11:31:31 AM10/6/14
to 7digit...@googlegroups.com
Yes I know about your policy, I am integrating the API for a client, that already spoke with a 7digital representative, they are negotiating a contract, meanwhile I must include everything in the site. I am working with PHP, it would be of great help if you could send me some code snippets on how to proceed further, I already found a script, but it receives only catalog data and besides this information I need the previews. 
Thanks again for your help!

Alex

unread,
Oct 6, 2014, 12:07:51 PM10/6/14
to 7digit...@googlegroups.com
You could try using OAuth.php, available here: http://oauth.googlecode.com/svn/code/php/OAuth.php

Some sample code:

<?php  
require_once("OAuth.php");
$consumer = new OAuthConsumer("YOUR_KEY_HERE", "YOUR_SECRET_HERE");
$req_req = OAuthRequest::from_consumer_and_token($consumer, NULL, "GET", "http://previews.7digital.com/clip/123456");
$req_req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $consumer, NULL);
print $req_req->to_url()
?>

I haven't tried this (I'm not a PHP developer), but I hope it helps you enough to get things working. In the sample above, the parameters (e.g. country=GB) are not being passed to the from_consumer_and_token() method, so you should fix that.

Costi

unread,
Oct 6, 2014, 12:14:02 PM10/6/14
to 7digit...@googlegroups.com
I know about this library, I will try to use it again and I'll post here if it works.

Costi

unread,
Oct 9, 2014, 4:58:49 AM10/9/14
to 7digit...@googlegroups.com
It works! Thank you very much for the help.
Reply all
Reply to author
Forward
0 new messages