com.textamerica
Class TextAmerica4J

java.lang.Object
  extended bycom.textamerica.TextAmerica4J

public class TextAmerica4J
extends java.lang.Object

Java API for interacting with TextAmerica moblog service. You may find more information on the TextAmerica API at http://www.textamerica.com/api.aspx.

Usage:

Version:
1.0
Author:
David Czarnecki
See Also:
http://www.textamerica.com/api.aspx

Constructor Summary
TextAmerica4J(java.lang.String apiKey, java.lang.String login, java.lang.String password)
          Create an instance to interact with TextAmerica moblog service
 
Method Summary
 java.lang.String addKeywords(java.lang.Integer entryID, java.lang.String keywords)
          Adds keywords to a specified entry / image

Additional Parameters

EntryID (Number) - ID associated with the image that keywords are being added to
Keywords (String) - Keywords separated by commas

 java.lang.String bookmarksAssign(java.lang.Integer moblogID, java.lang.Integer listID)
          Assigns a bookmark list to a specified moblog.
 java.lang.String bookmarksDelete(java.lang.Integer listID)
          Deletes a bookmark list and all URLs on that list

Additional Parameters

ListID (Number) - ID associated with the bookmark list you are deleting

 java.lang.String bookmarksRemoveURL(java.lang.Integer listID, java.lang.String url)
          Removes a URL from a specified bookmark list.
 java.lang.String bookmarksUnAssign(java.lang.Integer moblogID, java.lang.Integer listID)
          Removes a bookmark list from a specified moblog

Additional Parameters

MoblogID (Number) - ID associated with your moblog that will display the list
ListID (Number) - ID associated with the bookmark list

 java.lang.String bookmarksUpdate(java.lang.Integer listID, java.lang.String title)
          Updates or creates a new bookmark list.
 java.lang.String bookmarksUpdateURL(java.lang.Integer listID, java.lang.String url)
          Updates or creates a new URL on a specified list.
 java.lang.String changeDomain(java.lang.Integer moblogID, java.lang.String domain)
          Changes an existing moblog domain.
 java.lang.String changeSecretWord(java.lang.Integer moblogID, java.lang.String secretWord)
          Changes the secret word of a moblog.
 java.lang.String changeText(java.lang.Integer moblogID, java.lang.String text)
          Updates the description of a moblog.
 java.lang.String changeTitle(java.lang.Integer moblogID, java.lang.String title)
          Updates the title of a moblog.
 java.lang.String entryDelete(java.lang.Integer moblogID, java.lang.Integer entryID)
          Deletes a specified entry from a moblog.
 java.lang.String entryUpdate(java.lang.Integer moblogID, java.lang.Integer entryID, java.lang.String title, java.lang.String text, java.lang.Integer categoryID, java.io.File imageData, java.lang.String fileType)
          Updates or creates a new image entry.
 java.lang.Object favoritesAddMoblog(java.lang.Integer listID, java.lang.String moblogURL)
          Add a moblog to a Favorites List.
 java.lang.Object favoritesAssign(java.lang.Integer moblogID, java.lang.Integer listID)
          Assigns a Favorites List to be displayed on a moblog.
 java.lang.Object favoritesDelete(java.lang.Integer listID, java.lang.String moblogURL)
          Remove a moblog to a Favorites List.
 java.lang.Object favoritesRemoveMoblog(java.lang.Integer listID, java.lang.String moblogURL)
          Remove a moblog to a Favorites List.
 java.lang.Object favoritesUpdate(java.lang.Integer listID, java.lang.String title)
          TBD

Additional Parameters

ListID (Number) - ID associated with this list.

 java.util.Vector getCommunityMoblogs(java.lang.String which)
          Returns a Vector of Hashtables where each hashtable contains the following keys, "title", "MoblogID", "url", and "postTo"

Additional Parameters

Which (Variable) - If variable is left blank, the method returns most recent 30 moblogs.

 java.util.Vector getMyMoblogs()
          Returns a Vector of Hashtables where each hashtable contains the following keys, "title", "MoblogID", and "url"
