Hello, I successfully made an API call from Postman using my API key to the campaign API. However if I try the same with Python I get the following error. What am I missing please?
{"errors"::{"id":"b2bd6ac7-312f-457a-99db-e740f73db593","status":401,"code":"not_authenticated","title":"Authentication credentials were not provided.","detail":"Missing or invalid authorization scheme. Please use Klaviyo-API-Key.","source":{"pointer":"/data/"}}]}
Python Code
import requests
url = "https://a.klaviyo.com/api/campaigns?filter=equals(messages.channel,'email')"
headers = {
'Authorization': 'Klaviyo-API-Key pk_………….',
'revision': '2023-12-15'
}
response = requests.request("GET", url, headers=headers)