Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SponsoredDisplaySnapshotOperation not working as expected #921

Closed
sravya-yelleti opened this issue Feb 7, 2022 · 10 comments · Fixed by #927
Closed

SponsoredDisplaySnapshotOperation not working as expected #921

sravya-yelleti opened this issue Feb 7, 2022 · 10 comments · Fixed by #927
Assignees
Labels

Comments

@sravya-yelleti
Copy link
Contributor

getting this error
body: '"ops is not a constructor"'

@moltar
Copy link
Contributor

moltar commented Feb 7, 2022

Which file, line?

@sravya-yelleti
Copy link
Contributor Author

src/operations/snapshots/sponsored-display-snapshot-operation.ts

@moltar
Copy link
Contributor

moltar commented Feb 7, 2022

@nguyentoanit please take a look tomorrow

@nguyentoanit
Copy link
Collaborator

@sravya-yelleti : It looks like a compile error from your site.
And I couldn't reproduce your error here.

We can request to sandbox API and get GenericError: Internal Server Error.

Could you please give me your sample code?

@sravya-yelleti
Copy link
Contributor Author

sravya-yelleti commented Feb 8, 2022

I added the sponsored-display-snapshot-operation.ts because it was not there before.
I think (#923) might fix it. please let me know if I missed anything.

@sravya-yelleti
Copy link
Contributor Author

i'm still getting the same error "ops is not a constructor" for
snapshotOperation = operationProvider.create(SponsoredDisplaySnapshotOperation);
SponsoredProductsSnapshotOperation is working as expected in the same code

@sravya-yelleti
Copy link
Contributor Author

please let me know if i should make any changes

@sravya-yelleti
Copy link
Contributor Author

sravya-yelleti commented Feb 10, 2022

I have been facing the same error when I try to create Sponsored Display Snapshot request: “ops is not a constructor”

Here is the sample code:

const {
SponsoredDisplaySnapshotOperation
} = require('@scaleleap/amazon-advertising-api-sdk');
let operationProvider = await amazonApiSdk.GetOperationProvider(secretName);
const profileOperation = operationProvider.create(ProfileOperation);
apiProfiles = await profileOperation.listProfiles();

apiProfiles.forEach(profile => {
operationProvider.client.auth.scope = profile.profileId;
snapshotOperation = operationProvider.create(SponsoredDisplaySnapshotOperation);
//getting error here
response = await snapshotOperation.requestSnapshot(campaigns, {
"stateFilter": "enabled,paused,archived"
});
reportId = response.snapshotId;
});

The same code is working fine for SponsoredProductsSnapshotOperation

@nguyentoanit
Copy link
Collaborator

@sravya-yelleti : this should be resolved after we merge PR #927. 👍

@github-actions
Copy link

🎉 This issue has been resolved in version 3.3.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants