Created
July 21, 2017 18:37
-
-
Save oxguy3/c241760ade908a26fdfcbdf6bcab185b to your computer and use it in GitHub Desktop.
A Postman collection for accessing your Humble Bundle purchases via the Android app's API. Download and import to Postman.
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
{ | |
"variables": [], | |
"info": { | |
"name": "Humble Bundle Android", | |
"_postman_id": "4279719d-083a-5656-6524-c00e77975f62", | |
"description": "", | |
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "login", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 200;", | |
"", | |
"var jsonData = JSON.parse(responseBody);", | |
"tests[\"Successful login\"] = jsonData.success === true && typeof jsonData.errors === 'undefined';", | |
"", | |
"tests[\"CAPTCHA was valid\"] = typeof jsonData.errors === 'undefined' || typeof jsonData.errors.captcha === 'undefined';", | |
"tests[\"SMS not required\"] = typeof jsonData.errors === 'undefined' || typeof jsonData.errors.sms === 'undefined';", | |
"tests[\"Email and password were correct\"] = typeof jsonData.errors === 'undefined' || typeof jsonData.errors.unamepwd === 'undefined';", | |
"tests[\"No API network error\"] = typeof jsonData.errors === 'undefined' || typeof jsonData.errors.network === 'undefined';" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "https://hr-humblebundle.appspot.com/processlogin", | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Accept", | |
"value": "application/json", | |
"description": "" | |
}, | |
{ | |
"key": "Content-Type", | |
"value": "application/x-www-form-urlencoded", | |
"description": "" | |
}, | |
{ | |
"key": "X-Requested-By", | |
"value": "hb_android_app", | |
"description": "" | |
} | |
], | |
"body": { | |
"mode": "urlencoded", | |
"urlencoded": [ | |
{ | |
"key": "ajax", | |
"value": "true", | |
"description": "", | |
"type": "text" | |
}, | |
{ | |
"key": "username", | |
"value": "{{username}}", | |
"description": "", | |
"type": "text" | |
}, | |
{ | |
"key": "password", | |
"value": "{{password}}", | |
"description": "", | |
"type": "text" | |
}, | |
{ | |
"key": "recaptcha_challenge_field", | |
"value": "", | |
"description": "", | |
"type": "text" | |
}, | |
{ | |
"key": "recaptcha_response_field", | |
"value": "{{recaptcha_response}}", | |
"description": "", | |
"type": "text" | |
}, | |
{ | |
"key": "authy-token", | |
"value": "{{authy_token}}", | |
"description": "", | |
"type": "text" | |
}, | |
{ | |
"key": "send_sms", | |
"value": "", | |
"description": "", | |
"type": "text" | |
} | |
] | |
}, | |
"description": "Prior to authentication, you must complete a captcha. Go to https://hr-humblebundle.appspot.com/user/captcha, then paste the following code in the JS console:\n```\nwindow.Android = {\n setCaptchaResponse: function(challenge, response) {\n console.log(response);\n }\n}\n```\nNow complete the captcha. When you click Submit, a big long nonsense string will appear in the JS console. Copy this and add it to your Postman environment as a variable named 'recaptcha_response'.\n\nIf you use two-factor authentication, you will also need to set your 'authy\\_token' environment variable to the current token. If you prefer SMS to the authenticator app, leave the 'authy\\_token' blank and change the send\\_sms value in the request body to \"true\", then submit the request. You'll receive your token via SMS, then you can fill it in as 'authy\\_token' and redo the request to complete the login." | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "get orders list", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 200;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "https://hr-humblebundle.appspot.com/api/v1/user/order", | |
"method": "GET", | |
"header": [ | |
{ | |
"key": "Accept", | |
"value": "application/json", | |
"description": "" | |
}, | |
{ | |
"key": "X-Requested-By", | |
"value": "hb_android_app", | |
"description": "" | |
} | |
], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "get order details", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 200;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "https://hr-humblebundle.appspot.com/api/v1/order/PayEBBpTbbEXFEMK", | |
"method": "GET", | |
"header": [ | |
{ | |
"key": "Accept", | |
"value": "application/json", | |
"description": "" | |
}, | |
{ | |
"key": "X-Requested-By", | |
"value": "hb_android_app", | |
"description": "" | |
} | |
], | |
"body": {}, | |
"description": "" | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "service_check", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"type": "text/javascript", | |
"exec": [ | |
"tests[\"Status code is 200\"] = responseCode.code === 200;" | |
] | |
} | |
} | |
], | |
"request": { | |
"url": "https://hr-humblebundle.appspot.com/androidapp/v2/service_check", | |
"method": "GET", | |
"header": [], | |
"body": {}, | |
"description": "Checks what Android-relevant bundles are currently ongoing." | |
}, | |
"response": [] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This only retrieves the downloadables from the bundles/games you own. Not every purchase.