Skip to content

websdotcom/webs-api-client-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webs.com REST API Client

A simple API client which can interact with the Webs.com REST-based API. Initializing a WebsApi object is as simple as:

> require 'webs_api'
> webs_api = Webs::WebsApi.new

or alternatively, if you have an OAuth token you’d like to use:

> webs_api = Webs::WebsApi.new(oauth_token)

Installation

To install, just install the Gem:

$ gem install webs_api

API Calls

Apps

Get all available apps

webs_api.get_apps

Get a single app

webs_api.get_app('calendar')

or

webs_api.get_app(5)

Installing and uninstalling an app

webs_api.install_app('patrick', :handle => 'webstore')
webs_api.uninstall_app('patrick', 'webstore')

Templates

To get all available templates

webs_api.get_templates

Get a single template

webs_api.get_template(127)

Get the styles for a template

webs_api.get_template_styles(127)

Get a single template style

webs_api.get_template_style(251)

Sites

Getting basic info for a site

webs_api.get_site('patrick')

or alternatively if you have a site ID, rather than a username:

webs_api.get_site(1127604)

Updating a site’s info

webs_api.update_site('patrick', :title => "My Site Title", :footer => "My Footer", :description => "My Site Description", :sidebars_enabled => true, :social => true, keywords => ['my', 'site', 'keywords'], :template_id => 127, :custom_css_url => "http://somesite.com/somestyle.css")

Members

To get all members of a site:

webs_api.get_site_members('patrick')

And to get a specific member:

webs_api.get_site_member('patrick', '[email protected]')

You can also use an ID of the site member rather than the email

Maintainers

License

Apache License, Version 2.0

Releases

No releases published

Packages

No packages published

Languages