0

I am using BitBucket's PHP Lib to create a repository:

$repo = new \Bitbucket\API\Repositories\Repository();
$repo->setCredentials( new \Bitbucket\API\Authentication\Basic( $this->username, $this->password ) );
$slug = self::generateSlug( $domainName );
return $repo->create( $this->username, $slug, array(
    'name'              => $domainName,
    'scm'               => 'git',
    'description'       => "Project: {$domainName}",
    'language'          => 'php',
    'is_private'        => true,
    'forking_policy'    => 'no_public_forks',
));

But all I am getting back is 'NoneType' object has no attribute 'pk'

Has anyone come across this before?

Regards

Luke Snowden
  • 4,056
  • 2
  • 37
  • 70

1 Answers1

0

Yes - seeing this today. We started getting that if the username had an underscore in int. I'm wondering if it's an API bug that they've just rolled out. It does appear you can use the 1.0 API like this:

curl -X POST -v -H "Content-Type: application/x-www-form-urlencoded" https://USERNAME:PASSWORD@api.bitbucket.org/1.0/repositories/ -d 'name=scott&scm=git'