Skip to content

Latest commit

 

History

History
361 lines (294 loc) · 8.11 KB

needs_list.md

File metadata and controls

361 lines (294 loc) · 8.11 KB

Project Needs List ⇄ Details

GET https://api.betterplace.org/de/api_v4/projects/1114/needs.json?facets=completed%3Afalse&order=position%3AASC

A list of betterplace.org projects needs (donate money). Results are contained in a data attribute. The details and list view show the same data per project need.

For betterplace.org clients: There is no client-scoped URL. Please use the API calls that are provided inside the client project url response to make sure you only request data that is associated with one of your projects.

URL Parameters

Parameter Example Required Description
project_id 1114 yes

Project id as an integer number ≥ 14.

facets completed:false no

Filter the result set. Documented and supported filters are:

  • completed:true/false – is this need fully funded?
Learn how to format the parameter.
order position:ASC no

Order the result set. Documented and supported orders are:

  • created_at:asc/desc – DESC: Latest needs first.
  • position:asc/desc – Priority of the need defined by the project manager
Learn how to format the parameter.

Response Attributes

Root Attributes

Attribute Types Example Description
id number 1

An integer number ≥ 1

created_at string "1994-11-05T13:15:30Z"

DateTime (ISO8601 with Timezone)

updated_at string "1994-11-05T13:15:30Z"

DateTime (ISO8601 with Timezone)

title string

Max 50 character

description string
completed boolean false

True if the need is 100 % financed

progress_percentage number 82

% financed

donated_amount_in_cents number 12382

How many cents are donated already. This includes all donations that can be given to a need (direct donation, forwarding of project donation, forwarding of organisation donation, forwarding of fundraising event donations, offline donations and also(!) external donations)

open_amount_in_cents number 12382

How many cents are still needed to complete the need

requested_amount_in_cents number 12382

How much money is needed in total

Response Links

Linkname Description

self

Link to this resource itself (need details)

project

Link to the related project's details

new_client_donation

Link to the donation form. Templated, needs insertion of the client_id.

new_donation

Link to the regular donation form.

Response Example

{
  "total_entries": 102,
  "offset": 0,
  "total_pages": 34,
  "current_page": 1,
  "per_page": 3,
  "data": [
    {
      "id": 5228,
      "created_at": "2009-03-10T11:38:39+01:00",
      "updated_at": "2017-07-04T15:09:32+02:00",
      "title": "Warme Mahlzeiten",
      "description": "Wer sich viel bewegt, der muss auch richtig essen: Mit nur 50 Euro im Monat lassen sich 8-10 warme Mahlzeiten für rund 30 Waisenkinder bereitstellen, die zweimal in der Woche von dem Skateistan-Team besucht werden und lernen Skateboard zu fahren.",
      "completed": true,
      "progress_percentage": 100.0,
      "donated_amount_in_cents": 5000,
      "open_amount_in_cents": 0,
      "requested_amount_in_cents": 5000,
      "links": [
        {
          "rel": "self",
          "href": "https://api.betterplace.org/de/api_v4/projects/1114/needs/5228.json"
        },
        {
          "rel": "project",
          "href": "https://api.betterplace.org/de/api_v4/projects/1114.json"
        },
        {
          "rel": "new_client_donation",
          "href": "https://www.betterplace.org/de/donate/%7Bclient_id%7D/projects/1114?need_id=5228",
          "templated": true
        },
        {
          "rel": "new_donation",
          "href": "https://www.betterplace.org/de/donate/platform/projects/1114?need_id=5228"
        }
      ]
    },
    {
      "id": 5229,
      "created_at": "2009-03-10T11:54:30+01:00",
      "updated_at": "2017-07-04T15:09:32+02:00",
      "title": "Skateboardlehrer",
      "description": "Mirwais, 13, ist Afghanistans erster talentierter Skateboardlehrer. Früher wusch er für 2 Dollar am Tag Autos auf der Straße. Heute ist er Skateistans Angestellter und kann mit seinem Gehalt (167 Euro/Monat) seine Familie ernähren.",
      "completed": true,
      "progress_percentage": 100.0,
      "donated_amount_in_cents": 16700,
      "open_amount_in_cents": 0,
      "requested_amount_in_cents": 16700,
      "links": [
        {
          "rel": "self",
          "href": "https://api.betterplace.org/de/api_v4/projects/1114/needs/5229.json"
        },
        {
          "rel": "project",
          "href": "https://api.betterplace.org/de/api_v4/projects/1114.json"
        },
        {
          "rel": "new_client_donation",
          "href": "https://www.betterplace.org/de/donate/%7Bclient_id%7D/projects/1114?need_id=5229",
          "templated": true
        },
        {
          "rel": "new_donation",
          "href": "https://www.betterplace.org/de/donate/platform/projects/1114?need_id=5229"
        }
      ]
    },
    {
      "id": 5237,
      "created_at": "2009-03-10T15:22:08+01:00",
      "updated_at": "2017-07-04T15:09:32+02:00",
      "title": "Skateboardlehrer",
      "description": "Mirwais, 16, ist Afghanistans erster talentierter Skateboardlehrer. Früher wusch er für 2 Dollar am Tag Autos auf der Straße. Heute ist er Skateistans Angestellter und kann mit seinem Gehalt (167 Euro/Monat) seine Familie ernähren.",
      "completed": true,
      "progress_percentage": 100.0,
      "donated_amount_in_cents": 16700,
      "open_amount_in_cents": 0,
      "requested_amount_in_cents": 16700,
      "links": [
        {
          "rel": "self",
          "href": "https://api.betterplace.org/de/api_v4/projects/1114/needs/5237.json"
        },
        {
          "rel": "project",
          "href": "https://api.betterplace.org/de/api_v4/projects/1114.json"
        },
        {
          "rel": "new_client_donation",
          "href": "https://www.betterplace.org/de/donate/%7Bclient_id%7D/projects/1114?need_id=5237",
          "templated": true
        },
        {
          "rel": "new_donation",
          "href": "https://www.betterplace.org/de/donate/platform/projects/1114?need_id=5237"
        }
      ]
    }
  ]
}