Skip to content

Instantly share code, notes, and snippets.

@wkentdag
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wkentdag/4efeb5381601306c82f8 to your computer and use it in GitHub Desktop.
Save wkentdag/4efeb5381601306c82f8 to your computer and use it in GitHub Desktop.
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