EQ Network Objective-C SDK

Table of Contents

Overview

SessionService
create, check

UserService
User Object, Get
Create, Update, UploadIcon, DeleteIcon, Delete
ListCollections, Search, ListUsers, AddRelationship, ListFavoritedContentFiles
EmailAccounts, RequestPasswordReset, ResetPassword, ResendConfirmationEmail
LinkFacebook, UnlinkFacebook, LinkTwitter, UnlinkTwitter FacebookFindFriends, TwitterFindFriends
UpdateSocial, SocialAdd, SocialRemove
Purchase,

CollectionService
Collection Object, Get
Create, Update, UploadIcon DeleteIcon Delete,
ListContentFiles, AddRelationship,
SocialAdd SocialRemove
MarkAsViewed

ContentFileService
ContentFile Object, Get
Create, CreateFromUrl, Update, UpdateSortBy, ChangeCollection, FlagAsInappropriate, Delete,
ListPosts,
SocialAdd SocialRemove
MarkAsViewed

PostService
Post Object, Get
Create, Update, Delete

UploadService
Upload Object, UploadContext Object,
Begin, Complete, CreateContentFile,
ListUpload, ListUploads, UploadChunk, CancelUpload Upload Controller

InvitationService
Invitation Object, Accept, Confirm, Create, Update, Decline, Delete
ListInvitationsForCollection, ListInvitationsForUser, ListInvitationsToMe, Resend,

RequestService
Request Object, Accept, Confirm, Create, Update, Decline, Delete
ListRequestsForCollection, ListRequestsForUser, ListRequestsToMe, GetCollectionRequestGuid,

MiscService
ContentMenu: ContentMenu Object, ContentMenu_List
Hashtags: Hashtag Object, Hashtag_Search(), Hashtag_Trending
Categories: Category Object, Category_ListAll
Activity: Activity_Create

Search
Search Criteria,

Retrieving Media Content
DeliveryRequestId's and MuxKey's, Movie Url, Movie Preview Url, Thumbnail Url, Animated Gif Url, User Icon Url, Collection Icon Url

Utility Objects
PagingParameters


top
Overview
Equilibrium has developed an Objective-C SDK that makes calls to the EQNetwork backend servers via it's Web API. The SDK supports both synchronous and asynchronous versions of each function call. In addition, a few "controllers" have been created that support higher level functions (e.g. uploads, support of infinite lists, etc...)

In order to use the EQNetwork SDK you must create a process. All commands will be made by calling services within this process. When you call SessionService.Create to create a session the SessionGuid returned by this call will be saved in the process. Then, all further commands will be sent with this SessionGuid... in the documentation this will be considered the "logged in" user when executing commands. For example...

    EQProcess *eq = [[EQProcess alloc] initWithAccessKey:yourAccessKey secretKey:yourSecretKey];

    [eq.SessionService createWithUsername:yourUsername password:yourPassword onComplete: ^(Session *session, EQException *exception) {
        if (ex == nil)
        {
            [eq.UserService listCollectionsWithContext:self.listCollectionsContext pagingParameters:self.pagingParameters
                onComplete:^(NSArray *collections, bool hasMore, EQException *ex) {
            
            // do something with the collections returned
                
            }];
        }
        else
        {
            [self handleExceptionWithMessage:"SessionService.Create" eqException:ex];
        }
    }];

In this example after the SessionService.Create command has completeted, a UserService.ListCollections command will be executed for that logged in user.

All of the commands have been grouped together into services... these services are as follows:

• SessionService • UserService • CollectionService • ContentFileService
• PostService • UploadService • InvitationService • RequestService
• MiscService

As the clients evolved terminology diverged from the backend database (or sometimes, the backend is a little more generic). Here is a list of equivalent objects in the system.

Backend Client
User Account
Collection Channel
ContentFile Video
Post Comment

Users own (or follow, or contribute to) Collections. Collections have ContentFiles. ContentFiles have Posts. Posts have Posts (but only one level deep).

Errors
The synchronous, or blocking, functions will throw an exception if an error occurs. The asynchronous, or non-blocking, functions return an EQException parameter to the "onComplete" action block. If the EQException parameter is not null, then an error has occurred.

Installation

The souce code for the SDK and an example project can be downloaded at http://eqnetwork.com/developer/csharpsdk/eqnetwork-objectivec-source.zip.


top
SessionService
Most commands in the system require a SessionGuid. This is a string that is created using SessionService.create with the users login and password. The SessionGuid essentially identifies the User that is executing the command. The SessionGuid will be sent automatically with all commands after the SessionService.Create command has been executed. Sessions do eventually expire.

SessionService - (Session*)createWithUsername:(NSString*)username password:(NSString*)password;
Create a new SessionGuid (and return some additional system info.) This is effectively the login for the EQ Network SDK.

username is the unique user (or account) name.
password is the users case sensitive password.

Returns a Session object (which includes a
User object):

    @interface Session : NSObject
    
    @property (nonatomic, strong) User *user;
    @property (nonatomic, strong) NSString *expiredVersion;
    @property (nonatomic, strong) NSNumber *invitationCount;
    @property (nonatomic, strong) NSNumber *notificationCount;
    @property (nonatomic, strong) NSNumber *requestCount;
    @property (nonatomic, strong) NSArray *following;
    @property (nonatomic, strong) NSArray *followingUser;
    @property (nonatomic, strong) NSNumber *myCollectionCount;
    @property (nonatomic, strong) NSNumber *myStorage;
    
    @end        
The User node contains all of the User attributes.
SessionGuid is the value generated that you will use for all commands associated with this user.
ExpiredVersion, InvitationCount, NotificationCount, RequestCount, Following and Following User are all misc. pieces of system information that are useful to have available when the user logs in (and creates a session.)

SessionService - (Session*)checkWithSessionGuid:(NSString*)sessionGuid;
Check that a session is still valid. And also a quick way to retrieve updated values for InvitationCount, NotificationCount and RequestCount.

sessionGuid identifies the session to check.

Returns a partially filled in Session object with InvitationCount, NotificationCount and RequestCount. These are the number of invitations, the number of notifications, and the number requests that have been made to this user.

Note: If the session has expired an error would be returned.

TODO: Return everything a Session_Create does


top
UserService
Users (or accounts) are the primary entity in the EQ Network environment. The following are the major User functions:

Get will retrieve a User node with user attributes. Create allows a user to be created (will send a confirmation email). Update allows user attributes to be changed. UploadIcon allows the users avatar to be uploaded. DeleteIcon allows the users avatar to be deleted. Delete will delete a user. ListCollections will list a users collections. Search will search users. ListUsers will list a users relationships with other users. AddRelationship will create a relationship between two users. ListFavoritedContentFiles will list content files that have been favorited. EmailAccounts will email a list of Accounts (used by Forgot Username). RequestPasswordReset will email a link for password reset (used by Forgot Password). ResetPassword() a command that will reset the password (uses emailed reset guid). ResendConfirmationEmail resends the User Create confirmation email. LinkFacebook will link the EQ Network account to a Facebook account. UnlinkFacebook will unlink the EQ Network account from a Facebook account. LinkTwitter will link the EQ Network account to a Twitter account. UnlinkTwitter will unlink the EQ Network account from a Twitter account. FacebookFindFriends find Facebook friends (prioritizes Facebook friends who are also on EQ Network). TwitterFindFriends find Twitter followers (prioritizes Twitter followers who are also on EQ Network). UpdateSocial will update the social settings. SocialAdd will add a social event (e.g. watched video). SocialRemove will remove a social event. Purchase record a purchase for the logged in user.