protected  java.util.Vector prepareDefaultRequestParameters()
          Prepare a vector with the default request parameters, apikey, userID, and password
 java.lang.String setTemplate(java.lang.Integer moblogID, java.lang.Integer graphicID, java.lang.Integer layoutID)
          Sets a template for a specified moblog from the textamerica template library

Additional Parameters

MoblogID (Number) - ID associated with the image that keywords are being added to
GraphicID (Number) - ID associated with the graphic set to use
LayoutID (Number) - ID associated with the layout to use

 java.lang.String templateUpdateSection(java.lang.Integer moblogID, java.lang.String sectionID, java.lang.String htmlCode)
          Updates the section HTML for a specified moblog

Additional Parameters

MoblogID (Number) - ID associated with your moblog that will update
SectionID (String) - Allowed values : "header", "footer", "frontpage", "details", "entry", "comment", "result"
HTMLCode (String) - HTML code that will display

 java.lang.String update(java.lang.Integer moblogID, java.lang.String domain, java.lang.String secretWord, java.lang.String title, java.lang.String description, java.lang.String approvalType, java.lang.String allowComments)
          Changes the specific properties of your moblog such as title, text, domain, secret word.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextAmerica4J

public TextAmerica4J(java.lang.String apiKey,
                     java.lang.String login,
                     java.lang.String password)
              throws java.lang.Exception
Create an instance to interact with TextAmerica moblog service

Parameters:
apiKey - API key
login - Login ID
password - Password
Throws:
java.lang.Exception - If there is an exception creating an XML-RPC client
Method Detail

prepareDefaultRequestParameters

protected java.util.Vector prepareDefaultRequestParameters()
Prepare a vector with the default request parameters, apikey, userID, and password

Returns:
Cector with the default request parameters, apikey, userID, and password (added in that order)

getMyMoblogs

public java.util.Vector getMyMoblogs()
                              throws java.lang.Exception
Returns a Vector of Hashtables where each hashtable contains the following keys, "title", "MoblogID", and "url"

Returns:
Vector of Hashtables where each hashtable contains the following keys, "title", "MoblogID", and "url"
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Moblog.GetMyMoblogs

getCommunityMoblogs

public java.util.Vector getCommunityMoblogs(java.lang.String which)
                                     throws java.lang.Exception
Returns a Vector of Hashtables where each hashtable contains the following keys, "title", "MoblogID", "url", and "postTo"

Additional Parameters

Which (Variable) - If variable is left blank, the method returns most recent 30 moblogs. If variable is numeric, the method returns the most recent number Variable. If variable is a date value, the method returns all moblogs created on or after Variable. If variable = "all", the method returns all community moblogs (large return).

Parameters:
which - If variable is left blank, the method returns most recent 30 moblogs. If variable is numeric, the method returns the most recent number Variable. If variable is a date value, the method returns all moblogs created on or after Variable. If variable = "all", the method returns all community moblogs (large return).
Returns:
Vector of Hashtables where each hashtable contains the following keys, "title", "MoblogID", "url", and "postTo"
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Moblog.GetCommunityMoblogs

update

public java.lang.String update(java.lang.Integer moblogID,
                               java.lang.String domain,
                               java.lang.String secretWord,
                               java.lang.String title,
                               java.lang.String description,
                               java.lang.String approvalType,
                               java.lang.String allowComments)
                        throws java.lang.Exception
Changes the specific properties of your moblog such as title, text, domain, secret word. Returns a MoblogID.

Additional Parameters

MoblogID (Number) - ID associated with your moblog
Domain (Alphanumeric) - Domain name of your moblog
Secretword (Alphanumeric) - Secretword that makes up your "secret email address"
Title (String) - Title of your moblog
Text (String) - Description that appears on your moblog
ApprovalType (Character) - [C]ommunity where images must be approved by you - [P]rivate (default) where images post immediately
AllowComments (Character) - [Y]es (default) or [N]o

