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

error 403 for friend invitation

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

Best Answer
0 Votes
2 REPLIES 2

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!  

Fitbit Community ModeratorVivian | Community Moderator, Fitbit

Did this help you? Help others by marking it as a solution! 🙂

Best Answer
0 Votes

@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
0 Votes