Due to Amazon’s terribly slow “Manage Your Kindle” web interface, I’m trying to figure out how to create an application that connects to unregistered services that serve the management page. I now set which URLs and parameters to use to get the JSON data needed to perform CRUD operations, but I was stuck in not being able to successfully execute the POST data of any of the services using CURL.
The authentication seems to be a problem, but I am sending all the relevant headers and cookies that I can find. Get it anyway
HTTP/1.1 302 MovedTemporarily
Location: https://www.amazon.com/ap/signin?_encoding=UTF8&accountStatusPolicy=P1&openid.assoc_handle=usflex&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&openid.pape.max_auth_age=900&openid.return_to=https%3A%2F%2Fwww.amazon.com%2Fgp%2Fdigital%2Ffiona%2Fmanage%2Ffeatures%2Forder-history%2Fajax%2FqueryPdocs.html%3Fie%3DUTF8%26contentType%3DPersonal%2520Documents%26count%3D15%26offset%3D0
After sending this request, which should list all personal documents. Cookies were copied using Chrome Web Developer tools.
> POST /gp/digital/fiona/manage/features/order-history/ajax/queryPdocs.html HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
> Host: www.amazon.com
> Accept: */*
> Cookie: session-token=8tAmbclc1/ZjtWU8o5VXyU5H8s0/Yiy346W1/Nx4Sz2BzTUWUR9lkwDABzzgRW1lwZUqcu8MqhGzbby2Xg9RA8Y0cwpLRDk5sf6eXUwNQBvZAcgEXsHG8Bj+24q2C1MZ9v5hFrzBNr6pDP+9CYXrMl2WaEVzmvd/sBO69jk5o3mK3PJf1leY6YhLAL3W8dVj89O+ebIoaPvLHP7naDpImbqaa5bwGS4ki+AzJDLAHs5UMwQkiuXoUCnukz1+WqCr0rHhKoPkI17WGm6MrRDs9/PC2ll7+qDU13; session-id=184-5755217-1234567; session-id-time=2082787201l
> Content-Length: 48
> Content-Type: application/x-www-form-urlencoded
(Yes, I changed my session token and session ID before posting this online: p)
I use the following call in the CLI and save the cookies in cookie3.txt
curl -v --cookie cookie3.txt --data 'offset=0&count=15&contentType=Personal+Documents' 'https://www.amazon.com/gp/digital/fiona/manage/features/order-history/ajax/queryPdocs.html'
Think what I'm missing here to make it work?
source
share