Login   Register  
PHP Classes
elePHPant
Icontem

Bitbucket OAuth POST implementation

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      PHP OAuth API  >  All threads  >  Bitbucket OAuth POST implementation  >  (Un) Subscribe thread alerts  
Subject:Bitbucket OAuth POST implementation
Summary:When using POST request, url_parameters must be set to FALSE.
Messages:3
Author:Jozef Spisiak
Date:2013-04-24 10:09:01
Update:2013-04-25 10:03:35
 

  1. Bitbucket OAuth POST implementation   Reply   Report abuse  
Picture of Jozef Spisiak
Jozef Spisiak
2013-04-24 10:09:01
Hi Manuel.

First thank you for this library. OAuth implementation is piece of cake with it. Lately I have been implementing Bitbucket API integration and got stuck on trying to POST new repository. After been unsuccessful for 2 days, I debugged the issue and found out that url_parameters needs to be set to false, when trying to POST data in this case. I am not sure if it is quirk of bitbucket only, however it should be easy to fix in the library. Now I am able to finish this integration without problems.

Thanks again
Jozef

  2. Re: Bitbucket OAuth POST implementation   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2013-04-24 20:29:41 - In reply to message 1 from Jozef Spisiak
It's possible. I am not familiar with the whole BitBucket API.

Can you give me a API call example that requires to set the parameters in the URL?

  3. Re: Bitbucket OAuth POST implementation   Reply   Report abuse  
Picture of Jozef Spisiak
Jozef Spisiak
2013-04-25 10:03:35 - In reply to message 2 from Manuel Lemos
Yes. Here are 2 API calls, which work for me, when oauth_client_class is initialized for Bitbucket:
$success = $client->CallAPI(
'https://api.bitbucket.org/1.0/user',
'GET',
array(),
array('FailOnAccessError'=>true),
$user);

$client->url_parameters = FALSE;
$success = $client->CallAPI(
'https://api.bitbucket.org/1.0/repositories',
'POST',
array('name' => 'testRepository'),
array('FailOnAccessError'=>true),
$repository
);

And here is link to bitbucket help regarding posting new repository: https://confluence.atlassian.com/display/BITBUCKET/repository+Resource#repositoryResource-POSTanewrepository