Adobe-Marketing-Cloud / marketing-cloud-php-sdk

PHP Library for the Adobe Digital Marketing API
MIT License
35 stars 32 forks source link

Error: username and secret must be set before making a request #26

Open panand363 opened 6 years ago

panand363 commented 6 years ago

Hello, I am following the example in the readme file and getting the following error

`An uncaught Exception was encountered

Type: AdobeMarketingCloud\Auth\Exception

Message: username and secret must be set before making a request

Filename: /var/www/html/of/vendor/adobe-marketing-cloud/marketing-cloud-php-sdk/lib/AdobeMarketingCloud/Auth/Wsse.php

Line Number: 29
`

I can see the endpoint is different and following the example i have set it accordingly. Can someone please help.

Regards

Puneet

stevja1 commented 6 years ago

Make sure you're calling the authenticate() method first before calling queueReport. The authenticate() method initializes the client with your credentials. For example:

$username = 'JaredsTestUser:JaredsTestCompany';
$secret = 'keepthisasecretthisisnotreal';

$adm = new AdobeMarketingCloud\Client();
$adm->authenticate($username, $secret);
$reportApi = $adm->getReportApi();
...

Using the above code, I was able to queue a report without any trouble after replacing the $username/$secret values with my credentials.