This project is read-only.

REST API

RESOURCE: EARTHWATCHERS

========================================================
description: get earthwatcher based on id
url: /earthwatchers/{id}
method: http get
response: earthwatcher with given id
========================================================

========================================================
description: get earthwatcher based on name
url: /earthwatchers?name={name}
method: http get
response: earthwatcher with given id
========================================================

========================================================
description: get all earthwatchers
url: /earthwatchers
method: http get
response: list of earthwatchers
limit: max 100 items
========================================================

========================================================
description: create new earthwatcher and assign land
url: /earthwatchers
method: http post
Content-type:application/json
Request body: Name":"jaem","Role":"0", "Basecamp":"argentina" }
response: earthwatcher
Authentication: basic

Notes:
- Earthwatcher must not exist already! (otherwise error)
========================================================

========================================================
*description: delete earthwatcher and unassign the land*
url: /earthwatchers/{Id}
method: http delete
request body: -
response: http 200 if ok
Authentication: basic

========================================================
*description: update earthwatcher*
url: /earthwatchers/{id}
method: http put
Content-type:application/json
Request body: {"Name":"TestNaam
response: earthwatcher
Authentication: basic

RESOURCE: LAND

========================================================
description: get all land
url: /land
method: http get
response: list of land
limit: max 100 items
========================================================

========================================================
description: get land based on earthwatcher name
url: /land/earthwatcher={earthwatcher name}
method: http get
response: land object
returns not found (http 404) when earthwatcher is not known
returns bad request (http 400) when earthwatcher name is not in request

========================================================

========================================================
description: get land based on id
url: /land/{id}
method: http get
response: land with given id
========================================================

========================================================
description: get land based on status
url: /land?status={status}
method: http get
response: list of land with given status
limit: max 100 items
========================================================

========================================================
description: get land intersecting with wkt
url: /land?intersect={wkt}
method: http get
response: list of land intersecting with wkt
========================================================

========================================================
description: update landstatus
url: /land/{Id}/updatestatus
method: http post
Content-type: application/json
request body sample: "LandStatus":2
Authentication: basic

Notes:
- LandId must exist (otherwise error)
========================================================

========================================================
description: add confirmer deforestation
url: /land/{Id}/confirm
method: http post
Content-type: application/json
request body type: Earthwatcher
request body sample: "Id":2
Authentication: basic

Notes:
- LandId must exist (otherwise error)
========================================================

========================================================
description: add deconfirmer deforestation
url: /land/{Id}/deconfirm
method: http post
Content-type: application/json
request body type: Earthwatcher
request body sample: "Id":2
Authentication: basic

Notes:
- LandId must exist (otherwise error)
========================================================

RESOURCE: SATELLITEIMAGES

========================================================
description: get all satelliteimages
url: /satelliteimages
method: http get
result: list of satelliteimages
========================================================

========================================================
description: get all satelliteimages within given wkt
url: /satelliteimages/intersect={wkt}
method: http get
result: list of satelliteimages
========================================================

========================================================
description: insert satelliteimage
url: /satelliteimages
method: http post
Accept: application/json
Content-Type: application/json
Authentication: basic

sample request body:
{
"Name":"yoyo1",
"Wkt": "POLYGON((0 0, 115 0, 110 20, 0 20, 0 0))",
"Provider": "Landsat",
"ImageType": 1,
"UrlTileCache":"http://www.nu.nl",
"UrlRawData":"http://www.nu1.nl",
"Published":"\/Date(1198908717056)\/",
"TilingStarted":"\/Date(1198908717056)\/",
"TilingFinished":"\/Date(1198908717056)\/"
}


result: -
========================================================

========================================================
description: delete satelliteimage
url: /satelliteimages/{id}
method: http delete
========================================================

========================================================
description: update satelliteimage
url: /satelliteimages/{id}
method: http put
Accept: application/json
Content-Type: application/json
Authentication: basic

Sample request body:
{
"TilingFinished":"\/Date(1198908717056)\/",
"TilingStarted":"\/Date(1198908717056)\/",
}


========================================================



Note: sample wkt string: POLYGON((0 0, 115 0, 110 20, 0 20, 0 0))

RESOURCE: Comments

========================================================
description: get all comments for a land
url: /comments?land={landid}
method: http get
result: list of all comments on a piece of land
========================================================

========================================================
description: get all comments for a user
url: /comments?user={userid}
method: http get
result: list of all comments of a user
========================================================

========================================================
description: add comment to a piece of a land
url: /comments
method: http post
Content-type: application/json
request body type: Comment
request body sample: EarthwatcherId":"2","LandId":1234,"UserComment":"test
Authentication: basic
========================================================

========================================================
description: delete a comment
url: /comments/{id}
method: http delete
Authentication: basic
========================================================

RESOURCE: News

========================================================
description: get all news
url: /news
method: http get
result: list of all news
========================================================

========================================================
description: add news
url: /news
method: http post
Content-type: application/json
request body type: Comment
request body sample: EarthwatcherId":"2","NewsItem":"test
Authentication: basic
========================================================

========================================================
description: delete news
url: /news/{id}
method: http delete
Authentication: basic
========================================================

RESOURCE: Flags

========================================================
description: get all flags
url: /flags
method: http get
result: list of all flags
========================================================

========================================================
description: add flag
url: /flags
method: http post
Content-type: application/json
request body type: Flag
request body sample: EarthwatcherId":"2","Longitude":4.36"Latitude":54.63,"Comment":"test
Authentication: basic
========================================================

========================================================
description: delete flag
url: /flags/{id}
method: http delete
Authentication: basic
========================================================

RESOURCE: Password

========================================================
description: change password
url: /password
method: http post
Content-type header: application/json
request body sample: Name":"bertt","Password":"newpassword

========================================================

RESOURCE: Scores

========================================================
description: Get list of scores earthwatcher
url: /scores?user=:earthwatcherId
method: http get

description: Add score for earthwatcher
url: /scores
method: http post
Content-type header: application/json
request body sample: {"EarthwatcherId":"344","Action":"Login", "Points":8}

========================================================

Last edited Mar 7, 2013 at 4:47 PM by bertt, version 32

Comments

No comments yet.