People
An Image is a resource that belongs to a person and can be represented as small, medium, or large. This resource only contains a show method.
Authentication
This method requires Authentication
Methods
Images ::
- show [GET] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Images
- show [GET] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Images/{id}
- create [POST] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Images
- update [PUT] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Images
Method: show [GET]
The show method will return an image of a person based on context (people/{id}) or id (people/{personID}/images/{id}).
Notes ::
- The
content-typeof this resource will always beimage/jpg - By passing in the
content-typeofapplication/helpin theacceptheader or using the {format} parameterhelpthe API will return an html representation of the help documents for this resource (authentication not required) - This resource supports a
sizequery string parameter. The value of this parameter can beSfor small(36x48),Mfor medium(90x120), andLfor large(315x420) - This resource can optionally be accessed using an image
idparameter with can also use thesizequery string parameter. - If no
sizequery string parameter is specified then the size will default toM, medium(90x120) - If no image is found for the person, the image will default to an unspecified avatar (see below)
- The
Content-Typealways defaults toimage/jpeg
Content-types ::
- application/help
- image/jpeg
Format ::
- help
Parameters ::
- {personID}
- [GET] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Image
- [GET] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Image
- [Header] Accept : application/help
- {id}
- [GET] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Image/{id}
- [GET] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Image/{id}
- {size}
- [GET] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Image?Size={size}
- ex. https://churchcode.fellowshiponeapi.com/v1/People/1522375/Images?size=M
- [GET] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Image?Size={size}
Sample Response ::
Given: [GET] https://churchcode.fellowshiponeapi.com/v1/People/1522375/Images?size=M
Response:
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: image/jpeg
Server: Microsoft-IIS/7.0
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Tue, 28 Apr 2009 02:10:10 GMT
Content-Length: 2335
Method: create [POST]
The create method will create a single image with or without context (people).
Notes ::
- If
createis called within the context of aperson(ex. [POST] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Images) the person id will be set from the URI - If an image already exists calling
createwill result in a [409] (https://churchcode.fellowshiponeapi.com/v1/Util/HttpStatusCodes.help#409) with a message of : An image already exists for this resource. Try using [PUT] People/{id}/Images - This method will return a 201 - Created if successfully created
- Posted image can be on larger than 1mb in file size; exceeding the size limit will result in a 400 bad request
Content-types ::
- application/help
- image/jpeg
Format ::
- image/jpeg
Parameters ::
- {personID}
- [POST] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Image
- [POST] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Image
- [Header] Accept : application/help
Required Fields ::
- person id
- content body
Sample Response ::
Given: [POST] https://churchcode.fellowshiponeapi.com/v1/People/1635398/Image
Request body: File stream posted
Response
HTTP/1.1 201 Created
Cache-Control: private
Content-Type: image/jpeg
Location: https://churchcode.fellowshiponeapi.com/v1/people/1635398/images
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 2.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 05 May 2011 04:15:51 GMT
Content-Length: 2704
Response body: File stream created
Method: update [PUT] [POST (Low REST)]
The update method will update an image with or without context (people).
Notes ::
- If
updateis called within the context of aperson(ex. [PUT] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Images) the person id will be set from the URI - If an image does not exist calling
updatewill result in a [400] (https://churchcode.fellowshiponeapi.com/v1/Util/HttpStatusCodes.help#400) with a message of : An image already exists for this resource. Try using [PUT] People/{id}/Images
Content-types ::
- application/help
- image/jpeg
Parameters ::
- {personID}
- [PUT] https://churchcode.fellowshiponeapi.com/v1/People/{personID}/Image
- [Header] Accept : application/help
Required Fields ::
- personID
- content body
Sample Response ::
Given: [PUT] https://churchcode.fellowshiponeapi.com/v1/People/13707831/Images
Request body: File stream posted
Response
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: image/jpeg
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 2.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 05 May 2011 04:29:41 GMT
Content-Length: 2704