User Object
In many responses you may get one (or a list of) User objects. A User object is a mix of user attributes and computed user values.

    @interface User : NSObject
    
    // fields that can be set on the backend by the SDK
    @property (nonatomic, strong) NSString *username;
    @property (nonatomic, strong) NSString *password;
    @property (nonatomic, strong) NSString *company;
    @property (nonatomic, strong) NSString *firstName;
    @property (nonatomic, strong) NSString *lastName;
    @property (nonatomic, strong) NSString *email;
    @property (nonatomic, strong) NSDate *dateOfBirth;
    @property (nonatomic, strong) NSString *gender;
    @property (nonatomic, strong) NSString *phone;
    @property (nonatomic, strong) NSString *carrier;
    
    
    // social info
    @property (nonatomic, strong) NSNumber *isSocialOn; // bool
    @property (nonatomic, strong) NSNumber *fbBits; // long
    @property (nonatomic, strong) NSNumber *twitterBits; // long
    
    // facebook
    @property (nonatomic, strong) NSNumber *fbIsLinked; // bool
    @property (nonatomic, strong) NSString *facebookId;
    @property (nonatomic, strong) NSString *fbAccessToken;
    @property (nonatomic, strong) NSDate *fbExpirationDate;
    
    // twitter
    @property (nonatomic, strong) NSNumber *twitterIsLinked; // bool
    @property (nonatomic, strong) NSString *twitterUserId;
    @property (nonatomic, strong) NSString *twitterScreenName;
    @property (nonatomic, strong) NSString *twitterOAuthToken;
    @property (nonatomic, strong) NSString *twitterOAuthTokenSecret;
    
    @property (nonatomic, strong) FileUploadSpec *icon; // only one way serialization
    
    // not writeable, but returned as computed fields
    @property (nonatomic, strong) NSNumber *userId; // int
    @property (nonatomic, strong) NSNumber *active; // bool
    @property (nonatomic, strong) NSDate *created;
    @property (nonatomic, strong) NSDate *modified;
    @property (nonatomic, strong) NSNumber *userTypeId; // int
    @property (nonatomic, strong) NSString *iconFilename;
    @property (nonatomic, strong) NSNumber *verified; // bool
    @property (nonatomic, strong) NSString *confirmationGuid;
    @property (nonatomic, strong) NSString *agreementAccepted;
    @property (nonatomic, strong) NSDate *createdOn;
    @property (nonatomic, strong) NSNumber *membershipTypeId; // int
    @property (nonatomic, strong) NSDate *membershipExpiration;
    @property (nonatomic, strong) NSNumber *membershipStorageLevelExpires; // long
    @property (nonatomic, strong) NSNumber *membershipStorageLevel; // long
    @property (nonatomic, strong) NSNumber *membershipStorageUsed; // long
    @property (nonatomic, strong) NSDate *lastNotificationEmail;
    @property (nonatomic, strong) NSDate *currentNotificationEmail;
    @property (nonatomic, strong) NSNumber *membershipStorageLevelEarned; // long
    
    // calculated results from the backend
    @property (nonatomic, strong) NSNumber *unviewedCount; // int
    @property (nonatomic, strong) NSNumber *followedBy; // bool
    @property (nonatomic, strong) NSNumber *blocked; // bool
    @property (nonatomic, strong) NSNumber *following; // bool
    @property (nonatomic, strong) NSNumber *followers; // int
    @property (nonatomic, strong) NSNumber *channelFollowers; // int
    @property (nonatomic, strong) NSString *userTitle;
    
    @end
        
UnviewedCount is sum of the Collections UnviewedCount being followed by this user.
UserTitle is a calculated value and will be Company, if it exists, or UserName. Use this value to display the user as in the future we may change how a user is displayed on the backend, and then this would propogate to all the clients.
UserId is a unique identifier of a User.
Active is True if the user is active, or false if the user has been deleted (but not yet scrubbed from the database.)
Created is the date and time the User record was created.
Modified is the date and time the User record was last modified.
UserName, Company, FirstName, LastName, Email, DateOfBirth, Gender, Phone and Carrier are all basic attributes of the user.
UserTypeId currently there is only one type of user (1: Normal).
IconFilename this is the filename of the users icon. See
User Icon Url for more information on how to retrieve this image.)
Verified indicates if the user has been verified by their confirmation email.
ConfirmationGuid used to match a confirmation email with a user.
AgreementAccepted is the version level of the agreement the user has accepted.

UserService - (User*)getWithUserId:(int)userId;
UserService - (User*)getWithUserName:(NSString*)username;
UserService - (User*)get;
Get a User object. If the User object retrieved is not for the logged in User not all information will be filled in for privacy reasons. The version with no parameter retrieves the object for the currently logged in User.

Username is the Username of the User to be retrieved.
UserId is the UserId of the User to be retrieved.

Response is the User object of the requested User (see
User Object).

UserService - createWithUser:(User*)user;
Create a new user, the User object must have the following fields and the object will be updated with computed fields when the function is complete. This will also send a confirmation email if successfull.

UserName is the unique user (or account) name.
Password is the users case sensitive password.
FirstName, LastName and Email are all required fields.
Company, if it exists, will be used instead of UserName for the users display name.
DateOfBirth and Gender are required fields.
Phone and Carrier are optional.
Icon is optional. It is the Users account icon. This is a local file that will be uploaded as part of the multipart form data.
CreatedOn specifieds the environment that the user account was created on. (e.g. iOS, Web, etc...)

You will also be returned a session object. With this you are essentially already logged in.

UserService - updateWithUser:(User*)user;
Only fields that have been set in the User object will be sent to the Backend for the update. This will send a confirmation email if the email address has changed.

UserService - uploadIconWithPath:(NSString*)path;
UserService - uploadIconWithFileUploadSpec:(FileUploadSpec*)fileUploadSpec;
UserService - deleteIcon;
You can update (for the currently logged in user) the User icon (avatar) in the Create or Update functions... or, you can update it independantly with one of these function.

UserService - deleteUser;
This will delete the currently logged in user.

List Collections associated with a User. Pagination is supported. Search criteria is supported.

    @interface ListCollectionsContext : NSObject
    
    typedef enum SortOrder
    {
        Alpha, Recent, Popularity, Comments,
    };

    @property (nonatomic, strong) SearchFilters *searchFilters;
    @property (nonatomic, assign) bool includeEmpty;
    @property (nonatomic, assign) bool includeUsers;
    @property (nonatomic, assign) bool notificationCountInSort;
    @property (nonatomic, strong) NSArray *user_CollectionTypes; // array of NSNumber

    @end
SortOrder an enum of the valid strings that can be used in the PagingParameters SearchFilters these are standard search parameters used in several search commands in EQ Network. (see
SearchFilters)
IncludeEmpty will include Collections that have no ContentFiles
includeUsers when true the search results will include Collection objects that represent matching Users.
NotificationCountInSort will cause Collections to be first sorted by NotificationCount (currently used in the Watch section)
User_CollectionTypes if specified will limit the results to the Collections of the specified type of relationship (owner, follower, and/or contributor)
PagingParameters the parameters to specify the size, offset and sort order of the returned results (see PagingParameters)

Response is a List of Collection objects (see Collection Object)

Search Users. Pagination is supported.

Search is the search term to use.
PagingParameters the parameters to specify the size, offset and sort order of the returned results (see
PagingParameters)

Response is a List of User objects. (see User Object)

List Users associated with a User. Pagination is supported. Search criteria is supported.

    @interface ListUsersContext : NSObject
    
    typedef enum SortOrder
    {
    Alpha, Recent,
    };
    
    @property (nonatomic, strong) SearchFilters *searchFilters;
    @property (nonatomic, assign) bool following;
    @property (nonatomic, assign) bool blocked;
    @property (nonatomic, assign) bool includeChannelFollowers;
    @property (nonatomic, assign) bool showInverse;
    @property (nonatomic, assign) int userId;
    
    @end
SortOrder an enum of the valid strings that can be used in the PagingParameters SearchFilters these are standard search parameters used in several search commands in EQ Network. (see
SearchFilters)
Following only include users that are following
ShowInverse will show, for example, who is following a user instead of who a user is following.
Blocked only include users that are blocked
IncludeChannelFollowers only include users that are following the logged in user
PagingParameters the parameters to specify the size, offset and sort order of the returned results (see PagingParameters)

Response is a List of User objects. (see User Object)

Add a Relationship from the logged in user to another user (for now Adds a following relationship or blocks a user).

    @interface AddUserRelationshipContext : NSObject

    @property (nonatomic, assign) int other_UserId;
    @property (nonatomic, assign) bool following;
    @property (nonatomic, assign) bool blocked;
    @end
Other_UserId is the user who the relationship is with.
Following if set to YES will follow the other user. If set to NO will "unfollow" the other user.
Block if set to YES will block the other user. If set to NO will "unblock" the other user.

UserService - NSArray *listFavoritedContentFilesWithContext:(ListContentFilesContext*)listContentFilesContext
        pagingParameters:(PagingParameters*)pagingParameters;
List the ContentFiles that have been favorited by the logged in user.

ListContentFilesContext contains parameters that are primarily used to filter the returned list.
PagingParameters the parameters to specify the size, offset and sort order of the returned results (see
PagingParameters)

Response is a List of ContentFile objects (see ContentFile Object)

UserService - void emailAccountsWithEmailAddress:(NSString*)emailAddress;
Email a list of usernames associated with an email address *to* that email address (used for Forgot Username).

Email is the email address associated with the User(s)

UserService - void requestPasswordResetWithUsername:(NSString*)username;
Sends an Email to the specified User with a Password Reset link. The email is sent to the email address associated with the User.

Username is the username of the User that wishes a password reset.

UserService - void resetPasswordWithPasswordResetGuid:(NSString*)passwordResetGuid
        password:(NSstring*)password;
Using the PasswordResetGuid sent in the RequestPasswordReset email... change the password.

PasswordResetGuid is the PasswordResetGuid sent in the RequestPasswordReset email.
Password is the new password.

UserService - void resendConfirmationEmail;
Resends the confirmation email to the currently logged in user (first sent when User was created).

UserService - User linkFacebookWithAccessToken:(NSString*)accessToken
        expirationDate:(NSDate*)expirationDate;
Link logged in User to a Facebook account.

AccessToken and ExpirationDate are provided by the Facebook API and identifies the Facebook user.

Response is an updated User object (see
User Object).

UserService - User unlinkFacebook;
Unlink logged in User from Facebook.

Response is an updated User object (see
User Object).

UserService - User linkTwitterWithTwitterUserId:(NSString*)twitterUserId
        screenName:(NSString*)screenName
        oAuthToken:(NSString*)oAuthToken
        oAuthTokenSecret:(NSString*)oAuthTokenSecret;
Link logged in User to a Twitter account.

TwitterUserId, ScreenName, OAuthToken and OAuthTokenSecret are provided by the Twitter API and identify the Twitter user.

Response is an updated User object (see
User Object).

UserService - User unlinkTwitter;
Unlink logged in User from Twitter.

Response is an updated User object (see
User Object).

UserService - NSArray *facebookFindFriendsWithTerm:(NSString*)term
        socialSearchType:(SocialSearchType)socialSearchType
        pagingParameters:(PagingParameters*)pagingParameters;
List the Facebook friends whose name matches the search string.

Search is the search term to use.
SocialSearchType wether to search for EQ Network members or not. (see
SocialSearchType)
PagingParameters the parameters to specify the size, offset and sort order of the returned results (see PagingParameters)

Response is a List of Friend objects (see Friend Object)

UserService - NSArray *twitterFindFriendsWithTerm:(NSString*)term
        socialSearchType:(SocialSearchType)socialSearchType
        pagingParameters:(PagingParameters*)pagingParameters;
List the Twitter followers whose name matches the search string.

Search is the search term to use.
SocialSearchType wether to search for EQ Network members or not. (see
SocialSearchType)
PagingParameters the parameters to specify the size, offset and sort order of the returned results (see PagingParameters)

Response is a List of Friend objects (see Friend Object)

UserService - User updateSocialWithIsSocialOn:(bool)isSocialOn
        fbBits:(int)fbBits twitterBits(int)twitterBits;
Update the currently logged in users social information. Primarily if and what is shared to social networks.

isSocialOn indicates if sharing of actions to social networks is on or off.
FbBits the active social settings for Facebook (see
SocialBits)
TwitterBits the active social settings for Twitter (see SocialBits)

Response is an updated User object (see User Object).

UserService - void socialAddWithAction:(NSString*)action collectionId:(NSNumber*)collectionId
        contentFileId:(NSNumber*)contentFileId force:(bool)force;
Create an Action that may be shared with social networks. If an action is forced it will be shared with the social networks regardless of social settings. For example a user may normally wish to not share movie watching activity... but on a specific video click a button to indicate that in this case share the action.

Action the action to share. ("watch", "upload", "comment", "share", "follow", "create", "like", "favorite")
CollectionId the id of the Collection that the action was acted upon
ContentFileId the id of the ContentFile that the action was acted upon
Force indicates if the action is to be forced through regardless of social settings

UserService - void socialRemoveWithAction:(NSString*)action collectionId:(NSNumber*)collectionId
        contentFileId:(NSNumber*)contentFileId force:(bool)force;
Remove a previously created Action from social networks.

Action, CollectionId, ContentFileId and Force must match the previously created action.

UserService - PurchaseTransaction *purchaseWithContext:(PurchaseContext*)purchaseContext;
Executes a purchase transaction. The receipt data (which would have been provided by the payment provider) will be verified by the payment provider. If the purchase is verified a list of products purchased will be returned. Currently there is one product available for purchase: "Pro Access 15G 1 Year Subscription for $69.99", product code: "ProAccess_15G_1YR".

If the purchase is verified all user information related to the purchase is updated (e.g. additional storage).

    @interface PurchaseContext : NSObject
    
    typedef enum PaymentTypeNames
    {
        AlreadyOwn, Apple, Simulator, PayPal,
    };
    
    @property (nonatomic, strong) NSString *productCode;
    @property (nonatomic, strong) NSString *uuid;
    @property (nonatomic, strong) NSString *paymentType;
    @property (nonatomic, strong) NSString *receiptData;
    @property (nonatomic, assign) float price;
    @property (nonatomic, strong) NSString *priceLocale;
    @property (nonatomic, strong) NSString *currencyCode;
    @property (nonatomic, strong) NSString *countryCode;
    @property (nonatomic, assign) bool isSandbox;
    
    @end
PaymentTypeNames are the valid strings for PaymentType
ProductCode is the product code. (ProAccess_15G_1YR)
UUID is a unique device identifier (optional)
PaymentType is the payment provider (AlreadyOwn is used to revalidate a receipt)
ReceiptData is the receipt data from the payment provider
Price is the purchase price
PriceLocale is the price locale
CurrencyCode is the currency code
CountryCode is the country code
IsSandbox indicates if this transaction is utilizing the payment providers sandbox mode
    @interface PurchaseTransaction : NSObject
    
    @property (nonatomic, strong) int PurchaseTransactionId;
    @property (nonatomic, strong) NSArray *products; // array of Product*
    @end
