Idea Melt

Focus Mode

Endpoints

User - Follow

Description

Toggles the follow relationship between the user and the to_follow item specified in the request.

endpoint /user/follow
method POST
authentication required
Parameters
user_url
required
URL of the user doing the follow.
NOTE: This user must exist in your namespace within IdeaMelt
user_to_follow
optional
URL of the user being followed.
NOTE: Atleast one of the optional parameters must be provided
NOTE: This user must also exist in your namespace within IdeaMelt
object_to_follow
optional
URL of the object being followed
NOTE: Atleast one of the optional parameters must be provided
NOTE: This object must exist in your namespace within IdeaMelt.
Response
{
    message_list: [ ], 
    success: true, // always use this boolean to check if the request succeeded
    result: true // if false, relationship was unfollowed
}
result
boolean
The result of the follow toggle.
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 =  {
    user_url: "http://www.en.wikipedia.org/henry_ford",
    user_to_follow: "http://www.en.wikipedia.org/steve_jobs"
}
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('UserFollow', data, success, fail);