Skip to content

Instantly share code, notes, and snippets.

@wkentdag
Last active August 29, 2015 14:20
Embed
What would you like to do?
sup api from the command line
Creating a new user:
curl -X POST 'http://localhost:3000/users' # development monde
curl -X POST 'http://localhost:3000/users' -d 'first_name=will&last_name=kd&phone=123456' # production mode
Creating a new status:
curl -X POST 'http://localhost:3000/status' -d 'fake_owner_id=1' # development mode
curl -X POST 'http://localhost:3000/status' -d 'owner_id=6&longitude=666&latitude=111' # production mode
Granting a user permission to view a status:
curl -X POST 'http://localhost:3000/status/:id/viewers' -d 'user_id=6' # :id = valid status id
Making a friend request:
curl -X POST 'http://localhost:3000/requests' -d 'user_id=2&requested_id=5'
Approving a friend request:
curl -X POST 'http://localhost:3000/users/:id/friends' -d 'friend_id=3' # :id = valid UID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment