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-type
of this resource will always beimage/jpg
- By passing in the
content-type
ofapplication/help
in theaccept
header or using the {format} parameterhelp
the API will return an html representation of the help documents for this resource (authentication not required) - This resource supports a
size
query string parameter. The value of this parameter can beS
for small(36x48),M
for medium(90x120), andL
for large(315x420) - This resource can optionally be accessed using an image
id
parameter with can also use thesize
query string parameter. - If no
size
query 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-Type
always 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
create
is 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
create
will 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
update
is 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
update
will 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