Created
November 28, 2012 16:20
-
-
Save danlynn/4162307 to your computer and use it in GitHub Desktop.
Registration steps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Register - Step 1 (login): Authenticate using fuzzy card number as 'login' and last name as 'password' (note auth will fail if Card.Reg == 1 already) | |
curl -i -H "Accept: application/json" -X POST -d "api_user_session[retailer_id]=767&api_user_session[type]=Card&api_user_session[login]=40000000197&api_user_session[password]=Vandalay" http://local.webstophq.com:3000/api/v1/login | |
# Register - Step 2 (get preferred store list): Gets list of {:id, :store_number, :address_1, :city, :store_name} | |
GET /api/v1/retailers/:retailer_id/stores(.:format) | |
curl -i -H "Accept: application/json" http://local.webstophq.com:3000/api/v1/retailers/767/stores?api_user_credentials=tozaqJaMRDKPjXPWhDh | |
# Register - Step 3 (update consumer): Mark Consumer (Card) as registered and set preferred store and password - then return the Consumer (Card) including new single_access_token and legacy_token | |
PUT /api/v1/retailers/:retailer_id/consumers/:id(.:format) | |
curl -i -H "Accept: application/json" -X PUT -d "consumer[registered]=1&consumer[store_number]=261&consumer[password]=aaa&consumer[password_confirmation]=aaa" http://local.webstophq.com:3000/api/v1/retailers/767/consumers/0000000197?api_user_credentials=tozaqJaMRDKPjXPWhDh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment