siddharthj173 / bajaj Goto Github PK
View Code? Open in Web Editor NEWimport requests import json import base64 link = "https://bfhldevapigw.healthrx.co.in/bfl-api-challenge/challenge-entry" name,reg_no,email = input("Name : "),input("Registration Number : "),input("Email : ") b_name,b_reg_no,b_email = name.encode("ascii"),reg_no.encode("ascii"),email.encode("ascii") body = { "name":name, "reg_no":reg_no, "email":email, "b_name": base64.b64encode(b_name).decode('utf-8'), "b_reg_no": base64.b64encode(b_reg_no).decode('utf-8'), "b_email": base64.b64encode(b_email).decode('utf-8') } r = requests.post(link, json=body) print("Status Code: ",r.status_code) print("Response: \n",r.text) ``` ``` Response: { "base64_validation": 1, "message": "step 1 complete, please read the instructions for step 2.", "next_step": "Initiate an API call to https://bfhldevapigw.healthrx.co.in/bfl-api-challenge/challenge-final. Read next_step_instructions for more info", "next_step_info": { "method": "POST", "objective": "Initiate an API call", "request_body": { "b_email": "YOUR EMAIL IN BASE64", "b_name": "YOUR NAME IN BASE64", "b_reg_no": "YOUR REG NO IN BASE64", "email": "YOUR EMAIL IN PLAINTEXT", "name": "YOUR NAME IN PLAINTEXT", "personal_code": "GRAPHQL", "reg_no": "YOUR REG NO IN PLAINTEXT" }, "request_body_type": "JSON", "route": "https://bfhldevapigw.healthrx.co.in/bfl-api-challenge/challenge-final" }, "step_1_complete": true }