Skip to content

Commit d072dd2

Browse files
committed
Add method for getting profile information
1 parent 803a000 commit d072dd2

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

loading_api_wrapper/api.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,18 @@ def _authenticate(self, email, password):
3131
return {"code": 200, "cookies": response.cookies}
3232

3333
return response.json()
34+
35+
def get_profile(self):
36+
url = f"{API_URL}/{API_VERSION}/users/profile"
37+
headers = {
38+
"User-Agent": USER_AGENT,
39+
}
40+
response = requests.get(url, headers=headers, cookies=self.cookies)
41+
42+
if response.status_code == 200:
43+
return {
44+
"code": response.status_code,
45+
"profile": response.json(),
46+
}
47+
48+
return response.json()

0 commit comments

Comments
 (0)