Skip to content

Commit

Permalink
feat(v2): update to API v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
deveaud-m committed Dec 18, 2023
1 parent 3d221a2 commit 0f11b95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fossology/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def fossology_token(
now = date.today()
data["token_expire"] = str(now + timedelta(days=30))
try:
response = requests.post(url + "/api/v1/tokens", data=data)
response = requests.post(url + "/api/v2/tokens", data=data)
if response.status_code == 201:
token = response.json()["Authorization"]
return token.replace("Bearer ", "")
Expand Down Expand Up @@ -107,7 +107,7 @@ def __init__(self, url, token, name=None):
self.users = list()
self.folders = list()

self.api = f"{self.host}/api/v1"
self.api = f"{self.host}/api/v2"
self.session = requests.Session()
self.session.headers.update({"Authorization": f"Bearer {self.token}"})
self.info = self.get_info()
Expand Down

0 comments on commit 0f11b95

Please sign in to comment.