Skip to content

Commit

Permalink
ADD: added POST request
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-greening committed Jun 25, 2024
1 parent 0e4e383 commit 0612b24
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions route1io_connectors/google/sa360.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import Optional, Dict, Union, NoneType

import pandas as pd
import requests

def get_sa360_data(access_token: str, account_id: str, query: str, login_customer_id: Optional[Union[str, None]] = None) -> "pd.DataFrame":
"""Return SA360 data requested from the SA360 Reporting API and processed
Expand All @@ -14,6 +15,12 @@ def get_sa360_data(access_token: str, account_id: str, query: str, login_custome
report_url = _get_report_url(account_id)
headers = _get_post_request_header(access_token, login_customer_id)
data = _get_post_request_payload(query)
while True:
resp = requests.post(
report_url,
headers=headers,
data=data
)

def _get_post_request_payload(query: str, page_token: Optional[Union[str, None]] = None) -> Dict[str, Union[bool, str]]:
"""Return dictionary of POST request payload data"""
Expand Down

0 comments on commit 0612b24

Please sign in to comment.