PurchaseTransactionId is the id of the completed transaction
Products is a list of Products purchased (see
Product Object)

PurchaseContext is the information about the purchase

Response is a list of Product objects.


top
CollectionService
Collections (or channels) are essentially folders that ContentFiles can be stored in. They are currently *not* nested. The following are the major Collection functions.

Get will retrieve a Collection object with collection attributes. Create allows a collection to be created. Update allows collection attributes to be changed. UploadIcon allows the collections icon to be uploaded. DeleteIcon allows the collections icon to be deleted. Delete will delete a collection. ListContentFiles will list a collections ContentFiles. AddRelationship will delete a collection. SocialAdd will add a social event (e.g. created collection). SocialRemove will remove a social collection event. MarkAsViewed will mark the collection as viewed.

Collection Object
In responses you may get one (or a list of) Collection objects. A Collection object is a mix of collection attributes and calculated collection values. It will look like this:

    @interface Collection : NSObject
    
    @property (nonatomic, strong) NSString *name;
    @property (nonatomic, strong) NSString *description;
    @property (nonatomic, assign) CollectionType collectionType;
    @property (nonatomic, strong) NSString *iconFilename;
    @property (nonatomic, strong) NSArray *categoryList; // array of strings
    @property (nonatomic, strong) FileUploadSpec *icon;
    
    // computed fields
    @property (nonatomic, strong) NSString *collectionId;
    @property (nonatomic, strong) bool active;
    @property (nonatomic, strong) NSDate *created;
    @property (nonatomic, strong) NSDate *modified;
    @property (nonatomic, strong) NSNumber *sortBy;
    
    @property (nonatomic, strong) int user_CollectionTypeId;
    
    @property (nonatomic, strong) int followersCollection;
    @property (nonatomic, strong) int followersUser;
    
    @property (nonatomic, strong) int ownerUserId;
    @property (nonatomic, strong) NSString *ownerUserIconFilename;
    @property (nonatomic, strong) NSString *ownerUserTitle;
    
    @property (nonatomic, strong) int contentFileCount;
    @property (nonatomic, strong) int unviewedCount;
    @property (nonatomic, strong) NSDate *mostRecent;
    @property (nonatomic, strong) int notificationCount;
    @property (nonatomic, strong) int viewCount;
    @property (nonatomic, strong) int sortTypeId;
    @property (nonatomic, strong) int numberOfComments;
    
    @end
Name is the name of the collection
Description is the description of the collection.
CollectionType is the collection type (1: Normal, 2:Private)
IconFilename this is the filename of the collections icon. See Collection Icon Url for more information on how to retrieve this image.)
Categories is a list of Categories (e.g. Sports, Golf)
Icon is used to include an upload of the icon in the Create command
CollectionId is a unique identifier for the collection.
Active is True if the collection is active, or false if the collection has been deleted (but not yet scrubbed from the database.)
Created is the date and time the Collection record was created.
Modified is the date and time the Collection record was last modified.
SortBy a custom sorting sequence for a list of Collections (not implemented).
User_CollectionTypeId defines the relationship between the user and the collection (1: Owner, 2: Follower, 3:Contributor). OwnerUserId is the UserId this collection belongs to.
OwnerUserIconFilename is the IconFilename of the user this collection belongs to.
OwnerUserTitle is the UserTitle of the user this collection belongs to.
ContentFileCount is the number of ContentFiles in this Collection.
UnviewedCount is the number of ContentFiles that have not been viewed.
MostRecent is the date/time of when the Collection was last viewed.
NotificationCount is the number of ContentFiles that have been added since this Collection was last viewed.
ViewCount is a count of how many times movies inside the collection have been viewed.
NumberOfComments is a count of all the comments in this collection.

Note: A Collection can have only one Owner. A Collection can have multiple Followers and/or Contributors. A Follower will receive notifications about changes in a Collection and the Collection will appear in the Followers Watch list. A Contributor is like a Follower, but additionally can add ContentFiles to this Collection.

CollectionService - Collection *getWithCollectionId:(int)collectionId;
CollectionService - Collection *getWithCollectionGuid:(NSString*)collectionGuid;
Get a Collection object. If the collection is private, then the user must be the owner of, a contributor to, or a follower of, the collection.

CollectionId is the Id of the Collection object.
CollectionGuid is the unique Guid of the Collection object.

Response is a Collection object (see
Collection Object)

CollectionService - void createWithCollection:(Collection*)collection;
Create a new collection, the Collectin object must have the following fields and the object will be updated with computed fields when the function is complete. The Collections "owner" will be the currently logged in user.

Name is the name of the collection.
Description is the description of the collection.
Categories is a comma delimited list of categories (see
Categories).
Private indicates that the collection is not visible in Search results, etc...
Icon is optional. It is the Collections icon. This is a local file that will be uploaded as part of the multipart form data. If an icon is not uploaded a default icon will be chosen based on one of the Categories.

Response is an updated Collection object (see Collection Object)

CollectionService - void updateWithCollection:(Collection*)collection;
Update a Collection.

Response is an updated Collection object (see
Collection Object)

CollectionService - uploadIconWithCollectionId:(int)collectionId path:(NSString*)path;
CollectionService - uploadIconWithCollectionId:(int)collectionId fileUploadSpec:(FileUploadSpec*)fileUploadSpec;
CollectionService - deleteIconWithCollectionId:(int)collectionId;
You can update Collection icon in the Create or Update functions... or, you can update it independantly with one of these functions.

The action taken with this command depends on the relation between the currently logged in user and the Collection. If the User is the owner of this collection, then the collection will be deleted. If the User is a follower of, or contributor to, this collection... then this relationship will be deleted.

List the ContentFiles that belong to a collection. Pagination is supported. Search criteria is supported.

    @interface ListContentFilesContext : NSObject

    typedef enum SortOrder
    {
        Alpha, Recent, Popularity, Comments,
    };

    typedef enum ColumnSetStrings
    {
        Normal, Lean,
    };

    @property (nonatomic, strong) SearchFilters *searchFilters;
    @property (nonatomic, assign) bool searchMatchOnly;
    @property (nonatomic, strong) NSNumber *current_ContentFileId;
    @property (nonatomic, strong) NSNumber *getNext_Offset;
    @property (nonatomic, strong) NSString *columnSet;

    @end
SortByStrings an enum of the valid strings that can be used in the PagingParameters
SearchFilters these are standard search parameters used in several search commands in EQ Network. (see
SearchFilters)
SearchMatchOnly if this is true only return matched ContentFiles... if false then return all ContentFiles, but matched ones first.
Current_ContentFileId the ContentFileId to begin listing.
GetNext_Offset the offset *from* the Current_ContentFileId to begin listing.
ColumnSet if Lean is specified only the bare bones information for each ContentFile will be included (for performance)
PagingParameters the parameters to specify the size, offset and sort order of the returned results (see PagingParameters)

Current_ContentFileId and GetNext_Offset are used together to get ContentFiles *after* a given ContentFile within a Collection. Currently this is used to play the *next* movie.

Response is a List of ContentFile objects (see ContentFile Object)

This will add a "Following", or a "Contributor" relationship between the currently logged in user and a Collection.

CollectionId is the unique identifier of the Collection.
User_CollectionTypeId defines the relationship being added between the user and the collection (e.g. follower or contributor).

Note: To remove this relationship, call CollectionService.Delete.

