Automate Snapchat Web API

Viewed 13

I'm trying to just create a simple event using the new snapchat web api but keep getting error 401, unauthorized.

    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
    "content-type": "application/json; charset=UTF-8",
    "authorization": #####
}

json = {
  "event_name": "WEB_PAGE_OPEN",
  "canonical_url": "web.snapchat.com",
  "query_parameters": "",
  "device_screen_width": 1536,
  "device_screen_height": 864,
  "client_ts": 1663649806.927,
  "connection_download_bandwidth_bps": 10485760,
  "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
  "locale": "en-US",
  "os_type": "WINDOWS",
  "os_version": "WINDOWS",
  "app_type": "WEB_DESKTOP",
  "app_build": "",
  "app_version": "11.95.0",
  "browser": "Chrome",
  "browser_version": "105.0.0.0",
  "domain": "web.snapchat.com",
  "referrer": "https://accounts.snapchat.com",
  "client_id": ######,
  "session_id": ####,
  "app_startup_type": "WARM",
  "user_guid": ####,
  "log_queue_name": "w",
  "log_queue_sequence_id": 51
}




r = requests.post("https://web.snapchat.com/web-analytics-v2/web/events", headers=header, json=json)

I can't find any code on the web as the snapchat web version was only released a week ago but if anyone has experience with this or know why it isn't working that would be greatly appreciated!

0 Answers
Related