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

Can't create proactive event due to RelevantAudienceType #21

Open
willisra opened this issue Jun 9, 2022 · 1 comment
Open

Can't create proactive event due to RelevantAudienceType #21

willisra opened this issue Jun 9, 2022 · 1 comment

Comments

@willisra
Copy link

willisra commented Jun 9, 2022

Hi,

when creating a proactive event like this:

const relevantAudience = {
	type: 'Multicast',
	payload: {}
};
const now = new Date();
const createEvent = {
	timestamp: now.toISOString(),
	referenceId: 'unique-id-of-this-instance',
	expiryTime: new Date(now.getTime() + 10000).toISOString(),
	event: event,
	localizedAttributes: [{
		locale: 'en-US',
		subject: "visit",
		providerName: "Natalia Fantini has arrived and access was granted.",
		brokerName: "Tribu"
	}],
	relevantAudience
};
const stage = 'DEVELOPMENT';

proactiveClient.createProactiveEvent(createEvent, stage);

I'm getting the following error regarding the relevant audience type.

Argument of type '{ timestamp: string; referenceId: string; expiryTime: string; event: { name: string; payload: { state: { confirmationStatus: string; }; occasion: { occasionType: string; subject: string; provider: { name: string; }; bookingTime: string; broker: { ...; }; }; }; }; localizedAttributes: { ...; }[]; relevantAudience: { ...' is not assignable to parameter of type 'CreateProactiveEventRequest'. The types of ''relevantAudience'['type']' are incompatible between these types. Type 'string' is not assignable to type 'RelevantAudienceType'.ts(2345)

I can't find a way to make this work, I have copied from the example at https://developer.amazon.com/en-US/docs/alexa/alexa-skills-kit-sdk-for-nodejs/call-alexa-service-apis-out-of-session.html Is there a chance this is a bug and string should be accepted as they show in the example?

Thanks!

@AbhiPwr
Copy link

AbhiPwr commented Sep 5, 2022

@willisra , we could not replicate the above issue on our end. As per the posted logs, it seems that you were working on some occasion event. Please post the event which you tried for the above so that we can deduce if it is event-specific.

One more thing we observed is that expiryTime parameter doesn't seem to follow the constraint specified in https://developer.amazon.com/en-US/docs/alexa/smapi/proactive-events-api.html. It should be at least 5 minutes in the future and no more than 24 hours after the current time.

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

No branches or pull requests

2 participants