Create an Action on a Collection that may be shared with social networks. If an action is forced it will be shared with the social networks regardless of social settings. For example a user may normally wish to not share collection following activity... but on a specific collection click a button to indicate that in this case share the action.

CollectionId the id of the Collection that the action was acted upon
Action the action to share. ("share", "follow", "create", "like")
Exclude a specific SocialService to exclude from this action. Force indicates if the action is to be forced through regardless of social settings

CollectionService - void socialRemoveWithCollectionId:(int)collectionId action:(NSString*)action force:(bool)force;
Remove a previously created Collection Action from social networks.

CollectionId, Action and Force must match the previously created action.

CollectionService - void markAsViewedWithCollectionId:(int)collectionId;
Marks a Collection as viewed... this is used for statistical and notification purposes.

CollectionId is the Id of the Collection to mark as viewed.


top
ContentFileService
ContentFiles are the movies that have been uploaded into a Collection (or Channel). The following are the major ContentFile functions. (for additional ContentFile functions see ContentFiles (other).)

Get will retrieve a ContentFile object. Create will upload and create a content file. CreateFromUrl will create a content file from a url provided. Update allows content file attributes to be changed. UpdateSortBy updates the SortBy property independantly. ChangeCollection updates which Collection owns the ContentFile. FlagAsInappropriate will flag this ContentFile as inappropriate. Delete will delete a content file. ListPosts will list a content files posts (or comments). SocialAdd will add a social event (e.g. created a content file). SocialRemove will remove a social content file event. MarkAsViewed will mark the content file as viewed.

ContentFile Object
    @interface ContentFile : NSObject

    @property (nonatomic, strong) NSString *name;
    @property (nonatomic, strong) NSString *description;
    @property (nonatomic, assign) NSString *videoFilename;
    @property (nonatomic, strong) NSString *thumbnailFilename;
    @property (nonatomic, strong) NSArray *categoryList; // array of strings
    @property (nonatomic, strong) FileUploadSpec *video;
    @property (nonatomic, strong) FileUploadSpec *thumbnailFile;

    @property (nonatomic, strong) int collectionId;

    // computed fields
    @property (nonatomic, strong) int contentFileId;
    @property (nonatomic, assign) bool active;
    @property (nonatomic, strong) NSDate *created;
    @property (nonatomic, strong) NSDate *modified;
    @property (nonatomic, strong) NSNumber *sortBy;

    @property (nonatomic, strong) NSString *muxKey;

    @property (nonatomic, assign) NSNumber *userId; // int
    @property (nonatomic, strong) NSString *keywords;

    @property (nonatomic, assign) NSNumber *contentFileTypeId; // int
    @property (nonatomic, assign) NSNumber *deliveryRequestId; // int
    @property (nonatomic, strong) NSString *JdiResult;

    @property (nonatomic, strong) bool IsAdult;
    @property (nonatomic, strong) NSNumber *ViewCount; // int
    @property (nonatomic, strong) NSString *originalUrl;
    @property (nonatomic, strong) NSNumber *originalFilesize; // long
    @property (nonatomic, strong) NSNumber *viewCount; // int
    @property (nonatomic, strong) NSString *originalUrl;
    @property (nonatomic, strong) NSNumber *originalFilesize;
    @property (nonatomic, strong) NSString *DownloadUrl;
    @property (nonatomic, strong) NSNumber *Width; // int
    @property (nonatomic, strong) NSNumber *Height; // int
    @property (nonatomic, strong) NSNumber *Duration; // float
    @property (nonatomic, strong) NSString *Thumbnail;
    @property (nonatomic, strong) NSNumber *IsFlashVideo; // bool
    @property (nonatomic, strong) NSString *Filename;
    @property (nonatomic, strong) NSString *CurrentMuxKey;

    @end
    
ContentFileId is a unique identifier for the content file.
Active is True if the content file is active, or false if the content file has been deleted (but not yet scrubbed from the database.)
Created is the date and time the ContentFile record was created.
Modified is the date and time the ContentFile record was last modified.
UserId is the unique identifier of the user this content file belongs to.
Name is the name of the content file
Description is the description of the content file.
Keywords are the keywords for this content file.
ContentFileTypeId is the content file type (1: Movie)
Filename is the filename of the content file. (this can uniquely identify the ContentFile, without providing a sequential index, for example in sharing.
DeliveryRequestId, JdiResult and MuxKey contains information about the downloading and/or processing of the video. (see DeliveryRequestId's and MuxKey's for more information).
IsAdult a flag that is True if an adult category was chosen for this content file (or containing collection).
Categories is a comma delimited list of Categories (e.g. Sports, Golf).
ViewCount is the number of times this content file has been viewed.
OriginalUrl is the url of where this files was downloaded from (if it was downloaded).
OriginalFilesize is the size of the original file.
DownloadUrl this may be different from the OriginalUrl if the movie was inside a page pointed to by OriginalUrl.
CollectionId the Collection this ContentFile belongs to.
UserViewCount the number of times this ContentFile has been viewed by the user making this request. (SessionGuid)
NumberOfComments the number of posts (and sub-posts) that have been made on this ContentFile.
SearchMatched indicates if this ContentFile matched a filter set (you still get the ContentFile... just, typically, ordered by Filter matches first).
CurrentTime in the case of a movie, this shows the time offset in the movie the user last viewed.

Note: A ContentFile can belong to only one collection.

Get a Collection object.

ContentFileId is the Id of the ContentFile to be retrieved.
Filename is as system generated unique filename for the ContentFile.

Response is the ContentFile object of the requested ContentFile (see
ContentFile Object).

ContentFileService - void createWithContentFile:(ContentFile*)contentFile;
ContentFileService - void createFromUrlWithContentFile:(ContentFile*)contentFile url:(NSString*)url;
Create a new content file.

CollectionId is the Collection this ContentFile is being added to.
Name is the name of the content file.
Description is the description of the content file.
Keywords are the keywords for this content file.
Categories is a comma delimited list of categories (see
Categories).
Video is a local file that will be uploaded as part of the multipart form data.
Url is an http link to either a file, or a page containing a flash movie.
IsFlashVideo is a flag indicating which type of Url it is (file or page containing flash).

Response is an updated ContentFile object (see ContentFile Object)

Note: MuxKey contains information about the downloading and/or processing of the video. (see DeliveryRequestId's and MuxKey's for more information).

Update a ContentFile.

Response is an updated ContentFile object (see
ContentFile Object)

ContentFileService - ContentFile *updateSortByWithContentFileId:(int)contentFileId sortBy:(NSNumber*)sortBy;
Update a ContentFile's SortBy value (float).

Response is an updated ContentFile object (see
ContentFile Object)

ContentFileService - void changeCollectionWithContentFileId:(int)contentFileId
        old_CollectionId:(int)old_CollectionId new_CollectionId:(int)new_CollectionId;
Change the Collection that a ContentFile belongs to.

ContentFileId is the ContentFile to change.
Old_CollectionId is the Collection that the ContentFile originally belongs to.
New_CollectionId is the new Collection that the ContentFile will belong to.

ContentFileService - void flagAsInappropriateWithContentFileId:(int)contentFileId;
This will cause a notification to be sent to EQ Network staff.

ContentFileId is the Id of the ContentFile.

ContentFileService - void deleteWithContentFile:(ContentFile*)contentFile;
ContentFileService - void deleteWithContentFileId:(int)contentFileId;
The action taken with this command depends on the relation between the currently logged in user and the Collection. If the User is the owner of this content file, then the content file will be deleted. If the User is a follower of this content file... then this relationship will be deleted.

ContentFileService - NSArray *listPostsWithFilename:(NSString*)filename
        pagingParameters:(PagingParameters*)pagingParameters);
