Support Center/Developer Knowledge Base/Topspin APIs

Email For Media REST API

David Widaman
posted this on July 01, 2011 05:12 pm

Overview

The Email for Media service from Topspin enables you to submit emails to a Topspin account in exchange for a free download, triggering an email sent to the user asking to confirm the email address and providing a link to download media associated with the particular campaign. Use the REST API to customize your request, including which email you are submitting, which artist and media you are trying to offer, the source url indicating which publisher is sending us the email, and determining whether the email has been double opted in to the artist’s network.

POST URL

http://pastie.org/2152461

POST (or GET) parameters

Parameter
Value
Description
artist_id integer Topspin artist ID of the artist who will receive the email address.
fan[source_campaign] string Topspin campaign URL reference for the campaign. Campaign references are an identifying URL that contains the artist ID and the numeric campaign ID.
fan[email] string Email address to be submitted for confirmation flow to the artist’s mailing list.
fan[referring_url] string URL of the site where data was collected.
fan[confirmation_target] string URL to confirmation page. If unknown, pass “http://www.topspindownloads.com/confirm/”
dob date, formatted as YYYY-MM-DD The optional fan date of birth for the widget, if the widget is age restricted

Response XML (Sample)

http://pastie.org/2152466

Error XML (Sample)

http://pastie.org/2152473

Sample POST URL

Pandora sending an email address (user@topspinmedia.com) acquired via Pandora to a sample artist’s mailing list in exchange for an MP3.

Pandora referring URL http://www.pandora.com
Sample artist ID 66
E4M campaign_id https://app.topspin.net/api/v1/artist/66/campaign/10000066
Email user@topspinmedia.com
Confirmation Target http://www.topspindownloads.com/confirm/

URL

http://pastie.org/2152477

jQuery

If you are using jQuery, you can run an ajax request like so:

http://pastie.org/2152480