david ten have
posted this on January 15, 2012 13:25
Our API documentation is fairly extensive, but over the holiday break I fielded a number of queries from people who weren't able to get things working. So I thought I would add another angle. Even though I have provided examples below, please remember that http://www.ponoko.com/app-gateway/api-documentation will always be the authoritative reference for API calls and will be updated more frequently.
One of the changes we made early on in the API development was to add a simple auth method. This method uses an app_key and a user_key. This method is simple enough that you can test the Ponoko API using command line tools, rather than code. Testing using the command line is great because you get to see errors immediately - where your coding rigs might be swallowing these (as was happening for one developer). Early in your development work I highly recommend that you use the command line to test your calls. At any point where you think things are behaving weirdly - drop out of your code and sanity check using the command line.
There are two tools you need to become familiar with:
curl is a must have tool and should ship with most *NIXs these days. jazor is a nice to have tool that formats the JSON output of the Ponoko API nicely in terminal. All the examples below will pipe the output into jazor, if you don't want the nice formatting remove the '| jazor' from the examples.
In the examples below I have used your_app_key and your_user_access_key as place holders. You will need to replace them with your keys. I have also retained certain keys (e.g. 2e9d8c90326e012e359f404062cdb04a) - they are there as examples only and to improve readability. You will need to replace them with data that is relevant to your app/task.