Email For Media REST API Follow

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

 

https://app.topspin.net/api/v1/fan/create_fan?resp_format=xml

 

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. 
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)

 

<hash>
    <success type="boolean">true</success>
</hash>

Error XML (Sample)

 

<hash>
     <errors>
          <base>Error message</base>
     </errors>
</hash>

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.exampleconfirmationpage.com

 

jQuery

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

 

$.ajax({
    url: "http://app.topspin.net/api/v1/fan/create_fan",
    type: "GET",
    dataType: 'jsonp',
    data:  ({ 'fan' : {
                       email: 'user@topspinmedia.com',
                       source_campaign: 'https://app.topspin.net/api/v1/artist/66/campaign/10000066', 
                       referring_url: 'http://pandora.com',
                       confirmation_target: 'http://www.exampleconfirmationpage.com/',
                       artist_id:  '66'
                       }
            }),
    success: function(resp) {
        //alert(resp.success); 
    }        

});

 

 

 

 

 

Have more questions? Submit a request and our team will be able to help get you sorted.
Powered by Zendesk