contacts-jquerymobile: JAX-RS Services Documentation

Author: Joshua Wilson

This example supports various RESTFul end points which also includes JSONP support for cross domain requests.

By default the base URL for services is /jboss-contacts-jquerymobile/rest.

ContactService End Points

##CREATE

Create a new contact

/rest/contacts

{email: "jane.doe@company.com", id: 14, firstName: "Jane", lastName: 'Doe', phoneNumber: "223-223-1231", birthDate:'1966-01-03'}
{"email":"That email is already used, please use a unique email"}

##READ

List all contacts

/rest/contacts

[{email: "jane.doe@company.com", id: 14, firstName: "Jane", lastName: 'Doe', phoneNumber: "223-223-1231", birthDate:'1966-01-03'},
 {email: "john.doe@company.com", id: 15, firstName: "John", lastName: 'Doe', phoneNumber: "212-555-1212", birthDate:'1978-02-23'}]

Find a contact by it's ID.

/rest/contacts/<id>

{email: "jane.doe@company.com", id: 14, firstName: "Jane", lastName: 'Doe', phoneNumber: "223-223-1231", birthDate:'1966-01-03'}

##UPDATE

Edit one contact

/rest/contacts

{email: "jane.doe@company.com", id: 14, firstName: "Jane", lastName: 'Doe', phoneNumber: "223-223-1231", birthDate:'1966-01-03'}

##DELETE

Delete one contact

/rest/contacts

{email: "jane.doe@company.com", id: 14, firstName: "Jane", lastName: 'Doe', phoneNumber: "223-223-1231", birthDate:'1966-01-03'}