[text] K

Viewer

  1. import requests
  2.  
  3. # URL for the "Create a new report" action
  4. create_report_url = 'https://toolkit.tesco.com/partner/reports/create'
  5.  
  6. # Parameters and headers, if needed
  7. params = {'report_type': 'new', 'format': 'csv'}
  8. headers = {'Authorization': 'Bearer your_access_token'}
  9.  
  10. # Perform POST request to create a new report
  11. response = requests.post(create_report_url, params=params, headers=headers)
  12.  
  13. # Check if request was successful
  14. if response.status_code == 200:
  15.     # Process the response content if needed
  16.     # For example, you can parse JSON content using response.json()
  17.     # json_data = response.json()
  18.     
  19.     print("Successfully created a new report.")
  20. else:
  21.     print("Failed to create a new report. Status code:", response.status_code)

Editor

You can edit this paste and save as new:


File Description
  • K
  • Paste Code
  • 23 Apr-2024
  • 767 Bytes
You can Share it: