Methods

You can interact with the data in your account using the methods decribed on this page. With these methods you can read, create, update & delete content. Available methods are:

You will interact with the Osmek API via POST information. Every method requires at minimum your account API key (api_key), and the content bin id (bin_id) you wish to interact with. Each method may require additional parameters.

Feed

The feed method returns the content from a content bin in a specified response format.

Required Parameters

  • api_key - an api key in your account.
  • bin_id - the content bin id you want to access.

Additional paramaters can be found under Queries.

Feed - JSONP

Allows you to call the feed method via Javascript, without cross-domain policy restrictions.

Required Parameters

  • api_key - an api key in your account.
  • bin_id - the content bin id you want to access.

Optional Parametes

  • callback - The name of the callback function (defaults to "callback")

Additional paramaters can be found under Queries.

Feed/section_info

The feed/section_info method returns information about a content bin as a JSON object.

Required Parameters

  • api_key - an api key in your account.
  • bin_id - the content bin id.

Feed/account_info

The feed/account_info method returns information about that account, including a list of content bins, as a JSON object.

Required Parameters

  • api_key - an api key in your account.

Feed/comments

The feed/comments method works just like the feed method, but returns comments for an item.

Required Parameters

  • api_key - an api key in your account.
  • bin_id - the content bin id containing the item you want to update.

Optional Parameters

  • item_id - the ID of the item you want to get comments for.

Create

The create method allows you to create new items in a content bin. Simply post a list of field/value pairs for the fields you want to add, along with your api_key, and bin_id.

Required Parameters

  • api_key - an api key in your account.
  • bin_id - the content bin id containing the item you want to update.

Update

The update method allows you to update existing content. Simply post a list of field/value pairs for the fields you want to update, along with your api_key, bin_id, and the item_id of the item you want to update.

Required Parameters

  • api_key - an api key in your account.
  • bin_id - the content bin id containing the item you want to update.
  • item_id - the ID of the item you want to update.

Additional update actions

  • addtags - adds tags to an item. Can be a comma seperated list of tags.
  • removetags - removes tags from an item. Can be a comma seperated list of tags.

Delete

The delete method will delete a single item from a content bin.

Required Parameters

  • api_key - an api key in your account.
  • bin_id - the content bin id containing the item you want to delete.
  • item_id - the ID of the item you want to delete.

New_contact

This method adds a new contact to a Contacts type content bin.

Required parameters

  • api_key - an api key in your account.
  • bin_id - the content bin id.
  • email - the email address to add.

Optional Parameters

  • first_name
  • last_name
  • full_name
  • address
  • city
  • state
  • zip
  • tags - a comma seperated list of tags

Make_comment

This method allows you to add a comment to an item.

Required parameters

  • api_key - an api key in your account.
  • bin_id - the content bin id.
  • item_id - the id of the item the comment should be added to.
  • email - the email address of the commentor.
  • comment - the comment text.

Optional Parameters

  • author - the authors name.
  • url - a website url for the author.

Osmek will automatically check your comment against the Akismet spam checker if you include the following parameters with your request. These values will also be stored along with the comment and used to report to Akismet if you mark a comment as spam or not spam later on.

  • user_ip - the IP address of person making the comment.
  • user_agent - the user agent of person making the comment.
  • user_referer - the address of the page which referred the user agent to the script making the comment.

Subscribe

This method will add an email address as a subscriber to a content.

Required parameters

  • api_key - an api key in your account.
  • bin_id - the content bin id.
  • email - the email address of the subscriber.

Check_login

This method validate an Osmek user's credentials.

Required parameters

  • api_key - an api key in your account.
  • username - the user's email address.
  • password - the user's password + the account id, as an md5 hash.

Optional parameters

  • return_token - return a session token.

If return_token is set to true, Osmek will start a session for the user, and return a token for the session. You can then use that token to keep a user logged in between your application, and Osmek.

Once you have a session token for a user, you can forward that user to Osmek at:

http://cms.osmek.com/login/token/[token_hash]

Where [token_hash] is an md5 hash of the user's account_id + user_email + token.

A php example can be found in our osmek.php documentation.

Upload_photo

Upload a photo to your Osmek account.

Required parameters

  • api_key - an api key in your account.
  • file_name - the name of the image file.
  • Filedata - the path to the file.

Optional parameters

  • bin_id - a content bin ID to upload to.