Need assistance to implement 7 digital api in our site.

561 views
Skip to first unread message

Ahsan Agriya

unread,
Nov 9, 2013, 8:13:14 AM11/9/13
to 7digit...@googlegroups.com
Hi, 

Our requirement is to fetch song from your site and to play that in our player. 

We are trying to fetch preview song from 7digital as per the documentation flow but the response we are not getting as you defined in the documentation. 

We are getting the response with oauth_nonce, oauth_signature_method,  oauth_timestamp, oauth_version and  also the song is getting downloaded not playing in the browser.

Kindly suggest us and provide us sample coding .

Documentation reference : 

Darrell Mozingo

unread,
Nov 9, 2013, 12:52:20 PM11/9/13
to 7digit...@googlegroups.com
Hi Ahsan,

We changed the format of the /track/preview endpoint back on 2 September, and noted it in an API developer newsletter at the time, as well as on our blog: http://developer.7digital.com/blog/important-new-preview-clips-endpoint. If you follow that redirect you should still get requested preview bytes. The URL you're following shouldn't affect you.

A more direct way and probably easier on your end is to use our new endpoint: /clip/{trackid}. This endpoint is signed directly with your API key and doesn't generate any redirect, but returns the preview bytes directly. If you notice, that's the endpoint we're actually redirecting you to with /track/preview now. So it cuts out the middle man :)   We'll be depreciating the /track/preview endpoint at some point in the future too.

Let us know if you're still having trouble!

Regards,
Darrell


--
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/groups/opt_out.




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.
Message has been deleted
Message has been deleted

Ahsan Agriya

unread,
Nov 13, 2013, 7:23:31 AM11/13/13
to 7digit...@googlegroups.com
Hi

      As per your instruction i tried this request format "http://previews.7digital.com/clip/1234?oauth_consumer_key=MY_KEY&country=GB". I am not getting responce it showing me the error "
Error: Authorization failed for method <GET> and URL <http://previews.7digital.com/clip/1234?oauth_consumer_key=MY_KEY&country=GB>. Missing OAuth signature".

Check this and say what mistake i am doing.

I like to have the request in .mp3 format so only i can play that in my player. I dont want the songs to be get download i need the songs to be play in the player
.
If my request is in this format "
http://previews.7digital.com/clips/34/123.clip.mp3 " i can get the response and i can play the song in the player because in the response itself i am getting the .mp3 url


Hope you all good!

Darrell Mozingo

unread,
Nov 13, 2013, 7:38:13 AM11/13/13
to 7digit...@googlegroups.com
Hi Ahsan,

Sorry for the trouble you're having. It looks like you're not actually signing the request though. Here's a fully working link (good for the next hour before it expires):


Check our OAuth reference app I mentioned before:


Fill in http://previews.7digital.com/clip/1234 for the url, 7djs472r5p5a for consumer key, and your secret in the consumer secret box. You'll see a working link in the bottom right of the screen. You'll need to find an OAuth signing library in your language of choice to handle this inside your application.

If you curl the endpoint:


You'll see:

< Content-Type: audio/mpeg

Which all players we've encountered will read and play as an MP3. So it should not download the file, but play it as you expect.

Hope that helps.

Darrell


On Wed, Nov 13, 2013 at 12:22 PM, Ahsan Agriya <dev3.de...@gmail.com> wrote:

Hi

      As per your instruction i tried this request format "http://previews.7digital.com/clip/1234?oauth_consumer_key=MY_KEY&country=GB". I am not getting responce it showing me the error "
Error: Authorization failed for method &lt;GET&gt; and URL &lt;http://previews.7digital.com/clip/1234?oauth_consumer_key=7djs472r5p5a&amp;country=GB&gt;. Missing OAuth signature".


Check this and say what mistake i am doing.

I like to have the request in .mp3 format so only i can play that in my player. I dont want the songs to be get download i need the songs to be play in the player
.
If my request is in this format "
http://previews.7digital.com/clips/34/123.clip.mp3 " i can get the response and i can play the song in the player because in the response itself i am getting the .mp3 url


