entries/create

Posts a new entry to the logged users stream. Besides the actual content, the user may also specify tags, file attachment, and thread-related fields.

URL

http://api.staction.com/entries/create.format

HTTP Method:

POST

Required Parameters

  • content: textual content that is to be posted as the entry’s body.

Optional Parameters

  • tags: works just like the tags field in the Staction interface. It should accept the following tags, all separated by commas:
    • Todo: makes the entry a Todo.
    • HH:MM: makes the entry a time entry. Examples: 0:15 (for 15 minutes), 1:45 (for one hour and forty-five minutes).
    • project name: attaches the entry to a specific project. There can only be one project per entry. Examples: My Super Project or Secret Project Name.
    • user name: sends the message to a specific user (accepts more than one recipient on the same entry). Find out more how permissions and private messages work in Staction. Examples: Joe, Brian, Maria.
    • random tag: the tag field also accepts random strings. This might be useful for you to allow users to specify their own tags to projects, accordingly to their workflow. Possible examples: Top Priority, Read Later, Resources.
  • threadId: the ID of the thread that the new entry pertains to.
  • inReplyToEntryId: the ID of a pre-existing entry that is being replied to on this new entry. When using this parameter, the new entry gets automatically added to the original thread so there’s no need to declare threadId when using inReplyToEntryId.
  • file: an HTTP upload field containing the path to the local file. You don’t need to explicitly declare the file MIME Type since Staction will figure it out for you.

Examples (using curl)

To post a regular entry:

  • curl -d “developerKey=123&account=paste&email=test@pasteinteractive.com&password=mypassword&content=This is an example of how you can update the Staction stream through the API” http://api.staction.com/entries/create.json

To post an entry with an attached file:

  • curl -F “developerKey=123” -F “account=paste” -F “email=test@pasteinteractive.com” -F “password=a” -F “content=This is an example of how you can attach files to the entry through the API.” -F “file=@/Users/brian/Desktop/Picture.png” http://api.staction.com/entries/create.json

Expected Responses

If the call fails to be executed properly, the API will return an error in the default error format, with a status field set to false, and a reason field explaining why it failed to run (respecting the format requested). If the call runs properly, it will return a status field set to true, indicating your entry was successfully posted.

As an example, here’s a couple of parsed JSON responses, transferred into multidimensional arrays for the sake of clarity.

Array
(
    [status] => true
) 
Array
(
    [status] => false
    [reason] => Nothing to post!
)