11-10-2014 03:36
11-10-2014 03:36
I'm using the following php code to send a friend request
$apiCall = 'https://api.fitbit.com/1'; $client = new Client($apiCall); $oauth = new OauthPlugin(array( 'consumer_key' => $conskey, 'consumer_secret' => $conssec, 'token' => $apis->getToken(), 'token_secret' => $apis->getTokenSecret() )); $result=$client->addSubscriber($oauth); // /1/user/-/friends/invitations.xml $send=$result->post('user/-/friends/invitations.xml',null , array('invitedUserId' => $friendid)); $data = $send->send();
but I get the error -
Client error response
[status code] 403
[reason phrase] Forbidden
[url] https://api.fitbit.com/1/user/-/friends/invitations.xml
06-10-2015 15:50
Community Moderator Alumni are previous members of the Moderation Team, which ensures conversations are friendly, factual, and on-topic. Moderators are here to answer questions, escalate bugs, and make sure your voice is heard by the larger Fitbit team. Learn more
06-10-2015 15:50
Thank you for your participation in the Community @Gavino! Can please be so kind to clarify a bit the inconvenience you're having.
Looking forward to your reply!
Best Answer06-10-2015 16:01
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
06-10-2015 16:01
@Gavino: Could you please post the actual HTTP request that you're making? If your HTTP client doesn't have verbose logging, you could use a tool like http://requestb.in/
Best Answer