Idea Melt

Focus Mode

Endpoints

Notifications: Send To Followers

Description

Sends a notification to all the followers of a specific user.

endpoint /notifications/send_to_followers
method POST
authentication required
Parameters
to_user_followers
required
the URL of the user who's followers will get the notification.
content
required
the content of the notification.
from_user_url
optional
by default, the api will send the notification from the user defined in the to_user_followers field. however, you can override that by providing a from_user_url. then, the notification will go from the user specified here to the followers of the user specified in the to_user_followers field.
Response
{
    message_list: [ ], 
    success: true, // always use this boolean to check if the request succeeded
    result: {
        total: 6,
        sent: 6
    }
}
result
object
shows the number of followers the to_user_followers URL had and how many notifications were sent out.
Example Request
// make sure you've initialized the library
// before you make requests using it!
// if you haven't, type in the following
IdeaMelt.init({api_key: IDEAMELT_KEY})

// now you're ready for awesomeness!
var data =  {
    from_user_url: "http://www.en.wikipedia.org/henry_ford",
    to_user_followers: "http://www.en.wikipedia.org/louis_armstrong",
    content: "What a wonderful day it is today!"
}
var success = function(r) {
    // everything went perfectly, do something awesome now!
    // remember, this will fire asynchronously
}
var fail = function(r) {
    // yikes! something didn't go right
    // console.log(r.message_list) to see messages from the server
    // ps. this will also fire asynchronously
}

// success and fail are optional parameters
IdeaMelt.send('NotifSendToFollowers', data, success, fail);