Printing Single Page Applications
Ran into a problem tonight: I needed to print a Single Page Application (SPA), but Chrome and Firefox couldn't handle it—they'd only print the first page, even though the content was clearly longer.
The solution? Use Safari's Reader mode. Here's what you do:
- Open the SPA in Safari (Firefox and Chrome don't have this feature)
- Click the Reader mode button in the address bar (looks like lines of text)
- Hit print
That's it. Safari's Reader mode extracts the actual content from the SPA and renders it in a print-friendly format. Works like magic.
E*TRADE API Issue: 500 Error on Order Preview
Spent some time tonight creating a bug report for E*TRADE because their API wasn't working. The OAuth handshake completed successfully, but the order preview endpoint kept returning a 500 error.
OAuth Handshake (Working)
The OAuth flow worked fine:
- Request Token:
https://api.etrade.com/oauth/request_tokenreturned successfully withoauth_tokenandoauth_token_secret - Authorization: Redirected to
https://us.etrade.com/e/t/etws/authorizewith the consumer key (starting withd4) and token - Access Token: Obtained successfully
Order Preview Endpoint (Failing)
But when calling the order preview endpoint:
URL: https://api.etrade.com/v1/accounts/Y_MC68E4n1LeYlNI_8ajiQ/orders/preview
Request Body:
{
"PreviewOrderRequest": {
"orderType": "EQ",
"clientOrderId": "aapl-buy-1769300656681",
"Order": [{
"allOrNone": false,
"priceType": "LIMIT",
"orderTerm": "GOOD_FOR_DAY",
"marketSession": "REGULAR",
"Instrument": [{
"Product": {
"securityType": "EQ",
"symbol": "AAPL"
},
"orderAction": "BUY",
"quantityType": "QUANTITY",
"quantity": 1
}],
"limitPrice": 10
}]
}
}
Response: HTTP 500
Response Body:
<Error>
<code>100</code>
<message>The requested service is not currently available, please try after sometime.</message>
</Error>
X-ET-Trace Header: 587068fcb78684b2fc24ed217cacbe1c
Summary
The OAuth authentication is working correctly—the issue is on E*TRADE's side. The order preview endpoint is returning a 500 error with code 100, indicating their service is temporarily unavailable. The trace ID should help their support team debug the issue.
If you're hitting the same problem, make sure your OAuth headers are correct and include the trace ID when reporting the issue to E*TRADE support.
Enjoyed this post?
Get notified when I publish something new. No spam, unsubscribe anytime.