List Posts associated with a ContentFile. Pagination is supported.

Filename identifies the ContentFile to list posts for.
PagingParameters the parameters to specify the size, offset and sort order of the returned results (see
PagingParameters)

Response is an list of Post objects (see Post Object.)
In a post, Level is the depth of the post. There are two levels of depth. A depth of one for comments on the content file. And a depth of two for comments on a comment.

ContentFileService - void socialAddWithContentFileId:(int)contentFileId exclude:(NSNumber*)exclude
        action:(NSString*)action force:(bool)force;
Create an Action on a ContentFile that may be shared with social networks. If an action is forced it will be shared with the social networks regardless of social settings. For example a user may normally wish to not share content file viewing activity... but on a specific instance click a button to indicate that in this case share the action.

ContentFileId the id of the ContentFile that the action was acted upon
Action the action to share. ("share", "follow", "create", "like")
Exclude a specific SocialService to exclude from this action. Force indicates if the action is to be forced through regardless of social settings

ContentFileService - void socialRemoveWithContentFileId:(int)contentFileId
        action:(NSString*)action force:(bool)force;
Remove a previously created ContentFile Action from social networks.

ContentFileId, Action and Force must match the previously created action.

ContentFileService - void markAsViewedWithContentFileId:(int)contentFileId;
Marks a ContentFile as viewed... this is used for statistical and notification purposes.

ContentFileId is the Id of the ContentFile to mark as viewed.


top
PostService
Posts are the comments that have been made to content files.

Get will retrieve a post. Create will create a post. Update will update a post. Delete will delete a post.

Post Object
    @interface Post : NSObject
    
    @property (nonatomic, strong) NSString *title;
    @property (nonatomic, strong) NSString *message;
    @property (nonatomic, assign) NSNumber *commentOn_PostId; // int
    @property (nonatomic, strong) NSNumber *commentOn_UserId; // int
    @property (nonatomic, strong) NSNumber *commentOn_ContentFileId; // int
    @property (nonatomic, strong) NSNumber *postType; // PostType
    
    // computed fields
    @property (nonatomic, strong) int postId;
    @property (nonatomic, assign) bool active;
    @property (nonatomic, strong) NSDate *created;
    @property (nonatomic, strong) NSDate *modified;
    @property (nonatomic, strong) NSNumber *sortBy;

    @property (nonatomic, strong) NSNumber *userId; // int
    @property (nonatomic, strong) NSNumber *child_PostId; // int
    @property (nonatomic, strong) NSString *userName;
    @property (nonatomic, strong) NSString *userTitle;
    @property (nonatomic, strong) NSNumber *level; // int

    @end
    
Level is the depth of the post. There are two levels of depth. A depth of one for comments on the content file. And a depth of two for comments on a comment.
UserTitle is a calculated value and will be Company, if it exists, or UserName. Use this value
UserName is the UserName of the User who made this post
PostId is a unique identifier for the post.
Child_PostId the post unique identifier that this is a reply to.
UserId is the unique identifier of the user who made this post.
Title is the title of a comment (not currently used).
Message this is the body of the post. Created is the date and time the Post record was created.

PostService - Post *getWithPostId:(int)postId;
Get a Post object.

PostId is the Id of the Post to be retrieved.

Response is the Post object of the requested post (see
Post Object).

PostService - void createWithPost:(Post*)post;
Create a new post.

Title is the title of a comment (not currently used).
Message this is the body of the post. Created is the date and time the Post record was created.
CommentOn_ContentFileId the content file that this post is a comment on.
CommentOn_PostId the post that this post is a comment on.

Response is an updated Post object (see
Post Object)

PostService - void updateWithPost(Post*)post;
Update a Post.

Response is an updated Post object (see
Post Object)

PostService - void deleteWithPost:(Post*)post;
PostService - void deleteWithPostId:(int)postId;
Deletes a post.


top
UploadService
Uploads can be started, paused, cancelled and continued. For reliable uploads EQ Network has implemented a chunked upload strategy. The control of which chunks remain to be uploaded, their offsets and size, are determined and managed by the backend. The client will request a list of chunks to upload from the backend and then upload them.

The C# SDK contains an
Upload Controller which wraps all of the upload functionality into one object. The controller is preferred over using the individual methods documented here. This controller handles the upload of multiple files as well as pausing and prioritizing uploads.
(see Upload Controller)

Begin starts the upload. Complete indicates that the upload is complete. CreateContentFile creates a ContentFile from a completed upload. ListUpload list the chunks required by the backend. ListUploads list the chunks required by the backend for all uploads. UploadChunk upload a chunk. CancelUpload cancels an upload.

Upload Object
UploadService - Upload *beginWithContext:(UploadContext*)uploadContext;
Start the upload.

UploadService - Upload *completeWithContext:(UploadContext*)uploadContext;
Indicates that the Upload is complete.

UploadService - Upload *listUploadWithContext:(UploadContext*)uploadContext;
Create a ContentFile from a completed upload.

UploadService - NSArray *listUploadsWithPreferredChunkSize:(int)preferredChunkSize
        numberOfChunks:(int)numberOfChunks;
List the next batch of chunks required by the backend.

UploadService - long uploadChunkWithTotal:(long*)total context:(UploadContext*)uploadContext
        chunkOffset:(long)chunkOffset chunkSize:(long)chunkSize chunk:(FileUploadSpec*)chunk;
List the next batch of chunks required by the backend for all uploads for the currently logged in user.

UploadService - Upload cancelUploadWithContext:(UploadContext*)uploadContext;
Upload a chunk. Retries are handled by the backend and chunks may be re-requested.

UploadService - void createContentFileWithContentFile:(ContentFile*)contentFile
        context:(UploadContext*)uploadContext;
Cancel an upload


top
Upload Controller
The Upload Controller wraps all of the upload functionality into one object. The controller is preferred over using the individual methods. This controller handles the upload of multiple files as well as pausing and prioritizing uploads.

Example code for using the Upload Controller:

- (void)uploadControllerTest path:(NSString*)path {

    ContentFile *contentFile = [[ContentFile alloc] init];
    contentFile.name = "SmallOne";
    contentFile.categoryList = [[NSArray alloc] initWithObjects: "Sports", "Music", null];
    contentFile.colletionId = 262;
    
    UploadController *uploadController = [[UploadController alloc] init:_eq];

    [uploadController startWithName:contentFile.Name path:path, ^(uploadContext, uploadState) { // onStateChange
        if (uploadState == UploadState_CREATE_CONTENTFILE)
        {
            uploadContext.ContentFile = contentFile;
        }
        if (uploadState == UploadState_FINISHED)
        {
            [upload_Controller cancel];
            _message = "success";
        }
    });
}
    
Note: You can "Start" more than one upload at a time. The controller will remain active until Upload_Controller.Cancel is called.


top
InvitationService
Invitations can be sent to email address or other EQ Network users. An Invitation can be an invitation to follow or contribute to a Collection. Invitations are the only way that followers can exist on a private channel. An Invitation can also be an invitation to follow the currently logged in user.

Accept an invitation. Confirm an invitation. Create an invitation. Update an invitation. Decline an invitation. Delete an invitation. ListInvitationsForCollection will list all invitations for a collection. ListInvitationsForUser will list all invitations for a user. ListInvitationsToMe will list all invitations to the currently logged in user. Resend an invitation.

