appnet
Version:
A library for communicating with the app.net web services API.
1,528 lines (1,502 loc) • 82.5 kB
JavaScript
/*
* base.js
*
* Base app.net library file. Sets up the single global appnet object.
*
*/
/*global jQuery: true, require: true, module: true, exports: true */
if (typeof exports !== 'undefined')
{
jQuery = {};
jQuery.param = function (object)
{
'use strict';
// Query String able to use escaping
var query = require('querystring');
var result = '',
key = '',
postfix = '&';
var i;
for (i in object)
{
// If not prefix like a[one]...
// if (! prefix)
// {
key = query.escape(i);
// }
// else
// {
// key = prefix + '[' + query.escape(i) + ']';
// }
// String pass as is...
if (typeof(object[i]) === 'string')
{
result += key + '=' + query.escape(object[i]) + postfix;
continue;
}
// objectects and arrays pass depper
/*
if (typeof(object[i]) === 'object' || typeof(object[i]) === 'array')
{
result += toURL(object[i], key) + postfix;
continue;
}
*/
// Other passed stringified
if (object[i].toString)
{
result += key + '=' + query.escape(object[i].toString()) + postfix;
continue;
}
}
// Delete trailing delimiter (&) Yep it's pretty durty way but
// there was an error gettin length of the objectect;
result = result.substr(0, result.length - 1);
return result;
};
jQuery.ajax = function (options)
{
'use strict';
var Q = require('q');
var needle = require('needle');
var deferred = Q.defer();
var options = jQuery.extend({ compressed: true }, options);
if (options.dataType === 'json')
{
options.json = true;
}
if (options.dataType === 'multipart')
{
options.multipart = true;
}
needle.request(options.type, options.url, options.data, options, function (error, response, body)
{
if (error || response.statusCode !== 200)
{
deferred.reject(body);
}
else
{
deferred.resolve(body);
}
});
return deferred.promise;
};
jQuery.extend = require('xtend');
jQuery.wait = require('q').delay;
}
(function ($) {
'use strict';
var appnet = {
userToken: null,
appToken: null,
endpoints: null,
core: {},
note: {},
recipes: {}
};
appnet.authorize = function (user, app)
{
this.userToken = user;
this.appToken = app;
};
appnet.deauthorize = function ()
{
this.userToken = null;
this.appToken = null;
};
appnet.isLogged = function ()
{
return (this.isApp() || this.isUser());
};
appnet.isApp = function ()
{
var result = false;
if (this.appToken)
{
result = true;
}
return result;
};
appnet.isUser = function ()
{
var result = false;
if (this.userToken)
{
result = true;
}
return result;
};
$.appnet = appnet;
}(jQuery));
if (typeof module !== 'undefined')
{
module.exports = jQuery.appnet;
}
/*global jQuery: true */
(function ($) {
'use strict';
$.appnet.endpoints = {
"format_version": 3,
"data_version": 5,
"scopes": {
"basic": "See basic information about this user",
"stream": "Read this user's stream",
"email": "Access this user's email address",
"write_post": "Create a new post as this user",
"follow": "Add or remove follows (or mutes) for this user",
"public_messages": "Send and receive public messages as this user",
"messages": "Send and receive public and private messages as this user",
"update_profile": "Update a user's name, images, and other profile information",
"files": "Manage a user's files. This is not needed for uploading files.",
"export": "Bulk export all of this user's App.net data. This is intended only for backup services, not day-to-day App.net client use. Users will be shown an extra warning when this scope is requested due to the sensitivity of this data."
},
"stream_types": [
"user",
"post",
"channel",
"message",
"file",
"AppStream",
"UserStream",
"filter",
"interaction",
"marker",
"text",
"token",
"place",
"explore",
"config"
],
"migrations": [ ],
"parameter_category": {
"pagination": [ "since_id", "before_id", "count" ],
"general_user": [ "include_annotations", "include_user_annotations", "include_html",
"connection_id" ],
"general_post": [ "include_muted", "include_deleted", "include_directed_posts", "include_machine",
"include_starred_by", "include_reposters", "include_annotations",
"include_post_annotations", "include_user_annotations", "include_html",
"connection_id" ],
"general_channel": [ "channel_types", "include_marker", "include_read", "include_recent_message",
"include_annotations", "include_user_annotations", "include_message_annotations",
"connection_id" ],
"general_message": [ "include_muted", "include_deleted", "include_machine",
"include_annotations", "include_user_annotations", "include_message_annotations",
"include_html", "connection_id" ],
"general_file": [ "file_types", "include_incomplete", "include_private",
"include_annotations", "include_file_annotations", "include_user_annotations",
"connection_id" ],
"user": [ "name", "locale", "timezone", "description" ],
"avatar": "image",
"cover": "image",
"post": [ "text", "reply_to", "machine_only", "annotations", "entities" ],
"channel": [ "readers", "writers", "editors", "annotations", "type" ],
"message": [ "text", "reply_to", "annotations", "entities", "machine_only", "destinations" ],
"file": [ "kind", "type", "name", "public", "annotations" ],
"content": "content",
"AppStream": [ "object_types", "type", "filter_id", "key" ],
"UserStream": [ ],
"filter": [ "name", "match_policy", "clauses"],
"marker": [ "id", "name", "percentage" ],
"post_or_message": [ "text" ],
"stream_facet": [ "has_oembed_photo" ],
"post_search": [ "index", "order", "query", "text", "hashtags", "links",
"link_domains", "mentions", "leading_mentions",
"annotation_types", "attachment_types", "crosspost_url",
"crosspost_domain", "place_id", "is_reply", "is_directed",
"has_location", "has_checkin", "is_crosspost",
"has_attachment", "has_oembed_photo", "has_oembed_video",
"has_oembed_html5video", "has_oembed_rich", "language",
"client_id", "creator_id", "reply_to", "thread_id" ],
"user_search": [ "q", "count" ],
"channel_search": [ "order", "q", "type", "creator_id", "tags" ],
"place_search": [ "latitude", "longitude", "q", "radius", "count", "remove_closed",
"altitude", "horizontal_accuracy", "vertical_accuracy" ],
"user_ids": [ "ids" ],
"post_ids": [ "ids" ],
"channel_ids": [ "ids" ],
"message_ids": [ "ids" ],
"file_ids": [ "ids" ]
},
"base": "https://alpha-api.app.net/stream/0/",
"endpoints": [
{
"group": "user",
"name": "get",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user" ],
"method": "GET",
"url": [
"users/"
],
"token": "None",
"scope": "basic",
"description": "Retrieve a User",
"link": "http://developers.app.net/docs/resources/user/lookup/#retrieve-a-user"
},
{
"group": "user",
"name": "update",
"url_params": [],
"data_params": [
"user"
],
"array_params": [],
"get_params": [ "general_user" ],
"method": "PUT",
"url": [
"users/me"
],
"token": "User",
"scope": "update_profile",
"description": "Update a User",
"link": "http://developers.app.net/docs/resources/user/profile/#update-a-user"
},
{
"group": "user",
"name": "partialUpdate",
"url_params": [],
"data_params": [
"user"
],
"array_params": [],
"get_params": [ "general_user" ],
"method": "PATCH",
"url": [
"users/me"
],
"token": "User",
"scope": "update_profile",
"description": "Partially Update a User",
"link": "http://developers.app.net/docs/resources/user/profile/#partially-update-a-user"
},
{
"group": "user",
"name": "getAvatar",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ ],
"method": "GET",
"url": [
"users/",
"/avatar"
],
"token": "None",
"scope": "basic",
"description": "Retrieve a User's avatar image",
"link": "http://developers.app.net/docs/resources/user/profile/#retrieve-a-users-avatar-image"
},
{
"group": "user",
"name": "updateAvatar",
"url_params": [],
"data_params": [
"avatar"
],
"array_params": [],
"get_params": [ ],
"method": "POST-RAW",
"url": [
"users/me/avatar"
],
"token": "User",
"scope": "update_profile",
"description": "Update a User's avatar image",
"link": "http://developers.app.net/docs/resources/user/profile/#update-a-users-avatar-image"
},
{
"group": "user",
"name": "getCover",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ ],
"method": "GET",
"url": [
"users/",
"/cover"
],
"token": "None",
"scope": "basic",
"description": "Retrieve a User's cover image",
"link": "http://developers.app.net/docs/resources/user/profile/#retrieve-a-users-cover-image"
},
{
"group": "user",
"name": "updateCover",
"url_params": [],
"data_params": [
"cover"
],
"array_params": [],
"get_params": [ ],
"method": "POST-RAW",
"url": [
"users/me/cover"
],
"token": "User",
"scope": "update_profile",
"description": "Update a User's cover image",
"link": "http://developers.app.net/docs/resources/user/profile/#update-a-users-cover-image"
},
{
"group": "user",
"name": "follow",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user" ],
"method": "POST",
"url": [
"users/",
"/follow"
],
"token": "User",
"scope": "follow",
"description": "Follow a User",
"link": "http://developers.app.net/docs/resources/user/following/#follow-a-user"
},
{
"group": "user",
"name": "unfollow",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user" ],
"method": "DELETE",
"url": [
"users/",
"/follow"
],
"token": "User",
"scope": "follow",
"description": "Unfollow a User",
"link": "http://developers.app.net/docs/resources/user/following/#unfollow-a-user"
},
{
"group": "user",
"name": "mute",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user" ],
"method": "POST",
"url": [
"users/",
"/mute"
],
"token": "User",
"scope": "follow",
"description": "Mute a User",
"link": "http://developers.app.net/docs/resources/user/muting/#mute-a-user"
},
{
"group": "user",
"name": "unmute",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user" ],
"method": "DELETE",
"url": [
"users/",
"/mute"
],
"token": "User",
"scope": "follow",
"description": "Unmute a User",
"link": "http://developers.app.net/docs/resources/user/muting/#unmute-a-user"
},
{
"group": "user",
"name": "block",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user" ],
"method": "POST",
"url": [
"users/",
"/block"
],
"token": "User",
"scope": "follow",
"description": "Block a User",
"link": "http://developers.app.net/docs/resources/user/blocking/#block-a-user"
},
{
"group": "user",
"name": "unblock",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user" ],
"method": "DELETE",
"url": [
"users/",
"/block"
],
"token": "User",
"scope": "follow",
"description": "Unblock a User",
"link": "http://developers.app.net/docs/resources/user/blocking/#unblock-a-user"
},
{
"group": "user",
"name": "getList",
"url_params": [],
"data_params": [],
"array_params": [
"user_ids"
],
"get_params": [ "general_user" ],
"method": "GET",
"url": [
"users"
],
"token": "Any",
"scope": "basic",
"description": "Retrieve multiple Users",
"link": "http://developers.app.net/docs/resources/user/lookup/#retrieve-multiple-users"
},
{
"group": "user",
"name": "search",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ "user_search", "general_user" ],
"method": "GET",
"url": [
"users/search"
],
"token": "Any",
"scope": "basic",
"description": "Search for Users",
"link": "http://developers.app.net/docs/resources/user/lookup/#search-for-users"
},
{
"group": "user",
"name": "getFollowing",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user", "pagination" ],
"method": "GET",
"url": [
"users/",
"/following"
],
"token": "Any",
"scope": "basic",
"description": "Retrieve Users a User is following",
"link": "http://developers.app.net/docs/resources/user/following/#list-users-a-user-is-following"
},
{
"group": "user",
"name": "getFollowers",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user", "pagination" ],
"method": "GET",
"url": [
"users/",
"/followers"
],
"token": "Any",
"scope": "basic",
"description": "Retrieve Users following a User",
"link": "http://developers.app.net/docs/resources/user/following/#list-users-following-a-user"
},
{
"group": "user",
"name": "getFollowingIds",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ ],
"method": "GET",
"url": [
"users/",
"/following/ids"
],
"token": "Any",
"scope": "basic",
"description": "Retrieve IDs of Users a User is following",
"link": "http://developers.app.net/docs/resources/user/following/#list-user-ids-a-user-is-following"
},
{
"group": "user",
"name": "getFollowerIds",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ ],
"method": "GET",
"url": [
"users/",
"/followers/ids"
],
"token": "Any",
"scope": "basic",
"description": "Retrieve IDs of Users following a User",
"link": "http://developers.app.net/docs/resources/user/following/#list-user-ids-following-a-user"
},
{
"group": "user",
"name": "getMuted",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user" ],
"method": "GET",
"url": [
"users/",
"/muted"
],
"token": "Any",
"scope": "basic",
"description": "Retrieve muted Users",
"link": "http://developers.app.net/docs/resources/user/muting/#list-muted-users"
},
{
"group": "user",
"name": "getMutedList",
"url_params": [],
"data_params": [],
"array_params": [
"user_ids"
],
"get_params": [ ],
"method": "GET",
"url": [
"users/muted/ids"
],
"token": "App",
"scope": "basic",
"description": "Retrieve muted User IDs for multiple Users",
"link": "http://developers.app.net/docs/resources/user/muting/#retrieve-muted-user-ids-for-multiple-users"
},
{
"group": "user",
"name": "getBlocked",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user" ],
"method": "GET",
"url": [
"users/",
"/blocked"
],
"token": "Any",
"scope": "basic",
"description": "Retrieve blocked Users",
"link": "http://developers.app.net/docs/resources/user/blocking/#list-blocked-users"
},
{
"group": "user",
"name": "getBlockedList",
"url_params": [],
"data_params": [],
"array_params": [
"user_ids"
],
"get_params": [ ],
"method": "GET",
"url": [
"users/blocked/ids"
],
"token": "App",
"scope": "basic",
"description": "Retrieve blocked User IDs for multiple Users",
"link": "http://developers.app.net/docs/resources/user/blocking/#retrieve-blocked-user-ids-for-multiple-users"
},
{
"group": "user",
"name": "getReposters",
"url_params": [
"post_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user" ],
"method": "GET",
"url": [
"posts/",
"/reposters"
],
"token": "Any",
"scope": "basic",
"description": "Retrieve Users who reposted a Post",
"link": "http://developers.app.net/docs/resources/user/post-interactions/#list-users-who-have-reposted-a-post"
},
{
"group": "user",
"name": "getStars",
"url_params": [
"post_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_user" ],
"method": "GET",
"url": [
"posts/",
"/stars"
],
"token": "Any",
"scope": "basic",
"description": "Retrieve Users who starred a Post",
"link": "http://developers.app.net/docs/resources/user/post-interactions/#list-users-who-have-starred-a-post"
},
{
"group": "post",
"name": "create",
"url_params": [],
"data_params": [
"post"
],
"array_params": [],
"get_params": [ "general_post" ],
"method": "POST",
"url": [
"posts"
],
"token": "User",
"scope": "write_post",
"description": "Create a Post",
"link": "http://developers.app.net/docs/resources/post/lifecycle/#create-a-post"
},
{
"group": "post",
"name": "get",
"url_params": [
"post_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_post" ],
"method": "GET",
"url": [
"posts/"
],
"token": "None",
"scope": "basic",
"description": "Retrieve a Post",
"link": "http://developers.app.net/docs/resources/post/lookup/#retrieve-a-post"
},
{
"group": "post",
"name": "destroy",
"url_params": [
"post_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_post" ],
"method": "DELETE",
"url": [
"posts/"
],
"token": "User",
"scope": "write_post",
"description": "Delete a Post",
"link": "http://developers.app.net/docs/resources/post/lifecycle/#delete-a-post"
},
{
"group": "post",
"name": "repost",
"url_params": [
"post_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_post" ],
"method": "POST",
"url": [
"posts/",
"/repost"
],
"token": "User",
"scope": "write_post",
"description": "Repost a Post",
"link": "http://developers.app.net/docs/resources/post/reposts/#repost-a-post"
},
{
"group": "post",
"name": "unrepost",
"url_params": [
"post_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_post" ],
"method": "DELETE",
"url": [
"posts/",
"/repost"
],
"token": "User",
"scope": "write_post",
"description": "Unrepost a Post",
"link": "http://developers.app.net/docs/resources/post/reposts/#unrepost-a-post"
},
{
"group": "post",
"name": "star",
"url_params": [
"post_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_post" ],
"method": "POST",
"url": [
"posts/",
"/star"
],
"token": "User",
"scope": "write_post",
"description": "Star a Post",
"link": "http://developers.app.net/docs/resources/post/stars/#star-a-post"
},
{
"group": "post",
"name": "unstar",
"url_params": [
"post_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_post" ],
"method": "DELETE",
"url": [
"posts/",
"/star"
],
"token": "User",
"scope": "write_post",
"description": "Unstar a Post",
"link": "http://developers.app.net/docs/resources/post/stars/#unstar-a-post"
},
{
"group": "post",
"name": "getList",
"url_params": [],
"data_params": [],
"array_params": [
"post_ids"
],
"get_params": [ "general_post" ],
"method": "GET",
"url": [
"posts"
],
"token": "Any",
"scope": "basic",
"description": "Retrieve multiple Posts",
"link": "http://developers.app.net/docs/resources/post/lookup/#retrieve-multiple-posts"
},
{
"group": "post",
"name": "getUser",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_post", "pagination" ],
"method": "GET",
"url": [
"users/",
"/posts"
],
"token": "None",
"scope": "basic",
"description": "Retrieve a User's posts",
"link": "http://developers.app.net/docs/resources/post/streams/#retrieve-posts-created-by-a-user"
},
{
"group": "post",
"name": "getUserStarred",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_post", "pagination" ],
"method": "GET",
"url": [
"users/",
"/stars"
],
"token": "None",
"scope": "basic",
"description": "Retrieve a User's starred posts",
"link": "http://developers.app.net/docs/resources/post/stars/#retrieve-posts-starred-by-a-user"
},
{
"group": "post",
"name": "getUserMentions",
"url_params": [
"user_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_post", "pagination" ],
"method": "GET",
"url": [
"users/",
"/mentions"
],
"token": "Any",
"scope": "basic",
"description": "Retrieve Posts mentioning a User",
"link": "http://developers.app.net/docs/resources/post/streams/#retrieve-posts-mentioning-a-user"
},
{
"group": "post",
"name": "getHashtag",
"url_params": [
"hashtag"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_post", "pagination" ],
"method": "GET",
"url": [
"posts/tag/"
],
"token": "None",
"scope": "basic",
"description": "Retrieve Posts containing a hashtag",
"link": "http://developers.app.net/docs/resources/post/streams/#retrieve-tagged-posts"
},
{
"group": "post",
"name": "getThread",
"url_params": [
"post_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_post", "pagination" ],
"method": "GET",
"url": [
"posts/",
"/replies"
],
"token": "Any",
"scope": "basic",
"description": "Retrieve replies to a Post",
"link": "http://developers.app.net/docs/resources/post/replies"
},
{
"group": "post",
"name": "getUserStream",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ "general_post", "pagination", "stream_facet" ],
"method": "GET",
"url": [
"posts/stream"
],
"token": "User",
"scope": "stream",
"description": "Retrieve a User's personalized stream",
"link": "http://developers.app.net/docs/resources/post/streams/#retrieve-a-users-personalized-stream"
},
{
"group": "post",
"name": "getUnifiedStream",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ "general_post", "pagination", "stream_facet" ],
"method": "GET",
"url": [
"posts/stream/unified"
],
"token": "User",
"scope": "stream",
"description": "Retrieve a User's unified stream",
"link": "http://developers.app.net/docs/resources/post/streams/#retrieve-a-users-unified-stream"
},
{
"group": "post",
"name": "getGlobal",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ "general_post", "pagination" ],
"method": "GET",
"url": [
"posts/stream/global"
],
"token": "User",
"scope": "basic",
"description": "Retrieve the Global stream",
"link": "http://developers.app.net/docs/resources/post/streams/#retrieve-the-global-stream"
},
{
"group": "post",
"name": "report",
"url_params": [
"post_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_post" ],
"method": "POST",
"url": [
"posts/",
"/report"
],
"token": "User",
"scope": "basic",
"description": "Report a Post",
"link": "http://developers.app.net/docs/resources/post/report/#report-a-post"
},
{
"group": "post",
"name": "search",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ "post_search", "general_post" ],
"method": "GET",
"url": [
"posts/search"
],
"token": "Any",
"scope": "basic",
"description": "Search for Posts",
"link": "http://developers.app.net/docs/resources/post/search/#search-for-posts"
},
{
"group": "channel",
"name": "getUserSubscribed",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ "general_channel", "pagination" ],
"method": "GET",
"url": [
"channels"
],
"token": "User",
"scope": "messages",
"description": "Get current user's subscribed channels",
"link": "http://developers.app.net/docs/resources/channel/subscriptions/#get-current-users-subscribed-channels"
},
{
"group": "channel",
"name": "create",
"url_params": [],
"data_params": [
"channel"
],
"array_params": [],
"get_params": [ "general_channel" ],
"method": "POST",
"url": [
"channels"
],
"token": "User",
"scope": "messages",
"description": "Create a Channel",
"link": "http://developers.app.net/docs/resources/channel/lifecycle/#create-a-channel"
},
{
"group": "channel",
"name": "get",
"url_params": [
"channel_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_channel" ],
"method": "GET",
"url": [
"channels/"
],
"token": "Varies",
"scope": "messages",
"description": "Retrieve a Channel",
"link": "http://developers.app.net/docs/resources/channel/lookup/#retrieve-a-channel"
},
{
"group": "channel",
"name": "getList",
"url_params": [],
"data_params": [],
"array_params": [
"channel_ids"
],
"get_params": [ "general_channel" ],
"method": "GET",
"url": [
"channels"
],
"token": "Varies",
"scope": "messages",
"description": "Retrieve multiple Channels",
"link": "http://developers.app.net/docs/resources/channel/lookup/#retrieve-multiple-channels"
},
{
"group": "channel",
"name": "getCreated",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ "general_channel", "pagination" ],
"method": "GET",
"url": [
"users/me/channels"
],
"token": "User",
"scope": "messages",
"description": "Retrieve my Channels",
"link": "http://developers.app.net/docs/resources/channel/lookup/#retrieve-my-channels"
},
{
"group": "channel",
"name": "getUnreadCount",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ ],
"method": "GET",
"url": [
"users/me/channels/pm/num_unread"
],
"token": "User",
"scope": "messages",
"description": "Retrieve number of unread PM Channels",
"link": "http://developers.app.net/docs/resources/channel/lookup/#retrieve-number-of-unread-pm-channels"
},
{
"group": "channel",
"name": "getUnreadBroadcastCount",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ ],
"method": "GET",
"url": [
"users/me/channels/broadcast/num_unread"
],
"token": "User",
"scope": "messages",
"description": "Retrieve number of unread Broadcast Channels",
"link": "http://developers.app.net/docs/resources/channel/lookup/#retrieve-number-of-unread-broadcast-channels"
},
{
"group": "channel",
"name": "markBroadcastChannelsRead",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ ],
"method": "DELETE",
"url": [
"users/me/channels/broadcast/num_unread"
],
"token": "User",
"scope": "messages",
"description": "Mark all Broadcast Channels as read",
"link": "http://developers.app.net/docs/resources/channel/lookup/#mark-all-broadcast-channels-as-read"
},
{
"group": "channel",
"name": "update",
"url_params": [
"channel_id"
],
"data_params": [
"channel"
],
"array_params": [],
"get_params": [ "general_channel" ],
"method": "PUT",
"url": [
"channels/"
],
"token": "User",
"scope": "messages",
"description": "Update a Channel",
"link": "http://developers.app.net/docs/resources/channel/lifecycle/#update-a-channel"
},
{
"group": "channel",
"name": "deactivate",
"url_params": [
"channel_id"
],
"data_params": [
"channel"
],
"array_params": [],
"get_params": [ "general_channel" ],
"method": "DELETE",
"url": [
"channels/"
],
"token": "User",
"scope": "messages",
"description": "Deactivate a Channel",
"link": "http://developers.app.net/docs/resources/channel/lifecycle/#deactivate-a-channel"
},
{
"group": "channel",
"name": "subscribe",
"url_params": [
"channel_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_channel" ],
"method": "POST",
"url": [
"channels/",
"/subscribe"
],
"token": "User",
"scope": "messages",
"description": "Subscribe to a Channel",
"link": "http://developers.app.net/docs/resources/channel/subscriptions/#subscribe-to-a-channel"
},
{
"group": "channel",
"name": "unsubscribe",
"url_params": [
"channel_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_channel" ],
"method": "DELETE",
"url": [
"channels/",
"/subscribe"
],
"token": "User",
"scope": "messages",
"description": "Unsubscribe from a Channel",
"link": "http://developers.app.net/docs/resources/channel/subscriptions/#unsubscribe-from-a-channel"
},
{
"group": "channel",
"name": "getSubscribers",
"url_params": [
"channel_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_channel", "pagination" ],
"method": "GET",
"url": [
"channels/",
"/subscribers"
],
"token": "None",
"scope": "messages",
"description": "Retrieve users subscribed to a Channel",
"link": "http://developers.app.net/docs/resources/channel/subscriptions/#retrieve-users-subscribed-to-a-channel"
},
{
"group": "channel",
"name": "getSubscriberIds",
"url_params": [
"channel_id"
],
"data_params": [],
"array_params": [],
"get_params": [ ],
"method": "GET",
"url": [
"channels/",
"/subscribers/ids"
],
"token": "None",
"scope": "messages",
"description": "Retrieve user ids subscribed to a Channel",
"link": "http://developers.app.net/docs/resources/channel/subscriptions/#retrieve-user-ids-subscribed-to-a-channel"
},
{
"group": "channel",
"name": "getSubscriberIdList",
"url_params": [],
"data_params": [],
"array_params": [
"channel_ids"
],
"get_params": [ ],
"method": "GET",
"url": [
"channels/subscribers/ids"
],
"token": "Any",
"scope": "messages",
"description": "Retrieve user ids subscribed to multiple Channels",
"link": "http://developers.app.net/docs/resources/channel/subscriptions/#retrieve-user-ids-subscribed-to-a-channel"
},
{
"group": "channel",
"name": "mute",
"url_params": [
"channel_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_channel" ],
"method": "POST",
"url": [
"channels/",
"/mute"
],
"token": "User",
"scope": "messages",
"description": "Mute a Channel",
"link": "http://developers.app.net/docs/resources/channel/muting/#mute-a-channel"
},
{
"group": "channel",
"name": "unmute",
"url_params": [
"channel_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_channel" ],
"method": "DELETE",
"url": [
"channels/",
"/mute"
],
"token": "User",
"scope": "messages",
"description": "Unmute a Channel",
"link": "http://developers.app.net/docs/resources/channel/muting/#unmute-a-channel"
},
{
"group": "channel",
"name": "getMuted",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ "general_channel" ],
"method": "GET",
"url": [
"users/me/channels/muted"
],
"token": "User",
"scope": "messages",
"description": "Get current user's muted Channels",
"link": "http://developers.app.net/docs/resources/channel/muting/#get-current-users-muted-channels"
},
{
"group": "channel",
"name": "search",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ "channel_search", "general_channel" ],
"method": "GET",
"url": [
"channels/search"
],
"token": "User",
"scope": "public_messages",
"description": "Search for Channels",
"link": "http://developers.app.net/docs/resources/channel/search/#search-for-channels"
},
{
"group": "message",
"name": "getChannel",
"url_params": [
"channel_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_message", "pagination" ],
"method": "GET",
"url": [
"channels/",
"/messages"
],
"token": "None",
"scope": "messages",
"description": "Retrieve the Messages in a Channel",
"link": "http://developers.app.net/docs/resources/message/lifecycle/#retrieve-the-messages-in-a-channel"
},
{
"group": "message",
"name": "create",
"url_params": [
"channel_id"
],
"data_params": [
"message"
],
"array_params": [],
"get_params": [ "general_message" ],
"method": "POST",
"url": [
"channels/",
"/messages"
],
"token": "User",
"scope": "messages",
"description": "Create a Message",
"link": "http://developers.app.net/docs/resources/message/lifecycle/#create-a-message"
},
{
"group": "message",
"name": "get",
"url_params": [
"channel_id",
"message_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_message" ],
"method": "GET",
"url": [
"channels/",
"/messages/"
],
"token": "None",
"scope": "messages",
"description": "Retrieve a Message",
"link": "http://developers.app.net/docs/resources/message/lookup/#retrieve-a-message"
},
{
"group": "message",
"name": "getList",
"url_params": [],
"data_params": [],
"array_params": [
"message_ids"
],
"get_params": [ "general_message" ],
"method": "GET",
"url": [
"channels/messages"
],
"token": "None",
"scope": "messages",
"description": "Retrieve multiple Messages",
"link": "http://developers.app.net/docs/resources/message/lookup/#retrieve-multiple-messages"
},
{
"group": "message",
"name": "getUser",
"url_params": [],
"data_params": [],
"array_params": [],
"get_params": [ "general_message" ],
"method": "GET",
"url": [
"users/me/messages"
],
"token": "User",
"scope": "messages",
"description": "Retrieve my Messages",
"link": "http://developers.app.net/docs/resources/message/lookup/#retrieve-my-messages"
},
{
"group": "message",
"name": "destroy",
"url_params": [
"channel_id",
"message_id"
],
"data_params": [],
"array_params": [],
"get_params": [ "general_message" ],
"method": "DELETE",
"url": [
"channels/",
"/messages/"
],
"token": "User",
"scope": "messages",
"description": "Delete a Message",
"link": "http://developers.app.net/docs/resources/message/lifecycle/#delete-a-message"
},
{
"group": "file",
"name": "create",
"url_params": [],
"data_params": [
"file"
],
"array_params": [],
"get_params": [ "general_file" ],
"method": "POST-RAW",
"url": [
"files"
],
"token": "User",
"scope": "files",
"description": "Create a File",
"link": "http://developers.app.net/docs/resources/file/lifecycle/#create-a-file"
},
{
"group": "file",
"name": "createPlaceholder",
"url_params": [],
"data_params": [
"file"
],
"array_params": [],
"get_params": [ "general_file" ],
"method": "POST",
"url": [
"files"
],
"token": "User",
"scope": "files",
"description": "Create a File Placeholder",
"link": "http://developers.app.net/docs/resources/file/lifecycle/#create-a-file"
},
{
"group": "file",
"n