Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"Invalid parameter subscriberId: null" while creating an apiSubscription

ANSWERED

I am trying to create an apiSubscription, using the docs here: https://wiki.fitbit.com/display/API/Fitbit+Subscriptions+API

 

I have created a default subscription endpoint in the app management page. 

 

Using the API Debug tool, here: https://dev.fitbit.com/apps/oauthtutorialpage I enter an access token, access token secret, this url: https://api.fitbit.com/1/user/-/apiSubscriptions/1.json, a nonce, refesh the typestamp, and change the type to POST. When I execute the generated request (both on my command line, and through Hurl), I get the following response:

 

{"errors": [{"errorType": "validation","fieldName": "subscriberId","message": "Invalid parameter subscriberId: null"}]}

 

Any help would be appreciated.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Can you please verify that the consumer key you making request with has is the same one that is on application you added the subscription endpoint.

Ivan Bahdanau
Senior Software Developer at Fitbit

View best answer in original post

Best Answer
0 Votes
15 REPLIES 15

Are you passing X-Fitbit-Subscriber-Id header parameter?

If yes, please check that the id is the same as you have it on app management page.

If you don't pass X-Fitbit-Subscriber-Id the api call will automatically subscribe to the default subscriber.

Also try not to pass X-Fitbit-Subscriber-Id parameter and see if it's helps.

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes

I am not adding that header. I am using the debug tool here: https://dev.fitbit.com/apps/oauthtutorialpage to generate the request.

Best Answer
0 Votes

Can you please verify that the consumer key you making request with has is the same one that is on application you added the subscription endpoint.

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes

PM to me the id of your app:
https://dev.fitbit.com/apps/edit/<YOUR ID HERE>

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes

Thank you. The problem was, as you suggested, I was using the wrong Consumer Key. 100% my fault. I'll go wash the egg off my face now...

Best Answer
0 Votes

I have the same problem and I verified that am using the same key and secret . 

Best Answer
0 Votes

@hybridTech wrote:

I have the same problem and I verified that am using the same key and secret . 


Please share the HTTP request you're making (obscuring your app secrets) and the response you're receiving.

Best Answer
0 Votes

Hi,

I'm sending this request:

POST /1/user/-/apiSubscriptions/user1.json

and I'm getting:

"message": "Invalid parameter subscriberId: null

From what I've read in the API doc the default subscriber should be automatically used, but it seems like this doesn't work for me.

Thanks,

Lior

Best Answer
0 Votes
Best Answer
0 Votes

Yes, I did

Verified at / Verification codeStats

1
https://***/fitbit/webHook
2017-01-30T15:04:15.000Z
No Stats Available
Best Answer
0 Votes

@LiorSharecare Are you passing the X-Fitbit-Subscriber-Id header parameter? If you're not, try doing that and specify 1 for subscriberId.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

Yes, I've tried this as well and it returns:

      "message": "Invalid parameter subscriberId: 1"
Best Answer
0 Votes

@LiorSharecare Okay thanks, just wanted to check. Can you PM your client ID to me?

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

Once I got the authentication process straight, it worked fine. thanks!

Best Answer

@AndrewFitbit @LiorSharecare  I have the exact same problem. Could you please describe how you solved it?

 

Thank you,

S

Best Answer