Client library for Greenwire Public API
npm install --save @datafire/greenpeace
let greenpeace = require('@datafire/greenpeace').create();
.then(data => {
console.log(data);
});
Greenpeace Greenwire allows you connect with other volunteers, activists and groups working on environmental campaigns all across the world!
Return the upcoming events (e.g. start date >= today). Gets an array of Event
object. Mandatory query param of domain determines the site / country the event belongs to.
greenpeace.events.get({
"domain": ""
}, context)
- input
object
- domain required
string
: the site the groups belongs to, example: netherlands - limit
string
: the number of desired records
- domain required
- output
object
- body
array
- items Event
- header HeaderSuccess
- body
Get one Event
object by specifying its UUID in the url path.
greenpeace.events.UUID.get({
"UUID": ""
}, context)
- input
object
- UUID required
string
- UUID required
- output
object
- data Event
- header HeaderSuccess
Gets an array of Group
object. Mandatory query param of domain determines the site / country the group belongs to.
greenpeace.groups.get({
"domain": ""
}, context)
- input
object
- domain required
string
: the site the groups belongs to, example: netherlands - limit
string
: the number of desired records
- domain required
- output
object
- body
array
- items Group
- header HeaderSuccess
- body
Get one Group
object by specifying its UUID in the url path.
greenpeace.groups.UUID.get({
"UUID": ""
}, context)
- input
object
- UUID required
string
- UUID required
- output
object
- data Group
- header HeaderSuccess
Gets an array of Volunteer
object. Mandatory query param of domain determines the site / country the volunteers are from.
greenpeace.volunteers.get({
"domain": ""
}, context)
- input
object
- domain required
string
: the site the users are registered on, example: netherlands - limit
string
: the number of desired records. Default is 5. - must_have_default_avatar
boolean
: 1 or 0. filter on people that have the default avatar or not.
- domain required
- output
object
- body
array
- items Volunteer
- header HeaderSuccess
- body
Get one specific Volunteer
object by specifying its UUID in the url path.
greenpeace.volunteers.UUID.get({
"UUID": ""
}, context)
- input
object
- UUID required
string
- UUID required
- output
object
- body Volunteer
- header HeaderSuccess
- Coordinates
object
- latitude
string
: Signed decimal format, example: 52.1234 - longitude
string
: Signed decimal format, example -77.022223
- latitude
- DateTime
string
: The date in YYYY-MM-DD HH:MM:SS format, example: 2015-12-31 23:59:59
- Event
object
- Group
object
- GroupType
string
(values: Country group, Campaign Project group, Local group, Discussion group, Interest group, Skills-based group)
- HTML
string
: A string containing sanitized HTML code
- HTTP_Code
string
: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
- HTTP_Status
integer
: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
- HeaderError
object
- code HTTP_Code
- error
string
: the error message - id
integer
: transaction nonce - pagination
object
- resources ResourceType
- status HTTP_Status
- HeaderSuccess
object
- code HTTP_Code
- error
null
- id
integer
: transaction nonce - pagination Pagination
- resources ResourceType
- status HTTP_Status
- ISO_3166-1_alpha-2
string
: Country code see. https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
- Location
object
- city
string
- coordinates Coordinates
- country
string
- postcode
string
- state
string
- streetname
string
- city
- LocationSimple
object
- country ISO_3166-1_alpha-2
- Pagination
object
- limit
integer
: the nubmer of items per page - page
integer
: the current page - total
integer
: the total number of pages
- limit
- ResourceType
string
(values: group, groups, event, events, volunteer, volunteers): The name of the requested object/model/resource. Plural if a collection.
- Serial
string
: The primary key in Drupal, e.g the entity/node id
- URL
string
: A resource location, example: https://greenwire.greenpeace.org
- UUID
string
: Universally unique identifier in canonical format, example: de305d54-75b4-431b-adb2-eb6b9e546014
- Volunteer
object
- avatar URL
- locations
array
- items LocationSimple
- uuid UUID