Issues with connecting to Snapchat Marketing API

122 Views Asked by At

I’m trying to connect to Snapchat Marketing API but keep getting <Respone [401]> error, can I anyone spot the issues in my Python code?

import requests

token = "abc" #token generated from Conversions API Tokens in Snapchat Business Account

authorization = f'Bearer {token}'

headers = {"Authorization": authorization}

r = requests.get ('https://adsapi.snapchat.com/v1/me', headers=headers)

print(r)
1

There are 1 best solutions below

0
SCallan On

It looks like your parameters are incorrect for "authorization". Check your parenthesis and quotation marks.