question

newuser-20a49ae2-c8d2-4ad7-a6f9-21e2a92bd893 avatar image
newuser-20a49ae2-c8d2-4ad7-a6f9-21e2a92bd893 asked ·

Can't get an email address (UpsServiceClient)

I want to obtain the email addresses of my Alexa Skill users.

I implemented it in Python by referring to the following URL, but I get the following error.

How can I get the email address?


[URL]

https://forums.developer.amazon.com/questions/212172/alexa-customer-contact-information-access-denied-i.html


[Erro message]

get_profile_email() takes 1 positional argument but 2 were given


[Source]

device_id = handler_input.request_envelope.context.system.device.device_id
print(device_id)

user_preferences_client = handler_input.service_client_factory.get_ups_service()
print(user_preferences_client)

# OK -> Fetch Preferred Distance Units From Alexa Settings API
preferred_distance_units = user_preferences_client.get_system_distance_units(device_id).value
print (preferred_distance_units) # String of either "IMPERIAL" or "METRIC"

# OK -> Fetch Preferred Temperature Units From Alexa Settings API
preferred_temperature_units = user_preferences_client.get_system_temperature_unit(device_id).value
print (preferred_temperature_units) # String of either "FAHRENHEIT" or "CELSIUS"

# OK -> Fetch Device's Current Configured Time Zone From Alexa Settings API
time_zone = user_preferences_client.get_system_time_zone(device_id)
print (time_zone) # String representing a time zone for example "America/Los_Angeles"

# NG 
user_email = user_preferences_client.get_profile_email(device_id).value 
print(user_email) 
alexa skills kitlambdapython
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Gaetano@Amazon avatar image
Gaetano@Amazon answered ·

Hello and thanks for posting.

Are all the other information being retrieved without any issues? Can you share the skill-ID please?

Regards,
Gaetano

1 comment
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi Gaetano,


My skill-ID is "amzn1.ask.skill.c541d3ce-4f77-4680-ad60-dd1fe1561e05"


Thank you for your cooperation and support.

0 Likes 0 ·