I am upgrading my apex code in salesforce for the new version of Klaviyo Api. But when I am trying to run the code authorisation is failing for some reasons. When I use this syntax: req.setHeader('Authorization', 'Klaviyo-API-Key “My Api Key Hardcoded”');,
I am getting the response but i dont want hardcoded value to give here. while trying this syntax i am getting the error 400 :
req.setHeader('Authorization','klaviyo_api_key '+ defaults.ApiKey__c);.
Can someone please give me a solution to this.Its urgent.