This page describes how to consume the service:

There are several RESTful calls that can be made to the service, these are

(All paths described are relative to http://computerName:port/BbsbWebService )

GetAllItems(): /allitems

Return Type: ControllableItem collection; WebMethod = “GET”

This retrieves all the controllable items in detail that are being hosted by the service

 

GetItem(Guid id): /item?id={id}

Return Type: ControllableItem; WebMethod = “GET”

Gets a specific item based on it’s global unique identifier

 

GetGroups(GroupType filter): /groups?filter={filter}

Return Type: BaseItem collection; WebMethod = “GET”

This retrieves a basic collection groups queried by a GroupType

 

GetDetailedGroup(GroupType filter): /detailedgroups?filter={filter}

Return Type: Group collection; WebMethod = “GET”

Retrieves the full details of a collection of groups queried by a GroupType

 

GetGroup(Guid id): /group?id={id}

Return Type: Group; WebMethod = “GET”

Gets a specific group based on the id

 

GetTasks(): /tasks

Return Type: RecurringTask, OneOffTask and ScheduledTask; WebMethod = “GET”

Gets all tasks hosted on the server

 

GetTask(Guid id): /task?id={id}

Return Type: RecurringTask, OneOffTask or ScheduledTask; WebMethod = “GET”

Gets a specific task based on its Id

 

PowerOn(Guid id): /poweron?id={id}

Return Type: boolean; WebMethod = “GET”

Sends a request to turn an item on given its id

 

PowerOff(Guid id): /poweroff?id={id}

Return Type: boolean; WebMethod = “GET”

Sends a request to turn an item off given its id

 

SendPower(Guid id, PowerOption option): /power?id={id}&com={option}

Return Type: boolean; WebMethod = “GET”

Sends a request to an item with a PowerOption

 

Toggle(Guid id): /toggle?id={id}

Return Type: PowerState; WebMethod = “GET”

Sends a request to toggle the power of an item

 

Sleep(Guid id, int delay): /sleep?id={id}&delay={delay}

Return Type: void; WebMethod = “GET”

Sends an item to sleep (power off) in a set amount of minutes

 

SaveItem(ControllableItem item)

WebMethod = “INSERT”

Saves an item to the server (either new or existing)

 

SaveGroup(Group group)

WebMethod = “INSERT”

Saves a group to the server (either new or existing)

 

SaveTask(BaseTask item) (BaseTask is one of RecurringTask, OneOffTask or ScheduledTask)

WebMethod = “INSERT”

Saves an item to the server (either new or existing)

Last edited Aug 25, 2010 at 5:35 PM by evorgevol, version 2

Comments

No comments yet.