API – 301 Moved Permanently

Resolved
10 posts

I tried the node.js example from the sandbox page.
(https://apm.fidor.de/developer/apps)

The example crash here on line 66…
var token_request = http.request(postOptions, function (res) {
...
undefined:1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
^
SyntaxError: Unexpected token <
at Object.parse (native)

The respond is:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved here.</
p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at aps.fidor.de Port 80</address>
</body></html>

What is the current url for the token oauth service?

best regards
jsx

Hi jsx, the node implementation was using http instead of https (node requires including different modules) I’m currently working on a fix in the official sample code. For the time being you can just change the line 66 to get the example to work:

Change:

var token_request = http.request(postOptions, function (res) {

To:

var https = require("https")
var token_request = https.request(postOptions, function (res) {

thanks it works,
but there are no transactions-data in the sandbox mode.

anyway, thanks for your help.

I’ll see what I can do 🙂 What’s your app / user?

alfons_1033@fidortecs.de it would be nice if can give some test data for this user.
thanks and have nice weekend.

jsx

There should be some transactions in the transaction table now.

i can’t confirm it.

The result is still:
`
{"data":[],"collection":{"per_page":10,"current_page":1,"current_entries":0,"total_entries":0,"total_pages":1}}
</code>
@ https://aps.fidor.de/transactions?access_token=xxx
`

Can the client id help you?
Client ID: b8ddad3ab565f61c

  • This reply was modified 2 years, 5 months ago by  JSX.RED.

Sorry, one last try, it should (definitely 🙂 )work now

  • This reply was modified 2 years, 5 months ago by  Tim Becker.

ok, now i can confirm it :)).
thanks for your support i will publish my first app soon!

Hi,

I downloaded the nodejs Starter kid from the sandbox page and I also get the “301 Moved Permanently” for the token request.

I read through all forum entries and it seems that the problem that what mentioned here in thread is already fixed in the starter kid. I can see that the protocol for the post request is https but still I get the 301 …

I also looked into the code on github and ran the node.js example from there, but the same result (seems that commit 23a236278fe7157dc7543da681d1d610c2adfef8 addresses the issue discussed here) …

Am I missing something?

Cheers,
Martin

You must be logged in to reply in this thread.