This is an old revision of the document!


Lab 11 Web Services

1) Chat

Using the what you learned in course 11 continue the chat app you started in laboratory 10. For this you have an api at http://api.my-sandbox.co/chat/chat.php When you call get on it you will receive all the messages When you send via post the variables username and msg to it, it will add a message to the chat. For visibility show only last 5-10 messages. Each message is separated by “\n”

2) Newsfeed

Continue the newsfeed you started in laboratory 10. Implement support for reading the whole article bu showing it on a new page and support for liking articles and display the number of likes.

For this you will have an api at:

http://api.my-sandbox.co/chat/get.php used to fetch latesd news and http://api.my-sandbox.co/chat/get.php?id=PRIMARY_KEY_OF_ARTICLE to fetch the full article

and for likes

GET http://api.my-sandbox.co/chat/like.php with with id set in order to get the number of likes for an article

GET http://api.my-sandbox.co/chat/like.php with with id and uuid set in order to get if you liked or not an article

POST http://api.my-sandbox.co/chat/like.php with a JSON

{
  method:"like",
  uuid:"phone-uuid",
  pk:"article-pk"
}

in order to like an article

POST http://api.my-sandbox.co/chat/like.php with a JSON

{
  method:"unlike",
  uuid:"phone-uuid",
  pk:"article-pk"
}

in order to dislike an article.

To get the uuid of the phone just access device.uuid The device plugin must be installed (it should be installed in your apps by default but you will have to move the config.xml from the root folder in the www folder)

3) Comunicate with webservers from your boards

Depending on what you made your boards try to make the phone communicate with the webserver from the boards.

iot/labs/11.1435706701.txt.gz · Last modified: 2015/07/01 02:25 by avner.solomon
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0