Parameters:
moblogID - ID associated with your moblog
domain - Domain name of your moblog
secretWord - Secretword that makes up your "secret email address"
title - Title of your moblog
description - Description that appears on your moblog
approvalType - [C]ommunity where images must be approved by you - [P]rivate (default) where images post immediately
allowComments - [Y]es (default) or [N]o
Returns:
Moblog ID
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Moblog.Update

changeTitle

public java.lang.String changeTitle(java.lang.Integer moblogID,
                                    java.lang.String title)
                             throws java.lang.Exception
Updates the title of a moblog. Returns the MoblogID.

Additional Parameters

MoblogID (Number) - ID associated with your moblog
Title (String) - New title that appears on your moblog

Parameters:
moblogID - ID associated with your moblog
title - New title that appears on your moblog
Returns:
Moblog ID
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Moblog.ChangeTitle

changeText

public java.lang.String changeText(java.lang.Integer moblogID,
                                   java.lang.String text)
                            throws java.lang.Exception
Updates the description of a moblog. Returns the MoblogID.

Additional Parameters

MoblogID (Number) - ID associated with your moblog
Text (String) - ID associated with your moblog

Parameters:
moblogID - ID associated with your moblog
text - ID associated with your moblog
Returns:
Moblog ID
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Moblog.ChangeText

changeDomain

public java.lang.String changeDomain(java.lang.Integer moblogID,
                                     java.lang.String domain)
                              throws java.lang.Exception
Changes an existing moblog domain. Returns the MoblogID.

Additional Parameters

MoblogID (Number) - ID associated with your moblog
NewDomain (Alphanumeric) - New domain name of your moblog

Parameters:
moblogID - ID associated with your moblog
domain - New domain name of your moblog
Returns:
Moblog ID
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Moblog.ChangeDomain

changeSecretWord

public java.lang.String changeSecretWord(java.lang.Integer moblogID,
                                         java.lang.String secretWord)
                                  throws java.lang.Exception
Changes the secret word of a moblog. Returns the MoblogID.

Additional Parameters

MoblogID (Number) - ID associated with your moblog
NewSecretWord (Alphanumeric) - New secret word of your moblog

Parameters:
moblogID - ID associated with your moblog
secretWord - New secret word of your moblog
Returns:
Moblog ID
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Moblog.ChangeSecretWord

entryUpdate

public java.lang.String entryUpdate(java.lang.Integer moblogID,
                                    java.lang.Integer entryID,
                                    java.lang.String title,
                                    java.lang.String text,
                                    java.lang.Integer categoryID,
                                    java.io.File imageData,
                                    java.lang.String fileType)
                             throws java.lang.Exception
Updates or creates a new image entry. Returns the EntryID.

Additional Parameters

MoblogID (Number) - ID associated with your moblog
EntryID (Number) - ID associated with the entry you are updating. Use 0 to create a new entry.
Title (String) - Title associated with the entry
Text (String) - Description associated with this entry
CategoryID (Number) - Category id to associate with this entry (Default is 0).
ImageData (Base64EncodedString) - Image or movie file data encoded in base 64 format
FileType (Alphanumeric) - Allowed values are: "JPG", "JPEG", "MP4", "3GP", "3G2", "MOV"

Parameters:
moblogID - ID associated with your moblog
entryID - ID associated with the entry you are updating. Use 0 to create a new entry.
title - Title associated with the entry
text - Description associated with this entry
categoryID - Category id to associate with this entry (Default is 0).
imageData - Image or movie file data encoded in base 64 format
fileType - Allowed values are: "JPG", "JPEG", "MP4", "3GP", "3G2", "MOV"
Returns:
Entry ID
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Entry.Update

entryDelete

public java.lang.String entryDelete(java.lang.Integer moblogID,
                                    java.lang.Integer entryID)
                             throws java.lang.Exception
