04-28-2016 12:32
04-28-2016 12:32
Hello,
I am able to get the response from the Fitbit API and even send an email to myself with the content of the request stream.
When I try to save this data to the database I see an error 500 in the Subscriber end point details page.
If I execute the same code using Postman it works. If I run the application locally and mock the data that is being posted it also works.
Does anyone have any ideas about what this could be?
Josh
04-28-2016 14:13
04-28-2016 14:13
Just to clarify: the subscriber details page says that your application returned a 500 error? If so, have you tried using Postman to immitate a Fitbit Subscriptions API notification request to your app in whatever environment you're seeing the 500? A 500 error would mean that your application failed to do something, which isn't something we can fix for you.
You could put Runscope Traffic Inspector between your app and the Fitbit Subscriptions API. Information is at https://dev.fitbit.com/docs/subscriptions-debugging/ . This will allow you to see the exact HTTP request sent by Fitbit and your applications exact HTTP response.
04-28-2016 14:24
04-28-2016 14:24
I did use postman to immitate the notification request. I will try to use runscope. I will post back what I find.
04-28-2016 14:30
04-28-2016 14:30
I see an error 500 in runscope but I don't see a reason. I just see the page returning.
04-28-2016 15:16 - edited 04-28-2016 15:17
04-28-2016 15:16 - edited 04-28-2016 15:17
So this confirms that your application is returning the 500 error to Fitbit. You'll need to debug your app's code to determine why it is returning a 500.
You can use Runscope's "replay" feature to retry the request to your application. It is easier than waiting for a new subscription notification from Fitbit.
04-28-2016 15:38
04-28-2016 15:38
I found my problem. I am using the XML file as the return type and I had a case problem with the element names. When I emailed myself the document. the source of the email was all lower case and thus the problem.
Now I have it working on my side and everything is perfect. Yet when I log into the endpoint details I now am getting "SocketTimeoutException".
What do you think is causing that?
Josh
04-28-2016 17:29
04-28-2016 17:29
This means that your subscriber endpoint is taking longer than 3 seconds to close the connection and Fitbit aborted the request.
Your app needs to close the connection as soon as it receives the data. Your application should process the data received after closing the connection. If your programming language or framework cannot close the connection before processing the received data, your app will need to have a way to asynchronously process the data.