Client library for Contribly
npm install --save @datafire/contribly
let contribly = require('@datafire/contribly').create({
access_token: "",
refresh_token: "",
client_id: "",
client_secret: "",
redirect_uri: ""
});
.then(data => {
console.log(data);
});
Exchange the code passed to your redirect URI for an access_token
contribly.oauthCallback({
"code": ""
}, context)
- input
object
- code required
string
- code required
- output
object
- access_token
string
- refresh_token
string
- token_type
string
- scope
string
- expiration
string
- access_token
Exchange a refresh_token for an access_token
contribly.oauthRefresh(null, context)
This action has no parameters
- output
object
- access_token
string
- refresh_token
string
- token_type
string
- scope
string
- expiration
string
- access_token
List the available artifact formats
contribly.artifact_formats.get(null, context)
This action has no parameters
- output ArtifactFormats
List assignments
contribly.assignments.get({}, context)
- input
object
- ownedBy
string
: Restrict results to assignments owned by this user. - page
integer
: Pagination page - pageSize
integer
: Pagination page size - q
string
: Restrict results to assignments whose name or description matches this keyword. - urlWords
string
: Select an assignment by urlWords. - open
boolean
: Select open or closed assignments - alwaysOpen
boolean
: Select assignments with no closing date. - tag
string
: Restrict results to assignments which are tagged with this tag. - name
string
: Restrict results to the assignment (or potentially assignments) with this exact name
- ownedBy
- output
array
- items Assignment
Create a new assignment
contribly.assignments.post({
"body": {
"name": ""
}
}, context)
- input
object
- body required AssignmentSubmission
- output Assignment
Delete this assignment and all of it's contributions
contribly.assignments.id.delete({
"id": ""
}, context)
- input
object
- id required
string
: Id of the assignment to return
- id required
Output schema unknown
Get a single assigment by id
contribly.assignments.id.get({
"id": ""
}, context)
- input
object
- id required
string
: Id of the assignment to return
- id required
- output Assignment
The Contribly change log.
contribly.change_log.get(null, context)
This action has no parameters
- output
array
- items ChangeLogItem
List valid contribution refinement types
contribly.contribution_refinement_types.get(null, context)
This action has no parameters
- output
array
- items
string
- items
Given a contribution list query determine the available filter options. Can be used to generate the UI to refinement a filter.
contribly.contribution_refinements.get({}, context)
- input
object
- assignment
string
: Restrict results to contributions submitted to this assignment. - country
string
: Limit results to contributions which have a publicly visible location within the given country (specified by two letter country code). - createdBefore
string
: Limit results to contributions created before this date time. - createdAfter
string
: Limit results to contributions created after this date time. - geohash
string
: Restrict results to contributions which have specified a location which falls within this geohash (or comma seperated list of multiple geohashes) - hasLocation
boolean
: Restrict results to contributions which have a publicly visible location. - latLong
string
: Limit results to contributions with location near this latitude and longitude (comma seperated lat/long pair). Also see radius - radius
number
: When limiting result by location with the latLong parameter, specify the radius in kilometers. - mediaType
string
: Restrict results to contributions which include a media file of the given type (ie. image / video) - ownedBy
string
: Restrict results to contributions which are fall under the jurisdiction by this user. - q
string
: Restrict results to contributions whose headline text matches this keyword. - urlWords
string
: Locate a specific contribution by URL words - user
string
: Restrict results to contributions by this user identified by id. - refinements
string
: Comma seperated list of refinement names. - refinementSize
number
: Number of refinement options to return.
- assignment
- output
object
Retrieve contributions.
contribly.contributions.get({}, context)
- input
object
- assignment
string
: Restrict results to contributions submitted to this assignment. - country
string
: Limit results to contributions which have a publicly visible location within the given country (specified by two letter country code). - createdBefore
string
: Limit results to contributions created before this date time. - createdAfter
string
: Limit results to contributions created after this date time. - createdDay
string
: Limit results to contributions created on this day. - createdMonth
string
: Limit results to contributions created during this month. - geohash
string
: Restrict results to contributions which have specified a location which falls within this geohash (or comma seperated list of multiple geohashes) - hasLocation
boolean
: Restrict results to contributions which have a publicly visible location. - latLong
string
: Limit results to contributions with location near this latitude and longitude (comma seperated lat/long pair). Also see radius - radius
number
: When limiting result by location with the latLong parameter, specify the radius in kilometers. - mediaType
string
: Restrict results to contributions which include a media file of the given type (ie. image / video) - ownedBy
string
: Restrict results to contributions which are fall under the jurisdiction by this user. - q
string
: Restrict results to contributions whose headline text matches this keyword. - urlWords
string
: Locate a specific contribution by URL words - user
string
: Restrict results to contributions by this user identified by id. - ids
string
: Restrict results to a list of specific contributions identified by a comma seperated list of ids. - format
string
: Select output format. 'json' or 'rss'. Defaults to JSON.
- assignment
- output
array
- items Contribution
Create a new contribution
contribly.contributions.post({
"body": {}
}, context)
- input
object
- body required Contribution
- output Contribution
Delete this contribution
contribly.contributions.id.delete({
"id": ""
}, context)
- input
object
- id required
string
: Id of the contribution to delete
- id required
- output Contribution
Get a single contribution by id
contribly.contributions.id.get({
"id": ""
}, context)
- input
object
- id required
string
: Id of the contribution to return
- id required
- output Contribution
Allows end users to bring potential issues with publicly visible content to the attention of moderators.
contribly.contributions.id.flag.post({
"id": "",
"body": {}
}, context)
- input
object
- id required
string
: Id of the contribution to flag - body required Flag
- id required
- output Flag
Allows a user to mark a contribution as liked
contribly.contributions.id.like.post({
"id": ""
}, context)
- input
object
- id required
string
: Id of the contribution
- id required
- output
number
Returns a list of user ids of users who have liked this conribution
contribly.contributions.id.likes.get({
"id": ""
}, context)
- input
object
- id required
string
: Id of the contribution
- id required
- output
array
- items
string
- items
Allows the contribution to approved of rejected.
contribly.contributions.id.moderate.post({
"id": "",
"body": {}
}, context)
- input
object
- id required
string
: Id of the contribution to moderate - body required ModerationHistoryItemSubmission
- id required
- output
string
List the credentials associated with the authenticated user.
contribly.credentials.get(null, context)
This action has no parameters
- output
array
- items Credential
List available notification event types
contribly.event_types.get(null, context)
This action has no parameters
- output
array
- items EventType
Begin an export job. Returns a export job which can be polled to follow the progress of an export.
contribly.export.post({}, context)
- input
object
- assignment
string
: Restrict results to contributions submitted to this assignment. - country
string
: Limit results to contributions which have a publicly visible location within the given country (specified by two letter country code). - createdBefore
string
: Limit results to contributions created before this date time. - createdAfter
string
: Limit results to contributions created after this date time. - geohash
string
: Restrict results to contributions which have specified a location which falls within this geohash (or comma seperated list of multiple geohashes) - hasLocation
boolean
: Restrict results to contributions which have a publicly visible location. - latLong
string
: Limit results to contributions with location near this latitude and longitude (comma seperated lat/long pair). Also see radius - radius
number
: When limiting result by location with the latLong parameter, specify the radius in kilometers. - mediaType
string
: Restrict results to contributions which include a media file of the given type (ie. image / video) - ownedBy
string
: Restrict results to contributions which are fall under the jurisdiction by this user. - q
string
: Restrict results to contributions whose headline text matches this keyword. - urlWords
string
: Locate a specific contribution by URL words - user
string
: Restrict results to contributions by this user identified by id. - tagged
boolean
: Should exported media files be tagged with metadata. Deprecated; use format instead. - combined
boolean
: Included a combined file with all contribution text. - individual
boolean
: Include individual text files for each contribution. - format
string
: Media format to export; none, fullsize, tagged or original. - json
boolean
: Include raw JSON for each contribution.
- assignment
- output Export
Provide a preflight summary of an export request.
contribly.export_summary.post({}, context)
- input
object
- assignment
string
: Restrict results to contributions submitted to this assignment. - country
string
: Limit results to contributions which have a publicly visible location within the given country (specified by two letter country code). - createdBefore
string
: Limit results to contributions created before this date time. - createdAfter
string
: Limit results to contributions created after this date time. - geohash
string
: Restrict results to contributions which have specified a location which falls within this geohash (or comma seperated list of multiple geohashes) - hasLocation
boolean
: Restrict results to contributions which have a publicly visible location. - latLong
string
: Limit results to contributions with location near this latitude and longitude (comma seperated lat/long pair). Also see radius - radius
number
: When limiting result by location with the latLong parameter, specify the radius in kilometers. - mediaType
string
: Restrict results to contributions which include a media file of the given type (ie. image / video) - ownedBy
string
: Restrict results to contributions which are fall under the jurisdiction by this user. - q
string
: Restrict results to contributions whose headline text matches this keyword. - urlWords
string
: Locate a specific contribution by URL words - user
string
: Restrict results to contributions by this user identified by id.
- assignment
- output ExportSummary
Get a single export job; poll to follow export progress.
contribly.exports.id.get({
"id": ""
}, context)
- input
object
- id required
string
: Id of the export job to return
- id required
- output Export
List form responses
contribly.form_responses.get({}, context)
- input
object
- user
string
: Restrict results to responses submitted by this user. - form
string
: Restrict results to responses submitted to this form. - contribution
string
: Restrict results to responses relating to this contribution.
- user
- output
array
- items FormResponse
Submit a response to a form
contribly.form_responses.post({
"body": {}
}, context)
- input
object
- body required FormResponseSubmission
- output FormResponse
Get a single form response by id
contribly.form_responses.id.get({
"id": ""
}, context)
- input
object
- id required
string
: Id of the assignment to return
- id required
- output FormResponse
List forms
contribly.forms.get({
"ownedBy": ""
}, context)
- input
object
- ownedBy required
string
: Restrict results to forms owned by this user.
- ownedBy required
- output
array
- items Form
Create a form
contribly.forms.post({
"body": {}
}, context)
- input
object
- body required FormSubmission
- output Form
Delete this form and all of it's responses.
contribly.forms.id.delete({
"id": ""
}, context)
- input
object
- id required
string
: Id of the form to delete
- id required
Output schema unknown
Get a single form by id
contribly.forms.id.get({
"id": ""
}, context)
- input
object
- id required
string
: Id of the form to return
- id required
- output Form
Submit a new media file
contribly.media.post({
"body": ""
}, context)
- input
object
- body required
string
- body required
- output Media
contribly.notifications.contributions.id.preview.get({
"id": "",
"message": ""
}, context)
- input
object
- id required
string
: Id of the contribution to preview a notification for - message required
string
: Type of message to preview.
- id required
- output NotificationPreview
List available token scopes
contribly.scopes.get(null, context)
This action has no parameters
- output
array
- items
string
- items
List available subscription types
contribly.subscription_types.get(null, context)
This action has no parameters
- output
array
- items SubscriptionType
List subscriptions for the authorised user.
contribly.subscriptions.get({
"body": {
"types": [],
"includeBody": true
}
}, context)
- input
object
- body required SubscriptionSubmission
- output
array
- items Subscription
Delete a subscription.
contribly.subscriptions.id.delete({
"id": ""
}, context)
- input
object
- id required
string
: Id of the subscription to delete
- id required
Output schema unknown
Retrieve tags.
contribly.tags.get({}, context)
- input
object
- ownedBy
string
: Restrict results to those owned by this user. - tagSet
string
: Restrict results to tags belonging to this tag set. - urlWords
string
: Restrict results by urlWords. Should be used with ownedBy when searching for one of your own tags.
- ownedBy
- output
array
- items Tag
Create a new tag
contribly.tags.post({
"body": {
"name": ""
}
}, context)
- input
object
- body required TagSubmission
- output Tag
Retrieve a single tag by id
contribly.tags.id.get({
"id": ""
}, context)
- input
object
- id required
string
: Id of the tag to return
- id required
- output Tag
Retrieve tag sets.
contribly.tagsets.get({}, context)
- input
object
- ownedBy
string
: Restrict results to those owned by this user. - urlWords
string
: Restrict results by urlWords. Should be used with ownedBy when searching for one of your own tag sets.
- ownedBy
- output
array
- items TagSet
Create a new tag set
contribly.tagsets.post({
"body": {
"name": "",
"urlWords": ""
}
}, context)
- input
object
- body required TagSetSubmission
- output TagSet
Retrieve a single tag set by id
contribly.tagsets.id.get({
"id": ""
}, context)
- input
object
- id required
string
: Id of the tag set to return
- id required
- output TagSet
List users
contribly.users.get({}, context)
- input
object
- assignment
string
: Restrict results to the users who have contributed to this assignment. - country
string
: Restrict results to the users who have submitted a contribution with a public location located within this country. - minimumContributions
number
: Restrict results to the users who have submitted at least this many contributions. - linkedProfile
string
: Restrict results to the users who a linked profile of this type. - ownedBy
string
: Restrict results to the users who are owned by of this owner. - submittedBefore
string
: Limit results to users who have submitted at least one contribution before this date time. - submittedAfter
string
: Limit results to users who have submitted at least one contribution after this date time. - username
string
: Restrict results to the user with this username.
- assignment
- output
array
- items User
Retrieve a single user by id
contribly.users.id.get({
"id": ""
}, context)
- input
object
- id required
string
: Id of the user to return
- id required
- output User
Retrieve a users linked profile by type
contribly.users.id.linked.type.get({
"id": "",
"type": ""
}, context)
- input
object
- id required
string
: Id of the user to return - type required
string
: Type of the linked profile to fetch
- id required
- output LinkedProfile
Verify token and return details of the owning user
contribly.verify.post(null, context)
This action has no parameters
- output Authority
- Artifact
object
- contentLength
number
- contentType
string
- height
number
- label
string
- url
string
- width
number
- contentLength
- ArtifactFormat
object
- contentType
string
- fileExtension
string
- forContentType
string
- label
string
- preserveAspectRatio
boolean
- public
boolean
- upscaleAllowed
boolean
- contentType
- ArtifactFormats
object
- contribution
array
- items ArtifactFormat
- cover
array
- items ArtifactFormat
- profileImage
array
- items ArtifactFormat
- contribution
- Assignment
object
- allowsAnonymousContributions
boolean
- callToAction
string
: An optional call to action specific to this assignment. ie. Submit your snow pictures. - cover MediaUsage
- created
string
- description
string
- embargo
string
- ends
string
- featured
boolean
- id
string
- mediaRequired
boolean
- moderator
string
: Optional credential id of the moderator who owns this particular assignment. - name
string
- open
boolean
: Helper value. Is this assignment currently open? Based on the value of the ends field. - receiptMessage
string
: An optional assignment specific message to be displayed on successful contribution submission. For example, this might be used to inform contributors of assignment specific moderation time frames. - starts
string
- tags
array
- items Tag
- urlWords
string
- webUrl
string
- allowsAnonymousContributions
- AssignmentSubmission
object
- allowsAnonymousContributions
boolean
- cover MediaUsage
- description
string
- embargo
string
- ends
string
- featured
boolean
- id
string
- mediaRequired
boolean
- moderator
string
: Optional credential id of the login which will moderator this assignment. - name required
string
- receiptMessage
string
: An optional assignment specific message to be displayed on successful contribution submission. For example, this might be used to inform contributors of assignment specific moderation time frames. - starts
string
- tags
array
- items Tag
- urlWords
string
- allowsAnonymousContributions
- ChangeLogItem
object
- date required
string
- description
string
- title required
string
- date required
- Client
object
- id
string
- name
string
- id
- Contribution
object
- assignment Assignment
- attribution
string
: The public attribution for this contribution. This will be the display name of the registered user or the contributor's first and last name if they provided them while making a non authenticated contribution. A blank attribution field indicates and anonymous contribution. - body
string
- created
string
- headline
string
- id
string
- mediaUsages
array
- items MediaUsage
- moderationHistory
array
- items ModerationHistoryItem
- place Place
- urlWords
string
- via Via
- Credential
object
- scopes
array
- items
string
- items
- type
string
- user
string
- value
string
- scopes
- ErrorField
object
- message
string
- name required
string
- message
- ErrorResponse
object
- fields
array
- items ErrorField
- message
string
- fields
- EventType
object
- id required
string
- name required
string
- id required
- Export
object
- downloadUrl
string
- finished
string
- id required
string
- owner required
string
- progress
number
- started required
string
- step
string
- downloadUrl
- ExportSummary
object
- contributions required
number
: The number of contributions selected for export. - estimatedSize
string
: Human readable estimate of the export size. ie. '10MB'. - media required
number
: The number of media files included in this export. - totalMediaSize required
number
: The expected total size of the media files to be exported.
- contributions required
- Flag
object
- date
string
- email
string
- id
string
- notes
string
- type
string
- date
- Form
object
- FormField
object
- description
string
- label
string
- name
string
- options
array
- items
string
- items
- public
boolean
- required
boolean
- type
string
- description
- FormResponse
object
- contribution
string
- date
string
- form
string
- id
string
- responses
object
- user
string
- contribution
- FormResponseSubmission
object
- contribution
string
- form
string
- responses
object
- contribution
- FormSubmission
object
- Group
object
- id
string
- name
string
- id
- LatLong
object
- latitude
number
- longitude
number
- latitude
- LinkedProfile
object
- bio
string
- email
string
- id
string
- name
string
- picture
string
- profile
string
- registered
string
- bio
- Media
object
- duration
number
- id
string
- place Place
- type
string
- duration
- ModerationAction
object
- id required
string
- label required
string
- resultingState required ModerationState
- id required
- ModerationHistoryItem
object
- action ModerationAction
- date required
string
- notes
string
- ModerationHistoryItemSubmission
object
- action ModerationAction
- notes
string
- ModerationState
object
- id required
string
- label required
string
- public required
boolean
- id required
- NotificationPreview
object
- email
string
- html
string
- subject
string
- email
- OsmId
object
- osmId
number
- osmType
string
- osmId
- Subscription
object
- assignment
string
- email
string
- id required
string
- includeBody required
boolean
- includeThumbenail
boolean
- slackChannel
string
- token required
string
- types required
array
- items
string
- items
- user required
string
- assignment
- SubscriptionSubmission
object
- assignment
string
- email
string
- includeBody required
boolean
- includeThumbenail
boolean
- slackChannel
string
- types required
array
- items
string
- items
- assignment
- SubscriptionType
object
- id required
string
- name required
string
- id required
- Tag
object
- colour
string
: Optional HTML hexcode colour - id required
string
- name required
string
- tagSet TagSet
- urlWords
string
- colour
- TagSet
object
- id required
string
- name required
string
- id required
- TagSetSubmission
object
- name required
string
- urlWords required
string
- name required
- TagSubmission
object
- colour
string
- name required
string
- tagSet TagSet
- urlWords
string
- colour
- User
object
- bio
string
- displayName
string
- id
string
- registered
string
- username
string
- bio