05-05-2015 05:13 - edited 05-05-2015 06:17
05-05-2015 05:13 - edited 05-05-2015 06:17
Hi,
I'm a presales for software company in France. My intent is to use Fitbit notifications to demonstrate realtime streaming notifications.
I want to setup a notification system, I setuped an endpoint accessable from your servers.
I configured an application and a subcriber.
I want to perform a simple test to decided if we will use Fitbit as an information provider or should I use another connected watch.
I setuped the runscope and added some activities to my page. no notifications were sent 😞
Can you help me ?
regards,
Vitor
05-05-2015 11:10
05-05-2015 11:10
Fitbit Subscriptions API will send notifications to your web server application for any user whose resources you subscribe to.
When a user authorizes your application, you must create a subscription for that user. Documentation at https://wiki.fitbit.com/display/API/Fitbit+Subscriptions+API#FitbitSubscriptionsAPI-Addasubscription
05-05-2015 11:23
05-05-2015 11:23
Hello Jeremiah,
thanks for the reply.
added an app and an subscrition, I tested it with runscope, I updated some data in my profile.. but nothing in the runscope notification.
05-05-2015 11:28
05-05-2015 11:28
Have you tried hitting your Runscope URL with a browser or curl to verify that it is setup correctly?
05-05-2015 11:34
05-05-2015 11:34
yes with Curl
05-05-2015 11:38
05-05-2015 11:38
What's the response of this api endpoint: GET https://api.fitbit.com/1/user/-/apiSubscriptions.json ?
05-05-2015 11:41
05-05-2015 11:41
{"errors":[{"errorType":"oauth","fieldName":"n/a","message":"No Authorization header provided in the request. Each call to Fitbit API should be OAuth signed"}],"success":false}
05-05-2015 11:43 - edited 05-05-2015 11:50
05-05-2015 11:43 - edited 05-05-2015 11:50
🙂 you have to make proper API request.
the respond you pasted above means your application is not doing proper Fitbit API requests. In particular it says you don't provide Authorization header which is required to make any of Fitbit API requests.
05-05-2015 11:47
05-05-2015 11:47
ok,
But I don't want to make any request.
I just want to receive notifications. Honstly I quitte noob on the OAuth, I don't konw if I did things in the good way.
To resume what I did:
I have a simple rest POST service listening in a VM (Amazon)
I created an application
Create a temboo account and did the steeps to authentificate
I added a subcribe endpoint.
05-05-2015 11:51 - edited 05-05-2015 11:53
05-05-2015 11:51 - edited 05-05-2015 11:53
You need to make valid fitbit api requests to create subscription - this is requirement. WIthout doing it you don't have any subscriptions, you only have subscriptions endpoint that never will be hit by fitbit unless you create subscription via Fitbit API.
here is example request you have to make to create subscription:
POST https://api.fitbit.com/1/user/-/apiSubscriptions/<subscriptionIdOfYourChoice>.json
05-05-2015 12:01
05-05-2015 12:01
You can also see a history of Subscriptions notifications Fitbit has attempted to send your app by clicking on the "details" link beside your subscription URL in your app settings at dev.fitbit.com
05-05-2015 12:07
05-05-2015 12:07
Ok,
no details on the subscription.
I read the wiki, but things are quite complicated to my technical knowlodge.
Do you have any tutorial steep buy steep how to set up notification works with JAVA service ?
05-05-2015 12:10
05-05-2015 12:10
All documentation is here: https://wiki.fitbit.com/display/API/Fitbit+Subscriptions+API
I wouldn't call it the easiest thing in the world.
It will require some time to understand how it works if you never did push notification before to actually start using it.
05-05-2015 12:31
05-05-2015 12:31
Ivan,
normaly I did the OAuth with temboo. I don't have any more ideas. here.
Is there any kind of support (payable) that can help me on setting up the noitification system ?