question

newuser-eac05702-1f93-4198-9d70-3d836767d200 avatar image

Reminders API - Out of session help

Hi:

I need help and perhaps clarification.

Based on a very simple skill (think hello world) I need to be able to push reminders using a tool like postman (assuming is possible).

I've been following tutorials and so far I have been able to obtain a token using https://api.amazon.com/auth/o2/token

{

"access_token": "Atc|tokendatahere",

"scope": "alexa:skill_messaging",

"token_type": "bearer",

"expires_in": 3600

}


With the token I try to use https://api.amazonalexa.com/v1/alerts/reminders to post a new reminder using a body like:


{

"requestTime" : "2020-06-22T16:34:00.672",

"trigger": {

"type" : "SCHEDULED_ABSOLUTE",

"scheduledTime" : "2020-06-22T17:00:00.000",

"timeZoneId" : "America/Chicago",

"recurrence" : {

"startDateTime": "2020-06-22T7:00:00.000",

"endDateTime" : "2020-06-23T10:00:00.000",

"recurrenceRules" : [

"FREQ=DAILY;BYHOUR=6;BYMINUTE=10;BYSECOND=0;INTERVAL=1;",

"FREQ=DAILY;BYHOUR=17;BYMINUTE=15;BYSECOND=0;INTERVAL=1;",

"FREQ=DAILY;BYHOUR=22;BYMINUTE=45;BYSECOND=0;INTERVAL=1;"

]

}

},

"alertInfo": {

"spokenInfo": {

"content": [{

"locale": "en-US",

"text": "walk the cow",

"ssml": "<speak> walk the cow</speak>"

}]

}

},

"pushNotification" : {

"status" : "ENABLED"

}

}


However I keep getting an error 400 with the following response.

{

"code": "MISSING_CUSTOMER_ID",

"message": "customerId must be provided"

}

What am I missing?

Skill ID is amzn1.ask.skill.9a9cce81-838f-400e-a15a-a3db49dcac2b


Gracias,

Edgar

reminders
10 |3000 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.

newuser-b12b824a-8dab-4a35-8df0-d8930acdc51a avatar image
newuser-b12b824a-8dab-4a35-8df0-d8930acdc51a answered

The same issue.

10 |3000 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.

GranGran avatar image
GranGran answered

You are getting that due to using the wrong type of access_token. The documentation is really not that helpful for figuring this out, and I haven't quite mastered it, but I can say that you need an in-session token to create reminders. It is quite a long token at ~2600 characters.


I noticed that at least this endpoint doesn't give particularly consistent responses for errors. I accidentally copied and pasted some other text at the end of my key and go this same "MISSING_CUSTOMER_ID" error instead of a 401 unauthorized error I would have expected.

10 |3000 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.