The microPledge developer API
Your dev link to microPledge
Quick-start
We’ve made our API really simple – to get started, just pick one of the examples below, skip over to the microPledge sandbox and try it out.
Basics
Our API is for developers to link their own web tools to microPledge – that is, you can now script microPledge. Use it to make your software do stuff on microPledge as though it were really you browsing around our site. You send commands to our microPlege pages using standard URL encoding, and then our server replies with JSON output.
First, grab your API key from your profile page. Then POST it to the desired microPledge URL along with any other form inputs required by that page.
The examples below will help. You don’t need to stick with wget.
Just pick the URL fetching
tool you like best. For example, in Python you would probably use urllib2.
Over time we will be expanding the functions that are accessible through this API, but we’d like to hear what you think is most urgent.
API by example
Creating a project
This API command to start a project is designed to let bug tracking tools automatically create bounty projects for their bugs.
wget https://micropledge.com/dream -O- --post-data=" apiKey=YOUR_API_KEY& name=Light+Sabre+War& description=StarWars+starter& details=Start+a+war+by+trying+to+assassinate+Darth+Vader& license=open-source& minPledge=30000& quoting=open& tags=StarWars+Vader"
Valid values for the multi-choice fields are:
license: non-software, open-source, closed-source, proprietaryquoting: open, sole, donationsincubator: ifon, must also havepriorart=YOUR_PRIOR_ART
On success, you’ll get back a JSON object with at least
a result string, a nextpage relative URL string, and a messages array.
The result will be success,
incomplete (you still have to enter a quote, for example), or
error if something went wrong.
If there’s an error, the first string in messages will tell
you what’s up. If this says it’s a FormError, there will be an errors
item whose keys are the invalid form inputs, and their values are what’s wrong with them.
Here’s example output from a successful project creation (edited slightly for brevity):
{
"messages": [
"Dreamed: Done! To get pledgers ..."
],
"nextpage": "\/mpledge\/projects\/light-sabre-war",
"result": "success"
}
And here’s example output with some form input errors
(no description given, and minPledge set to only $0.50):
{
"errors": {
"description": "FormRequiredField: Terribly sorry ...",
"minPledge": "FormLessThanMinimum: This value must be ..."
},
"messages": [
"FormError: Some of the form fields weren't filled in ..."
],
"nextpage": "\/mpledge\/dream",
"result": "error"
}
Other help topics:
- Overview | Funding projects | Development process
- Pledging | New features | Rules, fees, general | Developer API