InvitationContext Object
    @interface InvitationContext : NSObject
    
    @property (nonatomic, strong) NSNumber *collectionId; // int
    @property (nonatomic, strong) NSNumber *user_CollectionTypeId; // int
    @property (nonatomic, assign) NSNumber *other_UserId; // int
    @property (nonatomic, strong) NSNumber *user_UserFollowing; // bool

    @property (nonatomic, strong) NSString *emails;
    @property (nonatomic, strong) NSString *message;
    
    @property (nonatomic, strong) NSString *sendTo_FacebookIds;
    @property (nonatomic, assign) NSString *sendTo_TwitterIds;
    @property (nonatomic, strong) NSString *sendTo_UserIds;
    @property (nonatomic, strong) NSString *sendTo_SmsPhones;
    
    @property (nonatomic, strong) NSNumber *sentClientSide; // bool
    
    @property (nonatomic, strong) NSString *data;
    
    @end
    
InvitationService - void acceptWithInvitationGuid:(NSString*)invitationGuid;
Used by an Invitation recipient to accept an invitation.

InvitationService - void confirmWithGuid:(NSString*)invitationGuid;
Used by an Invitation recipient to confirm an invitation.

InvitationService - InvitationMessage *createWithContext:(InvitationContext*)invitationContext;
Create an invitation. This will email the recipient.

InvitationService - InvitationMessage *updateWithContext:(NSString*)invitationContext;
Update an invitation.

InvitationService - void declineWithInvitationGuid:(NSString*)invitationGuid;
Decline an invitation.

InvitationService - void deleteWithInvitationGuid:(NSString*)invitationGuid;
Delete an invitation.

InvitationService - NSArray *listInvitationsForCollectionWithCollectionId:(int)collectionId;
List all the invitations that have been sent for a given collection.

InvitationService - NSArray *listInvitationsForUserWithUserId:(int)userId;
List all the invitations that have been sent to follow a given user.

InvitationService - NSArray *listInvitationsToMeWithInvitationTypes:(NSArray*)invitationTypes all:(bool)all;
List all of the invitations that have been sent to the email address of the currently logged in user.

InvitationService - void resendWithInvitationGuid:(NSString*)invitationGuid;
Resend an invitation.


top
RequestService
A Request can be a request to follow or contribute to a Collection. A Request can also be a request to follow a user.

Accept a request. Confirm a request. Create a request. Update a request. Decline a request. Delete a request. ListRequestsForCollection will list all Requests for a collection. ListRequestsForUser will list all requests for a user. ListRequestsToMe will list all requests to the currently logged in user. Resend a request.

RequestContext Object
    @interface RequestContext : NSObject
    
    @property (nonatomic, strong) NSNumber *userId; // int
    @property (nonatomic, strong) NSString *domain;
    @property (nonatomic, assign) NSNumber *collectionId; // int
    
    @property (nonatomic, strong) NSString *collectionGuid;
    @property (nonatomic, strong) NSString *collectionRequestGuid;
    @property (nonatomic, strong) NSNumber *user_CollectionType; // User_CollectionType
    @property (nonatomic, strong) NSNumber *user_UserFollowing; // bool
    @property (nonatomic, assign) NSString *Message;

    @end
    
RequestService - void acceptWithRequestGuid:(NSString*)requestGuid;
Used by a Request recipient to accept a request.

RequestService - void confirmWithRequestGuid:(NSString*)requestGuid;
Used by a Request recipient to confirm a request.

RequestService - RequestMessage *CreateWithContext:(RequestContext*)requestContext;
Create a request. This will email the recipient.

RequestService - RequestMessage *UpdateWithContext:(RequestContext*)requestContext;
Update a request.

RequestService - void declineWithRequestGuid:(NSString*)requestGuid;
Decline a request.

RequestService - void deleteWithRequestGuid:(NSString*)requestGuid;
Delete a request.

RequestService - NSArray *listRequestsForCollectionWithCollectionId:(int)collectionId;
List all the requests that have been sent for a given collection.

RequestService - NSArray *listRequestsForUserWithUserId:(int)userId;
List all the requests that have been sent to follow a given user.

RequestService - NSArray *listRequestsToMeWithRequestTypes:(NSArray*)requestTypes all:(bool)all;
List all of the requests that have been sent to the email address of the currently logged in user.

RequestService - void resendWithRequestGuid:(NSString*)requestGuid;
Resend a request.


top
MiscService
void Activity_Create(string activity, string secondary); List ContentMenu_List(ref DateTime? modifiedSince); List Hashtag_Trending(PagingParameters pagingParameters);

Hashtags
Hashtags are extracted from the Names and Descriptions of Collections and ContentFiles. There are two Hashtag functions.
MiscService - NSArray *hashtag_SearchWithTerm:(NSString*)term
        pagingParameters:(PagingParameters*pagingParameters;
Search for Hashtags.

Search is the search term to use.
PagingParameters the parameters to specify the size, offset and sort order of the returned results (see
PagingParameters)

Response is a list of matching Hashtags.
    @interface Hashtag : NSObject
    
    @property (nonatomic, strong) NSString *Name;
    @property (nonatomic, strong) NSNumber *NumberOfContentFiles; // int
    @property (nonatomic, assign) NSNumber *HashtagId; // int
    
    @property (nonatomic, strong) NSNumber *active; // bool
    @property (nonatomic, strong) NSDate *created;
    
    @end
    
HashtagId is a unique identifier for the hashtag.
Active indicates if the hashtag is still in use.
Created is the date and time the Hashtag record was created.
Name is the name of a category.
NumberOfContentFiles is the number of ContentFiles that this Hashtag exists in.

Categories
Categories are an attribute of ContentFiles. They are stored in the content file record as a comma delimited string. The following is the only Category function.
MiscService - NSArray *category_ListAll;

Response is a list all valid categories.
    @interface Hashtag : NSObject
    
    @property (nonatomic, strong) NSString *name;
    @property (nonatomic, strong) NSString *description;
    @property (nonatomic, assign) NSNumber *categoryType; // CategoryType
    
    @property (nonatomic, assign) NSNumber *categoryId; // int
    
    @property (nonatomic, strong) NSNumber *active; // bool
    @property (nonatomic, strong) NSDate *created;
    @property (nonatomic, strong) NSDate *modified;
    
    @end
    
CategoryId is a unique identifier for the category.
Active indicates if the category is still in use.
Created is the date and time the Category record was created.
Modified is the date and time the Category record was last modified.
SortBy this is a float value that may modify the normal alphabetical display order (not currently used). Name is the name of a category.
Description this is a description of a category (not currently used). CategoryType is the category type (1: Normal, 2:Adult)


top
Search
Searching will return Collection and/or ContentFile results based on a search term and filters (search criteria) that are passed as parameters to the search request. Pagination is supported.

As a general overview on searching, typically several searches are performed. A search is performed on all content files (ContentFileService.Search), this gives you results that show up in the "top row". Additionally a search is performed on the collections and content files (Search_CollectionsAndContentFiles). This is used to retrieve a list of collection that match (or whose content files match) the search criteria.

Then, when one of these collections is viewed, the content files in that collection are retrieved by listing the content files (Collection_ListContentFiles), specifying the search criteria. This will cause *all* content files for that collection to be returned, but the ones that match the search criteria are at the front of the list.

The following are the major Search functions.

ContentFileService.Search will search content files. CollectionService.Search will search collections and their content files.

Other functions that utilize search criteria parameters are:

UserService.ListCollections will list a users collections. UserService.ListUsers will list a users relationships with other users. CollectionService.ListContentFiles will list a collections ContentFiles.

Search Criteria
The following are the parameters that make up the "search criteria" in a request.

Search is a search term that will match the names, descriptions, and categories of an item.
Categories will filter based on a comma delimited list of Categories (e.g. Sports, Golf).
HasPrefix will filter the results by the first letter of the items name (e.g. A, B, C) will limit the list to items whose name starts with the letter A, B, or C).
IncludeAdult filter to include content flagged as adult.


