Code Monkey home page Code Monkey logo

geoback's Introduction

GeoRelief API Endpoint Reference

These are the endpoints for the GeoRelief API

Contents

  1. Areas
  1. Contact
  1. Institutions
  1. Locations
  1. Logs
  1. Services
  1. Users

Areas

Area Properties

Name Type Description
_id String Name and unique identifier of the area
_rev String Revision number of the relief area
date Date Date and time relief area was added
coordinates String JSON encoded string containing the Latitude, Longitude, and Zoom level of relief area

POST /areas

Add an area to the table.

Parameters

Name Type Description
name String Name of the area
coordinates String JSON encoded string containing the Latitude, Longitude, and Zoom level of the map

Example

var area = {
    name: "New Area";
    coordinates: "{\"lat\": 40.6451056, \"lon\": -73.9962453, \"zoom\": 13}"
}

GET /areas

Get all areas.

Returns

An array of all relief areas.

Example

[
    {
        "_id": "Minneapolis",
        "_rev": "1-5cb090e13e57b1813811770ab8434a66",
        "date": "2013-06-30T20:51:09.487Z",
        "coordinates": "{\"lat\":44.97466550157047, \"lon\":-93.26611518859863, \"zoom\":14}"
    },
    {
        "_id": "New York",
        "_rev": "2-e3b12e17b5f6f470eca6ecb523ce0dd3",
        "date": "2013-06-08T23:42:51.734Z",
        "coordinates": "{\"lat\": 40.6451056, \"lon\": -73.9962453, \"zoom\": 13}"
    },
    {
        "_id": "Syria",
        "_rev": "21-62585e15c9b1fd71160a592cfa188c06",
        "date": "2013-06-08T22:42:51.214Z",
        "coordinates": "{\"lat\": 34.72919834205246, \"lon\": 36.71493530273437, \"zoom\": 13}"
    }
]

GET /areas/:area

Get a single area.

Returns

The specified area

Parameters

Name Type Description
area String Name of the area

Example

{
    "_id": "Syria",
    "_rev": "21-62585e15c9b1fd71160a592cfa188c06",
    "date": "2013-06-08T22:42:51.214Z",
    "coordinates": "{\"lat\": 34.72919834205246, \"lon\": 36.71493530273437, \"zoom\": 13}"
}

DELETE /areas

Delete an area.

Parameters

Name Type Description
name String Name of the area
rev String Revision of the document

Example

var area = {
    name: "Delete This Area";
    rev: "1-5cb090e13e57b1813811770ab8434a66"
}

Contact

POST /contact

Send message to GeoRelief administrator

Parameters

Name Type Description
name String Name of the sender
email String Email of the sender
regarding String What the message is about
message String Body of the message

Example

var formData = {
    name: "Real Name",
    email: "[email protected]",
    regarding: "Bug Report",
    message: "The contact form doesn't work!"
}

Institutions

Institution Properties

Name Type Description
_id String Institution's unique identifier
_rev String Document revision
name String Name of the institution
url String URL of the institution
description String Description of the institution
approvedEmails Array <String> Array of emails approved to register under the institution

POST /institutions

Add an institution to the table.

Parameters

Name Type Description
name String Name of the institution
url String URL of the institution
description String Description of the institution

Example

var institution = {
    name: "Institution Name",
    url: "http://example.com/",
    description: "Short description of my brand new institution!"
}

GET /institutions

Get all institutions.

Returns

An array of all institutions.

Example

[
    {
        "_id": "4b61f34780a83a95e503ad835b00109f",
        "_rev": "112-37ef7d5e60f7cd84321ee3fb3a9401d4",
        "name": "Action Against Hunger (AAH)",
        "url": "http://www.aah-usa.org/",
        "description": "Develops and runs emergency programs in nutrition, health, water and food security for countries in need. Also provides disaster preparedness programs with the goal of anticipating and preventing humanitarian crises.",
        "approvedEmails": [
            "[email protected]"
        ]
    },
    {
        "_id": "4b61f34780a83a95e503ad835b001d69",
        "_rev": "2-0854e647df3f096b67e62bfc7f6892c2",
        "name": "CARE",
        "url": "http://www.careusa.org/",
        "description": "CARE is one of the world's largest private international humanitarian organizations, committed to helping families in poor communities improve their lives and achieve lasting victories over poverty. Founded in 1945 to provide relief to survivors of World War II, CARE quickly became a trusted vehicle for the compassion and generosity of millions."
    }
]

GET /institutions/:id

Get a single institution

Parameters

Name Type Description
id String Institution's unique identifier

Example

{
    "_id": "4b61f34780a83a95e503ad835b00109f",
    "_rev": "112-37ef7d5e60f7cd84321ee3fb3a9401d4",
    "name": "Action Against Hunger (AAH)",
    "url": "http://www.aah-usa.org/",
    "description": "Develops and runs emergency programs in nutrition, health, water and food security for countries in need. Also provides disaster preparedness programs with the goal of anticipating and preventing humanitarian crises.",
    "approvedEmails": [
        "[email protected]",
    ]
}

Locations

POST /locations

GET /locations

GET locations/type/:type

Logs

POST /log

GET /log/:loc_id

GET /log/cluster/:loc_id/:cluster

Services

POST /services

PUT /services/:id

GET /services/:loc_id

GET /services/cluster/:loc_id/:cluster

GET /services/:service_id

GET /services/cluster/:cluster

Users

POST /login

Log the user in.

Parameters

  • username
  • password

Returns

{
    "_id": String "User ID",
    "_rev": String "Revision",
    "name": String "Username",
    "realname": String "Real Name",
    "institution": String "Institution ID",
    "email": String "User Email",
    "type": String "User Type",
    "roles": Array "User Roles",
    "level": String "User Level",
    "phone": Int "User Phone Number",
    "cluster": String "User Cluster",
    "institutionName": String "Institution Name",
    "institutionUrl": String "Institution URL"
}

POST /users

POST /password

POST /users/approve

GET /logout

GET /users/:id

GET /users/institution/:institution

GET /users/confirm/:key

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.