http://newlifesongs.jdbernard.com/api/v1 as a base
URL.
Some of the service's endpoints require the client to authenticate itself to the server. See the section on authentication for details concerning authentication.
The endpoints that the API defines are:
If you run across any problems or have questions, feel free to send me an email at jdbernard@gmail.com
/songs
{
"id":8,
"name":"Here I Am To Worship",
"artists":[
"Tim Hughes",
"Chris Tomlin",
"Michael W. Smith"
]
}
| HTTP Action | Path | Description | Public? |
|---|---|---|---|
| GET | /songs |
Retrieve all songs. | yes |
| POST | /songs |
Create a new song record. | no |
| GET | /songs/<songId> |
Retrieve a single record. | yes |
| PUT | /songs/<songId> |
Update a song record. | no |
| DELETE | /songs/<songId> |
Delete a song record. | no |
| GET | /songs/forService/<serviceId> |
Retrieve all songs performed in a given service. | yes |
| GET | /songs/byArtist/<artist> |
Retrieve all songs performed by a given artist. | yes |
GET /songsRetrieve all songs.
GET http://newlifesongs.jdbernard.com/api/v1/songs
HTTP/1.1 200 OK
Content-Length: 433
Content-Type: application/json
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
[{"id":1,"name":"Welcome Holy Spirit","artists":["Mark Condon"]},
{"id":3,"name":"Let's Sing Praises to our God","artists":["Traditional"]},
{"id":5,"name":"Blessed Assurance","artists":["Frances J. Crosby"]},
{"id":8,"name":"Here I Am To Worship","artists":["Tim Hughes", "Chris Tomlin", "Michael W. Smith"]},
{"id":12,"name":"Healer","artists":["Kari Jobe", "Hillsong"]},
{"id":15,"name":"I Am Free","artists":["Newsboys"]}]
POST /songsCreate a new song record. In order to be allowed access to this method, the request must be made with a valid authentication token which belongs to a user with administrative priviliges. See Authentication for details.
name field is required. Any id passed
in with the request will be ignored.
POST http://newlifesongs.jdbernard.com/api/v1/songs
Content-Length: 60
Content-Type: application/json
{"id":22,"name":"This is How We Praise Him","artists":[""]}
HTTP/1.1 201 Created Content-Length: Content-Type: application/json
GET /songs/<songId>Retrieve song data for the given song id.
GET http://newlifesongs.jdbernard.com/api/v1/songs/1
HTTP/1.1 200 OK
Content-Length: 63
Content-Type: application/json
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
{"id":1,"name":"Welcome Holy Spirit","artists":["Mark Condon"]}
PUT /songs/<songId>Method description
DELETE /songs/<songId>Method description
GET /songs/forService/<serviceId>Method description
GET /api/v1/songs/forService/1 HTTP/1.1
HTTP/1.1 200 OK
Content-Length: 256
Content-Type: application/json
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
[{"id":7,"name":"Mighty God","artists":[""]},
{"id":8,"name":"Here I Am To Worship","artists":["Tim Hughes: Chris Tomlin, Michael W. Smith"]},
{"id":9,"name":"Worthy","artists":[""]},
{"id":4,"name":"I Am A Friend Of God","artists":["Israel Houghton"]}]j
GET /songs/byArtist/<artist>Method description
/services| Value | Description |
|---|---|
SUN_AM |
Sunday morning service. |
SUN_PM |
Sunday evening service |
WED |
Wednesday, midweek Bible study. |
{
"id": 1,
"date": 1235887200000,
"serviceType": "SUN_PM"
}
| HTTP Action | Path | Description | Public? |
|---|---|---|---|
| GET | /services |
Retrieve all services. | yes |
| POST | /services |
Create a new service record. | no |
| GET | /services/<serviceId> |
Retrieve a single service record. | yes |
| PUT | /services/<serviceId> |
Update a service record. | no |
| DELETE | /services/<serviceId> |
Delete a service record. | no |
| GET | /services/withSong/<serviceId> |
Retrieve all services in which the given song was performed. | yes |
| GET | /services/byDate/after/<date> |
Retrieve all services after the given date. | yes |
| GET | /services/byDate/before/<date> |
Retrieve all services before the given date. | yes |
| GET | /services/byDate/between/<date1>/<date2> |
Retrieve all services between the two given dates. | yes |
/users