top
Retrieving Media Content
The actual media files (images and movies) are typically retrieved using a simple url. How to build the various urls are the topic of this section.

DeliveryRequestId's and MuxKey's
A MuxKey contains information on the processing status and the playback versions of a movie file that are available. Currently the four playback versions are 3G, WiFi, WebM, and 720p. Each playback version is associated with a "DeliveryRequestId". An example of a MuxKey is:

M2960,13466~3G~3,13467~WiFi~3,13468~WebM~3,13469~720p~4

M2960 is the unique MuxKey identifier.
13466~3G~3 is the 3G asset with a DeliveryRequestId of 13466 and a successful completion status.
13467~WiFi~3 is the WiFi asset with a DeliveryRequestId of 13467 and a successful completion status.
13468~WebM~3 is the WebM asset with a DeliveryRequestId of 13468 and a successful completion status.
13469~720p~4 is the 720p asset with a DeliveryRequestId of 13469 and a failed completion status.

The DeliveryRequestId is the token used to retrieve thumbnail and movie urls. Note: The 3G asset DeliveryRequestId is used to retrieve thumbnails.

Currently the valid asset types are:
3G used for the iPhone (low bandwidth)
WiFi used for the iPhone (high bandwidth)
WebM used for desktop browsers
720p used on all platforms (very high bandwidth)

The completion status is as follows:
-1: waiting on another process
0: not yet started
1: about to start
2: in progress
3: finished (success)
4: finished (failed)

Finally, a MuxKey can also contain information about the download status of an asset:

M2962,-1~3G~2,-1~WiFi~2,-1~WebM~2,-1~720p~2,-1~(Downloading 12.3M of 16.5M)~2
M2962,13474~3G~2,13475~WiFi~2,13476~WebM~2,13477~720p~4,-1~(Downloading Complete)~3

Notes: 720p will only succeed only if the source movie is high-def. The 3G asset can be used on Safari, the Wifi asset is used on IE, Chrome, and Safari. The WebM asset is pretty much only used on Firefox, however Chrome could use the WebM asset as well if the WiFi asset wasn't generated yet.

Movie Url
A movie url is created by combining a DeliveryRequestId and a subType.

http://delivery.eqnetwork.com/service/store/get/?drid=13474&subType=3g

drid=13474 is a DeliveryRequestId of 13474
subType=3g specifies a 3g movie asset

In most cases the subType is the same (or similar) to the asset type returned with the DeliveryRequestId in the MuxKey:
3G: use 3g for subType
WiFi: use iphonewifi for subType
WebM: use webm for subType
720p: use 720p for subType

Movie Preview Url
A movie preview url is created by combining a DeliveryRequestId and a subType.

http://delivery.eqnetwork.com/service/store/get/?drid=13474&subType=mpx

drid=13474 is the 3G asset DeliveryRequestId
subType=mpx specifies that the returned movie should be a 30 second preview.

Thumbnail Url
A thumbnail is created by combining a DeliveryRequestId and a subType.

http://delivery.eqnetwork.com/icons/mgen/overplayThumbnail.ms?drid=13474&subType=ljpg&w=120&h=90&o=0

drid=13474 is the 3G asset DeliveryRequestId
subType=ljpg specifies that the returned thumbnail be a jpg.
w=120 is the maximum width for the retrieved image.
h=90 is the maximum height for the retrieved image.
o=0 specifies if a "play button" image is overlayed (0: no, 1: yes)

Animated Gif Url
A 20 frame animated gif thumbnail is created by combining a DeliveryRequestId and a subType.

http://delivery.eqnetwork.com/service/store/get/?drid=13474&subType=gif

drid=13474 is the 3G asset DeliveryRequestId
subType=gif specifies that the returned thumbnail be an animated gif.

Note: This will generate a 90 x 90 size thumbnail.

User Icon Url
The user icons filename is available as an attribute called IconFilename on a User node. Also, it is sometimes available in other nodes and called OwnerUserIconFilename.

The url to retrieve a user icon is as follows:

http://delivery.eqnetwork.com/icons/mgen/scaleImage.ms?file=UserIcons/eedda75b-0b35-425c-bf72-9effa931907e.tiff&w=80&h=80

file=UserIcons/eedda75b-0b35-425c-bf72-9effa931907e.tiff is the path to the IconFilename (eedda75b-0b35-425c-bf72-9effa931907e.tiff is the IconFilename in this example).
w=80 is the maximum width for the retrieved image.
h=80 is the maximum height for the retrieved image.

Collection Icon Url
The collection icons filename is available as an attribute called IconFilename on a Collection object.

The url to retrieve a collection icon is as follows:

http://delivery.eqnetwork.com/icons/mgen/scaleImage.ms?file=CollectionIcons/2b6a6503-db21-4a34-a496-1f488de5c5c3.jpg&w=80&h=80

file=CollectionIcons/2b6a6503-db21-4a34-a496-1f488de5c5c3.jpg is the path to the IconFilename (2b6a6503-db21-4a34-a496-1f488de5c5c3.jpg is the IconFilename in this example).
w=80 is the maximum width for the retrieved image.
h=80 is the maximum height for the retrieved image.

    @interface SearchFilters : NSObject
    
    @property (nonatomic, strong) NSString *search;
    @property (nonatomic, strong) NSArray *categories; // string
    @property (nonatomic, assign) NSString *hasPrefix; // int

    @end
    
    @interface PagingParameters : NSObject
    
    @property (nonatomic, strong) NSString *orderBy;
    @property (nonatomic, strong) NSNumber *page; // int
    @property (nonatomic, assign) NSNumber *pageSize; // int
    
    // returned by API functions
    @property (nonatomic, assign) NSNumber *hasMore; // bool

    - (id)init;
    - (id)initWithPageSize:(int)pageSize orderBy:(NSString*)orderBy;
    
    - (void)nextPage;
    
    @end
     
    typedef enum PostType
    {
        Unknown,
        ContentFileComment,
        WallComment,
        PostComment,
    }
    
    typedef enum MembershipType
    {
        Unknown,
        BasicQuota,
    }
    
    typedef enum InvitationType
    {
        Unknown,
        FollowCollection,
        FollowUser,
    }
    
    typedef enum RequestType
    {
        Unknown,
        FollowCollection,
        FollowUser,
    }
    
    typedef enum SocialService
    {
        Unknown,
        Facebook,
        Twitter,
    }
    
    typedef enum SocialSearchType
    {
        SearchAll = 0,
        SearchEqMembers = 1 << 0,
        SearchNonEqMembers = 1 << 1
    }
    
    typedef enum CollectionType
    {
        Unknown,
        User,
        Private,
    }
    
    typedef enum User_CollectionType
    {
        Unknown,
        Owner,
        Follower,
        Contributor,
        ViewInfoOnly,
    }
    
    typedef enum SocialBits
    {
        VideosIWatch = 1,
        VideosIUpload = 2,
        VideosICommentOn = 4,
        VideosIShare = 8,
        ChannelsIFollow = 16,
        ChannelsICreate = 32,
        ChannelsIShare = 64,
        UsersIFollow = 128,
        VideosILike = 256,
        ChannelsILike = 512,
        UsersILike = 1024,
        VideosIFavorite = 2048,
    }