Hope you all good!




On Saturday, November 9, 2013 6:43:14 PM UTC+5:30, Ahsan Agriya wrote:

--
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/groups/opt_out.

Ahsan Agriya

unread,
Nov 13, 2013, 8:01:26 AM11/13/13
to 7digit...@googlegroups.com
Hi

 Sorry for trouble.....

 This is the request what you gave
http://previews.7digital.com/clip/1234?oauth_consumer_key=7djs472r5p5a&oauth_nonce=368153167&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1384346044&oauth_version=1.0&oauth_signature=4T%2Fe5ozLm0yI3QS6l4YdU5CAr2k%3D


What i tried is i gave request like this "http://api.7digital.com/1.2/track/preview?trackid=1234&redirect=false&oauth_consumer_key=MY_KEY"
the response what i got is


<response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" status="ok" version="1.2" xsi:noNamespaceSchemaLocation="http://api.7digital.com/1.2/static/7digitalAPI.xsd">

Darrell Mozingo

unread,
Nov 13, 2013, 8:23:05 AM11/13/13
to 7digit...@googlegroups.com
Hi Ahsan,

You can't just change the consumer key in the URL and get it to work. Notice the error says invalid signature - it's because you changed it. Please follow the direction I replied with last time using our sample OAuth signer (where you paste in the URL and key/secret). If you need further help please read our OAuth reference material to understand this standard signing procedure: http://developer.7digital.com/resources/api-docs/oauth-authentication.

Darrell


--
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/groups/opt_out.
Message has been deleted

Ahsan Agriya

unread,
Nov 14, 2013, 2:25:08 AM11/14/13
to 7digit...@googlegroups.com
Hi Darrell Mozingo,

       Kindly can you explain us more briefly.
        Our requirement is Client will search the album and he/she will select the particular album and they will select the song from that album. we play the selected song in the player.
Now can you explain us more briefly how to implement our requirement and fetch preview songs.


You provided us OAuth reference app 
       http://7digital.github.io/oauth-reference-page/
We cant go to this site each time to get the required details like "oauth_nonce=368153167&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1384346044&oauth_version=1.0&oauth_signature=4T%2Fe5ozLm0yI3QS6l4YdU5CAr2k%3D" because user can select any song at any time, even  when one song is playing client can select another song or another album song.

We mentioned one url "http://previews.7digital.com/clip/1234?oauth_consumer_key=7digitalClips&oauth_nonce=34bmnqacoqfzs9ak&oauth_signature=1UMKj1rkCTCxa0fZkqwinVDByKQ%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1384347471&oauth_version=1.0"  but you told the signature is wrong because of the oauth_consumer_key.



How can we get the 
"oauth_nonce, oauth_signature_method, oauth_timestamp, oauth_signature". each time. Can you provide any request url to get all details. 

Thanks for your support, Hope you are well.

Darrell Mozingo

unread,
Nov 14, 2013, 9:19:17 AM11/14/13
to 7digit...@googlegroups.com
Hi Ahsan,

You shouldn't use the OAuth reference app directly in your application. It's just an example so you can see how to do OAuth signing and test your key. You should be implementing that signing algorithm in your application directly, so that given a url (such as http://previews.7digital.com/clip/123) and a consumer key & secret (which you would have put inside your application), you can generate a full preview URL to send to the browser to play.

I've also linked a few times to our OAuth reference page:  http://developer.7digital.com/resources/api-docs/oauth-authentication

This explains the basics on how to generate OAuth signatures, and links to the official documentation here: http://oauth.googlecode.com/svn/spec/ext/consumer_request/1.0/drafts/1/spec.html

There are several clients for many different languages that can handle all this for you. A full list (also linked from above) can be found here: http://oauth.net/code/

Hope that helps.
Darrell


--
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/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages