node-echo v0.1.9

Display Filters

class ItemsAPI

Gives access to all the things you can do with the items API of Echo.

Constructor

Constructor Parameters Returns
ItemsAPI( parameters )

Parameters:

  • parameters <object> Options, need to specify:
    • parameters.consumerKey : Echo API Key
    • parameters.consumerSecret : Echo API Secret
    • parameters.feed : Feed to communicate with
    • parameters.authMethod : optional, in ['oauth','basic']. Default 'oauth'

Methods

Methods Returns Description
count( query, callback ) void Count how many answers match the query

Parameters:

  • query <string> Query to submit
  • callback <function> callback
flag( target, flag, user, callback ) void "flag" an item

Parameters:

  • target <object> Target of the action. Specify:
    • target.type: type of the target
    • target.id : id of the target
  • flag <object> flag object. Specify
    • flag.id : id for that flag
  • user <object> User submitting the update
  • callback <function> callback called after submission
flagArticle( target, flag, user, callback ) void Allow a user to "flag" an article

Parameters:

  • target <string> Id of the article
  • flag <object> flag object. Specify
    • flag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
flagComment( target, flag, user, callback ) void Allow a user to "flag" an comment

Parameters:

  • target <string> Id of the comment
  • flag <object> flag object. Specify
    • flag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
flagNote( target, flag, user, callback ) void Allow a user to "flag" an note

Parameters:

  • target <string> Id of the note
  • flag <object> flag object. Specify
    • flag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
flagStatus( target, flag, user, callback ) void Allow a user to "flag" an status

Parameters:

  • target <string> Id of the status
  • flag <object> flag object. Specify
    • flag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
like( target, like, user, callback ) void Allow a user to "like" an item

Parameters:

  • target <object> Target of the action. Specify:
    • target.type: type of the target
    • target.id : id of the target
  • like <object> like object. Specify
    • tag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
likeArticle( target, like, user, callback ) void Allow a user to "like" an article

Parameters:

  • target <string> Id of the article
  • like <object> like object. Specify
    • tag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
likeComment( target, like, user, callback ) void Allow a user to "like" an comment

Parameters:

  • target <string> Id of the comment
  • like <object> like object. Specify
    • tag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
likeNote( target, like, user, callback ) void Allow a user to "like" an note

Parameters:

  • target <string> Id of the note
  • like <object> like object. Specify
    • tag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
likeStatus( target, like, user, callback ) void Allow a user to "like" an status

Parameters:

  • target <string> Id of the status
  • like <object> like object. Specify
    • tag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
mux( query, callback ) void Perform multiple, parallel query

Parameters:

  • query <string> Array of queries (JSON object)
  • callback <function> callback
search( query, callback ) void Search for query

Parameters:

  • query <string> Query to submit
  • callback <function> callback
submitArticle( article, user, callback ) void Submit an article (typically : a blog entry)

Parameters:

  • article <object> Article to be submitted. Need to specify:
    • article.content : The content of the article, specify:
      • article.content.title : title of the article
      • article.content.summary : a short summary.
      • article.content.content : main content of the article
      • article.content.permalink : permanent link for this article
    • article.target : (optional) target of the article. Specify:
      • article.target.type : type of the target
      • article.target.id : id of the target
  • user <object> user submitting the content. Need to specify:
    • user.id : unique id for this user
    • user.name : name of the user
    • user.avatarURL : avatar of the user
  • callback <function> callback called after submission
submitComment( comment, user, callback ) void Submit a comment

Parameters:

  • comment <object> Comment to be submitted. Need to specify:
    • comment.content. Specify:
      • comment.content.subject : subject of the comment (can be blank, must be defined)
      • comment.content.content : main content of the comment
      • comment.content.permalink : permanent link for this comment
        • comment.target : (optional) target of this comment. Specify:
          • comment.target.id : ID of the target
          • comment.target.type : type of the target
      • user <object> user submitting the content. Need to specify:
        • user.id : unique id for this user
        • user.name : name of the user
        • user.avatarURL : avatar of the user
      • callback <function> callback called after submission
submitNote( note, user, callback ) void Submit a note

Parameters:

  • note <object> Note to be submitted. Need to specify:
    • note.content. Specify:
      • note.content.content : main content of the note
      • note.content.permalink : permanent link for this note
        • note.target : (optional) target of this note. Specify:
          • note.target.id : ID of the target
          • note.target.type : type of the target
      • user <object> user submitting the content. Need to specify:
        • user.id : unique id for this user
        • user.name : name of the user
        • user.avatarURL : avatar of the user
      • callback <function> callback called after submission
submitStatus( status, user, callback ) void Submit a status

Parameters:

  • status <object> Status to be submitted. Need to specify:
    • status.content : main content of the status
    • status.permalink : permanent link for this status
  • user <object> user submitting the content. Need to specify:
    • user.id : unique id for this user
    • user.name : name of the user
    • user.avatarURL : avatar of the user
  • callback <function> callback called after submission
tag( target, tag, user, callback ) void Tag an item

Parameters:

  • target <object> Target of the action. Specify:
    • target.type: type of the target
    • target.id : id of the target
  • tag <object> Tag to apply to the article. Need to specify:
    • tag.title : title/content of your tag/mark
    • tag.id : id for that update
  • user <object> User submitting the update
  • callback <function> callback called after submission
tagArticle( target, tag, user, callback ) void Tag an article

Parameters:

  • target <string> ID of the article
  • tag <object> Tag to apply to the article. Need to specify:
    • tag.title : title/content of your tag/mark
    • tag.id : id for that update
  • user <object> User submitting the update
  • callback <function> callback called after submission
tagComment( target, tag, user, callback ) void Tag an comment

Parameters:

  • target <string> ID of the comment
  • tag <object> Tag to apply to the comment. Need to specify:
    • tag.title : title/content of your tag/mark
    • tag.id : id for that update
  • user <object> User submitting the update
  • callback <function> callback called after submission
tagNote( target, tag, user, callback ) void Tag an note

Parameters:

  • target <string> ID of the note
  • tag <object> Tag to apply to the note. Need to specify:
    • tag.title : title/content of your tag/mark
    • tag.id : id for that update
  • user <object> User submitting the update
  • callback <function> callback called after submission
tagStatus( target, tag, user, callback ) void Tag an status

Parameters:

  • target <string> ID of the status
  • tag <object> Tag to apply to the status. Need to specify:
    • tag.title : title/content of your tag/mark
    • tag.id : id for that update
  • user <object> User submitting the update
  • callback <function> callback called after submission
unflag( target, flag, user, callback ) void "unflag" an item

Parameters:

  • target <object> Target of the action. Specify:
    • target.type: type of the target
    • target.id : id of the target
  • target <string> Id of the article to like
  • flag <object> flag object. Specify
    • flag.id : id for that flag
  • user <object> User submitting the update
  • callback <function> callback called after submission
unflagArticle( target, flag, user, callback ) void "unflag" an article

Parameters:

  • target <string> Id of the article
  • flag <object> flag object. Specify
    • flag.id : id for that "flag"
  • user <object> User submitting the update
  • callback <function> callback called after submission
unflagComment( target, flag, user, callback ) void "unflag" an comment

Parameters:

  • target <string> Id of the comment
  • flag <object> flag object. Specify
    • flag.id : id for that "flag"
  • user <object> User submitting the update
  • callback <function> callback called after submission
unflagNote( target, flag, user, callback ) void "unflag" an note

Parameters:

  • target <string> Id of the note
  • flag <object> flag object. Specify
    • flag.id : id for that "flag"
  • user <object> User submitting the update
  • callback <function> callback called after submission
unflagStatus( target, flag, user, callback ) void "unflag" an status

Parameters:

  • target <string> Id of the status
  • flag <object> flag object. Specify
    • flag.id : id for that "flag"
  • user <object> User submitting the update
  • callback <function> callback called after submission
unlikeArticle( target, like, user, callback ) void Allow a user to "like" an article

Parameters:

  • target <string> Id of the article
  • like <object> like object. Specify
    • tag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
unlikeComment( target, like, user, callback ) void Allow a user to "like" an comment

Parameters:

  • target <string> Id of the comment
  • like <object> like object. Specify
    • tag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
unlikeNote( target, like, user, callback ) void Allow a user to "like" an note

Parameters:

  • target <string> Id of the note
  • like <object> like object. Specify
    • tag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
unlikeStatus( target, like, user, callback ) void Allow a user to "like" an status

Parameters:

  • target <string> Id of the status
  • like <object> like object. Specify
    • tag.id : id for that "like"
  • user <object> User submitting the update
  • callback <function> callback called after submission
untag( target, tag, user, callback ) void unTag an item

Parameters:

  • target <object> Target of the action. Specify:
    • target.type: type of the target
    • target.id : id of the target
  • tag <object> Tag to apply to the article. Need to specify:
    • tag.title : title/content of your tag/mark
    • tag.id : id for that update
  • user <object> User submitting the update
  • callback <function> callback called after submission
untagArticle( target, tag, user, callback ) void remove a tag on an article

Parameters:

  • target <string> ID of the article
  • tag <object> Tag to remove from the article. Need to specify:
    • tag.title : title/content of your tag/mark
    • tag.id : id for that tag
  • user <object> User submitting the update
  • callback <function> callback called after submission
untagComment( target, tag, user, callback ) void remove a tag on an comment

Parameters:

  • target <string> ID of the comment
  • tag <object> Tag to remove from the comment. Need to specify:
    • tag.title : title/content of your tag/mark
    • tag.id : id for that tag
  • user <object> User submitting the update
  • callback <function> callback called after submission
untagNote( target, tag, user, callback ) void remove a tag on an note

Parameters:

  • target <string> ID of the note
  • tag <object> Tag to remove from the note. Need to specify:
    • tag.title : title/content of your tag/mark
    • tag.id : id for that tag
  • user <object> User submitting the update
  • callback <function> callback called after submission
untagStatus( target, tag, user, callback ) void remove a tag on an status

Parameters:

  • target <string> ID of the status
  • tag <object> Tag to remove from the status. Need to specify:
    • tag.title : title/content of your tag/mark
    • tag.id : id for that tag
  • user <object> User submitting the update
  • callback <function> callback called after submission