Deletes a specified entry from a moblog. Returns "OK".

Additional Parameters

MoblogID (Number) - ID associated with your moblog
EntryID (Number) - ID associated with the entry you are deleting

Parameters:
moblogID - ID associated with your moblog
entryID - ID associated with the entry you are deleting
Returns:
"OK"
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Entry.Delete

addKeywords

public java.lang.String addKeywords(java.lang.Integer entryID,
                                    java.lang.String keywords)
                             throws java.lang.Exception
Adds keywords to a specified entry / image

Additional Parameters

EntryID (Number) - ID associated with the image that keywords are being added to
Keywords (String) - Keywords separated by commas

Parameters:
entryID - ID associated with the image that keywords are being added to
keywords - Keywords separated by commas
Returns:
"OK"
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Keywords.Add

favoritesUpdate

public java.lang.Object favoritesUpdate(java.lang.Integer listID,
                                        java.lang.String title)
                                 throws java.lang.Exception
TBD

Additional Parameters

ListID (Number) - ID associated with this list. Use 0 to create a new list.
ListTitle (Number) - Title associated with the list you are updating/creating.

Parameters:
listID - ID associated with this list. Use 0 to create a new list.
title - Title associated with the list you are updating/creating.
Returns:
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Favorites.Update

favoritesDelete

public java.lang.Object favoritesDelete(java.lang.Integer listID,
                                        java.lang.String moblogURL)
                                 throws java.lang.Exception
Remove a moblog to a Favorites List.

Additional Parameters

ListID (Number) - ID associated with this list. Use 0 to assign "My Favorites".
MoblogURL (String) - URL of the moblog that you are removing from this Favorites List

Parameters:
listID - ID associated with this list. Use 0 to assign "My Favorites".
moblogURL - URL of the moblog that you are removing from this Favorites List
Returns:
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Favorites.Delete

favoritesAssign

public java.lang.Object favoritesAssign(java.lang.Integer moblogID,
                                        java.lang.Integer listID)
                                 throws java.lang.Exception
Assigns a Favorites List to be displayed on a moblog.

Additional Parameters

MoblogID (Number) - ID of the moblog that will display this list
ListID (Number) - ID associated with this list. Use 0 to assign "My Favorites".

Parameters:
moblogID - ID of the moblog that will display this list
listID - ID associated with this list. Use 0 to assign "My Favorites".
Returns:
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Favorites.Assign

favoritesAddMoblog

public java.lang.Object favoritesAddMoblog(java.lang.Integer listID,
                                           java.lang.String moblogURL)
                                    throws java.lang.Exception
Add a moblog to a Favorites List.

Additional Parameters

ListID (Number) - ID associated with this list. Use 0 to assign "My Favorites".
MoblogURL (String) - URL of the moblog that you will add to this Favorites List

Parameters:
listID - ID associated with this list. Use 0 to assign "My Favorites".
moblogURL - URL of the moblog that you will add to this Favorites List
Returns:
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Favorites.AddMoblog

favoritesRemoveMoblog

public java.lang.Object favoritesRemoveMoblog(java.lang.Integer listID,
                                              java.lang.String moblogURL)
                                       throws java.lang.Exception
Remove a moblog to a Favorites List.

Additional Parameters

ListID (Number) - ID associated with this list. Use 0 to assign "My Favorites".
MoblogURL (String) - URL of the moblog that you are removing from this Favorites List

Parameters:
listID - ID associated with this list. Use 0 to assign "My Favorites".
moblogURL - URL of the moblog that you are removing from this Favorites List
Returns:
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Favorites.RemoveMoblog

bookmarksUpdate

public java.lang.String bookmarksUpdate(java.lang.Integer listID,
                                        java.lang.String title)
                                 throws java.lang.Exception
Updates or creates a new bookmark list. Returns the bookmark list id.

Additional Parameters

ListID (Number) - ID associated with the list you are updating. Use 0 to create a new list.
Title (String) - Title of the bookmark list

