|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.simpy.api.rest.client.Simpy
Simpy is a class for accessing the Simpy REST API.
Constructor Summary | |
Simpy(java.lang.String username,
java.lang.String password)
Create an object to interact with Simpy |
Method Summary | |
int |
deleteLink(java.lang.String href)
Deletes the given link and returns a status reponse indicating either success or failure. |
int |
deleteNote(java.lang.String noteId)
Deletes the given Note and returns a status reponse indicating either success or failure. |
java.util.List |
getAllLinks(java.lang.String q,
java.lang.String date,
java.lang.String afterDate,
java.lang.String beforeDate)
Depending on your input parameters, this call returns all links that were added on or between given dates, or links matching a given query. |
java.util.List |
getAllNotes(java.lang.String q)
Returns all your Notes in the reverse chronological order by add date (i.e. |
int |
getHttpResult()
Return the HTTP status code of the last operation |
java.util.List |
getLinks(java.lang.String q,
java.lang.String date,
java.lang.String afterDate,
java.lang.String beforeDate)
Same as getAllLinks()
except that it returns the ten most relevant links (depending on the given
parameters). |
java.util.List |
getLinks(java.lang.String q,
java.lang.String date,
java.lang.String afterDate,
java.lang.String beforeDate,
int limit)
Depending on your input parameters, this methdod returns links added on or between given dates, or links matching a given query. |
java.util.List |
getNotes(java.lang.String q)
Fetches the ten most recently addded Notes from the simpy, or the ten most relevant Notes, according to the specified search String. |
java.util.List |
getNotes(java.lang.String q,
int limit)
Returns all your Notes in the reverse chronological order by add date (i.e. |
java.util.List |
getTags()
Return a list of Tag objects |
Topic |
getTopic(int topicId)
Returns the meta-data for a given Topic. |
java.util.List |
getTopics()
Returns the list of your Topics, their meta-data, including the number of new links added each Topic since your last login. |
Watchlist |
getWatchlist(int watchlistId)
Retrieve a Watchlist for the given watchlist id |
java.util.List |
getWatchlists()
This API call returns the list of your Watchlists, their meta-data, including the number of new links added to each Watchlist since your last login. |
int |
mergeTags(java.lang.String fromTag1,
java.lang.String fromTag2,
java.lang.String toTag)
This API call merges two tags into a new tag. |
int |
removeTag(java.lang.String tag)
This API call removes the given tag. |
int |
renameTag(java.lang.String fromTag,
java.lang.String toTag)
This API call renames the given tag. |
int |
saveLink(java.lang.String title,
java.lang.String href,
int accessType,
java.lang.String tags,
java.lang.String nickname,
java.lang.String note)
Saves the given link and returns a status reponse indicating either success or failure. |
int |
saveNote(java.lang.String title,
java.lang.String tags,
java.lang.String description)
Saves a new Note and returns a status reponse indicating either success or failure. |
int |
splitTag(java.lang.String tag,
java.lang.String toTag1,
java.lang.String toTag2)
This API call splits a single tag into two separate tags. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Simpy(java.lang.String username, java.lang.String password)
username
- Usernamepassword
- PasswordMethod Detail |
public int getHttpResult()
public java.util.List getTags()
Tag
objects
Tag
objectspublic java.util.List getAllLinks(java.lang.String q, java.lang.String date, java.lang.String afterDate, java.lang.String beforeDate)
q
- A query string that forces the API call to return only
the matching links.date
- This parameter should not be used in combination
with the afterDate and beforeDate parameters. It limits the links
returned to links added on the given date.afterDate
- This parameter should be used in combination with the
beforeDate parameter. It limits the links returned to links added after
the given date, excluding the date specified.beforeDate
- This parameter should be used in combination with the
afterDate parameter. It limits the links returned to links added before
the given date, excluding the date specified.
public java.util.List getLinks(java.lang.String q, java.lang.String date, java.lang.String afterDate, java.lang.String beforeDate)
getAllLinks()
except that it returns the ten most relevant links (depending on the given
parameters).
getAllLinks(String, String, String, String)
public int removeTag(java.lang.String tag)
tag
- Specifies the tag to remove.
public int renameTag(java.lang.String fromTag, java.lang.String toTag)
fromTag
- Specifies the tag to rename.toTag
- Specifies the new tag name.
public int mergeTags(java.lang.String fromTag1, java.lang.String fromTag2, java.lang.String toTag)
fromTag1
- Specifies the first tag to merge.fromTag2
- Specifies the second tag to merge.toTag
- Specifies the tag to merge the two tags into.
public int splitTag(java.lang.String tag, java.lang.String toTag1, java.lang.String toTag2)
tag
- Specifies the tag to split.toTag1
- Specifies the first tag to split into.toTag2
- Specifies the second tag to split into.
public java.util.List getLinks(java.lang.String q, java.lang.String date, java.lang.String afterDate, java.lang.String beforeDate, int limit)
limit
- number of links to return
public java.util.List getTopics()
public Topic getTopic(int topicId)
topicId
- The ID of a Topic you want to retrieve. The ID must belong to your Topic.
public java.util.List getAllNotes(java.lang.String q)
q
- a search String that is used in the API
public java.util.List getNotes(java.lang.String q)
null
and not an empty String.getAllNotes()
if you want to fetch all
Notes from the API.
q
- a search String that is used in the API
getAllNotes(String)
public java.util.List getNotes(java.lang.String q, int limit)
q
- A query string that forces the API call to return only the matching Notes.limit
- the number of Notes to return.
public int saveLink(java.lang.String title, java.lang.String href, int accessType, java.lang.String tags, java.lang.String nickname, java.lang.String note)
title
- The title of the page to save.href
- The URL of the page to save. It must start with 'http://'.accessType
- Use 1 to make the link public and 0 to make it private.tags
- Comma-separated list of tags.nickname
- An alternative, custom title.note
- A free-text note to go with the link.
java.lang.IllegalArgumentException
- If either title
or href
is null
as they are required parameterspublic int deleteLink(java.lang.String href)
href
- The URL of the bookmark to delete. It must start with 'http://'.
java.lang.IllegalArgumentException
- If href
is null
as they are required parameterspublic int deleteNote(java.lang.String noteId)
noteId
- The ID of the Note to delete.
java.lang.IllegalArgumentException
- If title
is null
as it is a required parameterpublic int saveNote(java.lang.String title, java.lang.String tags, java.lang.String description)
title
- The title of the Note to save.tags
- Comma-separated list of tags.description
- A free-text note.
java.lang.IllegalArgumentException
- If title
is null
as it is a required parameterpublic java.util.List getWatchlists()
Watchlist
itemspublic Watchlist getWatchlist(int watchlistId)
Watchlist
for the given watchlist id
watchlistId
- Watchlist to retrieve
Watchlist
for the given watchlist id or null
if the watchlist could not be loaded
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |