From 8651090013477b9b53c6cd2a5bbc731c125762ab Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 5 Sep 2026 08:46:55 +0000 Subject: [PATCH] fix: replace broken customer-history-records-v2 endpoint with new GET endpoint Amazon removed the v2 POST endpoint for voice history. Switch to the current GET endpoint /alexa-privacy/apd/rvh/customer-history-records with recordType parameter instead of pageType. Fixes -lastalexa and -lastcommand (issue #188). Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_015a9UxV6q6eG4bpn3JH3PJX --- alexa_remote_control.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/alexa_remote_control.sh b/alexa_remote_control.sh index fb9ce83..1b70849 100755 --- a/alexa_remote_control.sh +++ b/alexa_remote_control.sh @@ -86,8 +86,9 @@ # 2024-02-01: v0.21b changed the output of -lastalexa back to the output of devicelist.txt # 2024-04-06: v0.22 changed the date calculation once again, now the date processing ignores the actual cookie validity # and simply sets it to "now + COOKIE_LIFETIME" -# 2025-11-07: v0.23 /api/bootstrap is gone, switched to /api/customer-status +# 2025-11-07: v0.23 /api/bootstrap is gone, switched to /api/customer-status # (thanks once again to Ingo Fischer) +# 2026-09-05: v0.24 customer-history-records-v2 (POST) replaced by customer-history-records (GET) # ### # @@ -1137,8 +1138,8 @@ get_history() RES=$(${CURL} ${OPTS} -s -b ${COOKIE} -A "${BROWSER}" -H "DNT: 1" -H "Connection: keep-alive" -L -w "%{http_code}" \ -H "Content-Type: application/json; charset=UTF-8" -H "anti-csrftoken-a2z: $(cat ${TMP}/.alexa.activity.csrf)" \ - -H "csrf: $(awk "\$0 ~/.${AMAZON}.*csrf[ \\s\\t]+/ {print \$7}" ${COOKIE})" -X POST -d '{"previousRequestToken": null}'\ - "https://www.${AMAZON}/alexa-privacy/apd/rvh/customer-history-records-v2/?startTime=0&endTime=2147483647000&pageType=VOICE_HISTORY" -o ${TMP}/.alexa.activity.json) + -H "csrf: $(awk "\$0 ~/.${AMAZON}.*csrf[ \\s\\t]+/ {print \$7}" ${COOKIE})" -X GET \ + "https://www.${AMAZON}/alexa-privacy/apd/rvh/customer-history-records?startTime=0&endTime=2147483647000&recordType=VOICE_HISTORY&maxRecordSize=50" -o ${TMP}/.alexa.activity.json) # try again in case CSRF timed out if [ $RES -ne 200 ] ; then