Parameters:
listID - ID associated with the list you are updating. Use 0 to create a new list.
title - Title of the bookmark list
Returns:
Returns the bookmark list id.
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Bookmarks.Update

bookmarksAssign

public java.lang.String bookmarksAssign(java.lang.Integer moblogID,
                                        java.lang.Integer listID)
                                 throws java.lang.Exception
Assigns a bookmark list to a specified moblog.

Additional Parameters

MoblogID (Number) - ID associated with your moblog that will display the list
ListID (Number) - ID associated with the bookmark list

Parameters:
moblogID - ID associated with your moblog that will display the list
listID - ID associated with the bookmark list
Returns:
"OK"
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Bookmarks.Assign

bookmarksUnAssign

public java.lang.String bookmarksUnAssign(java.lang.Integer moblogID,
                                          java.lang.Integer listID)
                                   throws java.lang.Exception
Removes a bookmark list from a specified moblog

Additional Parameters

MoblogID (Number) - ID associated with your moblog that will display the list
ListID (Number) - ID associated with the bookmark list

Parameters:
moblogID - ID associated with your moblog that will display the list
listID - ID associated with the bookmark list
Returns:
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Bookmarks.UnAssign

bookmarksDelete

public java.lang.String bookmarksDelete(java.lang.Integer listID)
                                 throws java.lang.Exception
Deletes a bookmark list and all URLs on that list

Additional Parameters

ListID (Number) - ID associated with the bookmark list you are deleting

Parameters:
listID - ID associated with the bookmark list you are deleting
Returns:
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Bookmarks.Delete

bookmarksUpdateURL

public java.lang.String bookmarksUpdateURL(java.lang.Integer listID,
                                           java.lang.String url)
                                    throws java.lang.Exception
Updates or creates a new URL on a specified list.

Additional Parameters

ListID (Number) - ID associated with your moblog
URL (String) - Full URL to add to the list

Parameters:
listID - ID associated with your moblog
url - Full URL to add to the list
Returns:
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Bookmarks.UpdateURL

bookmarksRemoveURL

public java.lang.String bookmarksRemoveURL(java.lang.Integer listID,
                                           java.lang.String url)
                                    throws java.lang.Exception
Removes a URL from a specified bookmark list.

Additional Parameters

ListID (Number) - ID associated with the bookmark list
URL (String) - URL that will be removed

Parameters:
listID - ID associated with the bookmark list
url - URL that will be removed
Returns:
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Bookmarks.RemoveURL

templateUpdateSection

public java.lang.String templateUpdateSection(java.lang.Integer moblogID,
                                              java.lang.String sectionID,
                                              java.lang.String htmlCode)
                                       throws java.lang.Exception
Updates the section HTML for a specified moblog

Additional Parameters

MoblogID (Number) - ID associated with your moblog that will update
SectionID (String) - Allowed values : "header", "footer", "frontpage", "details", "entry", "comment", "result"
HTMLCode (String) - HTML code that will display

Parameters:
moblogID - ID associated with your moblog that will update
sectionID - Allowed values : "header", "footer", "frontpage", "details", "entry", "comment", "result"
htmlCode - HTML code that will display
Returns:
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Template.UpdateSection

setTemplate

public java.lang.String setTemplate(java.lang.Integer moblogID,
                                    java.lang.Integer graphicID,
                                    java.lang.Integer layoutID)
                             throws java.lang.Exception
Sets a template for a specified moblog from the textamerica template library

Additional Parameters

MoblogID (Number) - ID associated with the image that keywords are being added to
GraphicID (Number) - ID associated with the graphic set to use
LayoutID (Number) - ID associated with the layout to use

Parameters:
moblogID - ID associated with the image that keywords are being added to
graphicID - ID associated with the graphic set to use
layoutID - ID associated with the layout to use
Returns:
Throws:
java.lang.Exception - If there is an error
See Also:
http://www.textamerica.com/apicalls.aspx?call=Template.SetTemplate