wat-do-seattle.com
Access (and in some cases manipulate) the activities in the database.
GET requests with JSON response:
To see all activities (index):
wat-do-seattle.com/api/activities
To see a specific activity (show):
wat-do-seattle.com/api/activities/< enter an activity id # here and exclude carrots>
OR, from the console:
curl -H ‘Accept: application/vnd.wat-do-seattle.v1’ wat-do-seattle.com/api/products
-
Visit wat-do-seattle.com
-
Sign in / Create an account
-
Go to Profile/Accounts
-
Enter email address and check request admin status
-
If you are granted access, you will be given a name and password
IF you are granted access:
In console (with hash and name:password examples), you can POST (create) one or many Activities via JSON hash with the following command:
curl -X POST -H “Content-Type: application/json” -u “name:password” -d ‘{“activities”: [{“name”: “Blomb”, “url”: “www.seattlecenter.com”, “min_price”: “0”, “max_price”: “10”, “min_activity_level”: “0”, “max_activity_level”: “5”, “description”: “What a cool place to go”}]}’ wat-do-seattle.com/api/activities
All attributes must be filled out, with internal quotes and apostrophes escaped.
To push JSON string to db via script, simply navigate to wat-do-seattle.com/activities/init_activities and enter admin credentials upon prompt.