Skip to content

A simple REST API in SLIM Framework and android app to demonstrate multiplatform RESTful Services

License

Notifications You must be signed in to change notification settings

ikrum/REST-in-SlimFramework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

REST-in-SlimFramework

This a very api to understand REST operations as well as how to implement a multiplatform application via api. A simple android applicatoin is used to demonstate the simplicity of REST.

App Screenshot

ScreenShot

Installing API

Just upload the api folder on any web server or localhost. If you want to configure API with app then you must place the api on web server. You must have MongoDB installed on your server or pc.

Compiling app

The app need to be compiled on Android Studio. Before compiling please change the RootUrl from ApiConnection.java

##API USAGE Here is list of Resouces and action used at the api.

Resource HTTP Method Operation
/api/v1/contacts GET Returns an array of contacts
/api/v1/contacts POST Adds a new contact
/api/v1/contacts?type=star GET Returns an array of favourite contacts
/api/v1/contacts/:id GET Returns the contact with id of :id
/api/v1/contacts/:id PUT Update the contact with id of :id
/api/v1/contacts/:id DELETE Deletes the contact with id of :id
/api/v1/contacts/:id/star PUT Adds to favourites the contact with id of :id
/api/v1/contacts/:id/star DELETE Removes from favourites the contact with id of :id

API Usage

you can also check the operation from Terminal or using POSTMAN

Request

GET /api/v1/contacts
curl -i -H 'Accept: application/json' http://localhost/api/v1/contacts

Response

HTTP/1.1 200 OK
Date: Thu, 24 Feb 2011 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 99
{"status":200,"contacts":[{"contact_id":10,"name":"myname","number":"012345","is_favourite":true}]}

About

A simple REST API in SLIM Framework and android app to demonstrate multiplatform RESTful Services

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published