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://demo.fellowshiponeapi.com/v1/People/{personID}/Images
  • show [GET] https://demo.fellowshiponeapi.com/v1/People/{personID}/Images/{id}
  • create [POST] https://demo.fellowshiponeapi.com/v1/People/{personID}/Images
  • update [PUT] https://demo.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 be image/jpg
  • By passing in the content-type of application/help in the accept header or using the {format} parameter help 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 be S for small(36x48), M for medium(90x120), and L for large(315x420)
  • This resource can optionally be accessed using an image id parameter with can also use the size query string parameter.
  • If no size query string parameter is specified then the size will default to M, 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 to image/jpeg

Content-types ::

  • application/help
  • image/jpeg

Format ::

  • help

Parameters ::

  • {personID}
    • [GET] https://demo.fellowshiponeapi.com/v1/People/{personID}/Image
    • [GET] https://demo.fellowshiponeapi.com/v1/People/{personID}/Image
    • [Header] Accept : application/help
  • {id}
    • [GET] https://demo.fellowshiponeapi.com/v1/People/{personID}/Image/{id}
    • [GET] https://demo.fellowshiponeapi.com/v1/People/{personID}/Image/{id}
  • {size}
    • [GET] https://demo.fellowshiponeapi.com/v1/People/{personID}/Image?Size={size}
      • ex. https://demo.fellowshiponeapi.com/v1/People/1522375/Images?size=M

Sample Response ::

Given: [GET] https://demo.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

People Image

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 a person (ex. [POST] https://demo.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://demo.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://demo.fellowshiponeapi.com/v1/People/{personID}/Image
    • [POST] https://demo.fellowshiponeapi.com/v1/People/{personID}/Image
    • [Header] Accept : application/help

Required Fields ::

  • person id
  • content body

Sample Response ::

Given: [POST] https://demo.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://demo.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 a person (ex. [PUT] https://demo.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://demo.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://demo.fellowshiponeapi.com/v1/People/{personID}/Image
    • [Header] Accept : application/help

Required Fields ::

  • personID
  • content body

Sample Response ::

Given: [PUT] https://demo.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