I am trying to create a subscription by sending the following request:
POST https://api.fitbit.com/1/user/-/activities/apiSubscriptions/1.json
But I keep getting the following error:
Error: read ECONNRESET
Network
Request Headers
content-length: 10000000
X-Fitbit-Subscriber-Id: fitbit-subscription-handler
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyMzk5WUQiLCJzdWIiOiI4UTJLOFYiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJzY29wZXMiOiJyZWNnIHJzZXQgcm94eSBybnV0IHJwcm8gcnNsZSByY2YgcmFjdCBycmVzIHJ3ZWkgcmhyIHJ0ZW0iLCJleHAiOjE2NzU0MTgxMzYsImlhdCI6MTY3NTM4OTMzNn0.-_307-4K00hU9fdcN86G0GcONpIYMmyxr8co5dZdaHE
User-Agent: PostmanRuntime/7.30.0
Accept: */*
Cache-Control: no-cache
Postman-Token: d3f2cf54-8d4c-4d81-92e0-5cc2608b5bdb
Host: api.fitbit.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
According to Fitbit's official documentation, the content-length
header is required as shown in the image:
Simply removing this required header fixes the issue.