PHPackages                             mradionov/phonegap-build-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mradionov/phonegap-build-api

ActiveLibrary[API Development](/categories/api)

mradionov/phonegap-build-api
============================

PHP library to interact with Phonegap Build API

0.2.1(6y ago)71.8k5MITPHP

Since Nov 25Pushed 6y ago3 watchersCompare

[ Source](https://github.com/mradionov/phonegap-build-api)[ Packagist](https://packagist.org/packages/mradionov/phonegap-build-api)[ RSS](/packages/mradionov-phonegap-build-api/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (5)Used By (0)

Phonegap Build API - PHP
========================

[](#phonegap-build-api---php)

> PHP library to interact with Phonegap Build API

Support
-------

[](#support)

The latest version of *Cordova (Phonegap)* for the time when library was developed - **3.1.0**. Contains all methods that are presented in this version of *API*. Anyways, it has to work with the latest versions of *Cordova (Phonegap)* 5+.

OS support: *iOS*, *Android*.

**Requires CURL *PHP* extension** to be installed and enabled, it will trigger a *PHP* error otherwise.

Install
-------

[](#install)

Install via [Composer](https://getcomposer.org) from command line:

```
$ composer require mradionov/phonegap-build-api
```

---

**or** add it to `composer.json`:

```
{
  "require": {
    "mradionov/phonegap-build-api": "^0.1.0"
  }
}
```

and run

```
$ composer install
```

Use
---

[](#use)

`PhonegapBuildApi` constructor accepts two arguments, second is optional. If only one argument is provided, then it has to be authentication token. If two - username and password. Otherwise, you can always provide auth params later using public methods `setToken()` and `setCredentials()`. There is also a static `factory` method to use API in a different way:

```
use PhonegapBuildApi;

// Use token

$api = new PhonegapBuildApi('authentication_token');

// Use username and password

$api = new PhonegapBuildApi('email@example.com', 'password');

// Set auth options after init

$api = new PhonegapBuildApi();

$api->setToken('authentication_token');
$api->setCredentials('email@example.com', 'password');

// Use factory

$res = PhonegapBuildApi::factory('email@example.com', 'password')->getProfile();
```

**Note**: Authentication token mentioned above is taken from Phonegap Build account -&gt; "Edit account" page -&gt; "Authentication token" section.

To use access token from OAuth2 flow use a method setAccessToken():

```
use PhonegapBuildApi;

$api = new PhonegapBuildApi();

$api->setAccessToken('d4f5g6');
```

#### Handle response

[](#handle-response)

Each API method returns response as associative array created from JSON (if successful). You can use method `success()` to check whether or not last request was successful. You can use method `error()` to get error message, if request failed.

```
$res = $api->getProfile();

if ($api->success()) {

  var_dump($res['email']); // 'email@example.com'

} else {

  var_dump($api->error()); // 'Invalid email or password.'

}
```

API
---

[](#api)

##### GET /api/v1/me ([docs](http://docs.build.phonegap.com/en_US/developer_api_read.md.html#_get_https_build_phonegap_com_api_v1_me))

[](#get-apiv1me-docs)

```
$res = $api->getProfile();
```

##### GET /api/v1/apps ([docs](http://docs.build.phonegap.com/en_US/developer_api_read.md.html#_get_https_build_phonegap_com_api_v1_apps))

[](#get-apiv1apps-docs)

```
$res = $api->getApplications();
```

##### GET /api/v1/apps/:id ([docs](http://docs.build.phonegap.com/en_US/developer_api_read.md.html#_get_https_build_phonegap_com_api_v1_apps_id))

[](#get-apiv1appsid-docs)

```
$res = $api->getApplication(5);
```

##### GET /api/v1/apps/:id/icon ([docs](http://docs.build.phonegap.com/en_US/developer_api_read.md.html#_get_https_build_phonegap_com_api_v1_apps_id_icon))

[](#get-apiv1appsidicon-docs)

```
$res = $api->getApplicationIcon(5);
```

##### GET /api/v1/apps/:id/:platform ([docs](http://docs.build.phonegap.com/en_US/developer_api_read.md.html#_get_https_build_phonegap_com_api_v1_apps_id_platform))

[](#get-apiv1appsidplatform-docs)

```
$res = $api->downloadApplicationPlatform(5, PhonegapBuildApi::IOS);
$res = $api->downloadApplicationPlatform(5, PhonegapBuildApi::ANDROID);
```

##### GET /api/v1/keys ([docs](http://docs.build.phonegap.com/en_US/developer_api_read.md.html#_get_https_build_phonegap_com_api_v1_keys))

[](#get-apiv1keys-docs)

```
$res = $api->getKeys();
```

##### GET /api/v1/keys/:platform ([docs](http://docs.build.phonegap.com/en_US/developer_api_read.md.html#_get_https_build_phonegap_com_api_v1_keys_platform))

[](#get-apiv1keysplatform-docs)

```
$res = $api->getKeysPlatform(PhonegapBuildApi::IOS);
$res = $api->getKeysPlatform(PhonegapBuildApi::ANDROID);
```

##### GET /api/v1/keys/:platform/:id ([docs](http://docs.build.phonegap.com/en_US/developer_api_read.md.html#_get_https_build_phonegap_com_api_v1_keys_platform_id))

[](#get-apiv1keysplatformid-docs)

```
$res = $api->getKeyPlatform(PhonegapBuildApi::IOS, 3);
$res = $api->getKeyPlatform(PhonegapBuildApi::ANDROID, 3);
```

##### POST /api/v1/apps ([docs](http://docs.build.phonegap.com/en_US/developer_api_write.md.html#_post_https_build_phonegap_com_api_v1_apps))

[](#post-apiv1apps-docs)

```
$res = $api->createApplication(array(
  'title' => 'Phonegap Application',
  'package' => 'com.phonegap.www',
  'version' => '0.0.1',
  'description' => 'Phonegap Application Description',
  'debug' => false,
  'keys' => array(
    'ios' => array(
      'id' => 3,
      'password' => 'key_password'
    ),
  ),
  'private' => true,
  'phonegap_version' => '3.1.0',
  'hydrates' => false,
  // better use methods below or see docs for all options
));
```

From remote repo (preferable):

```
$res = $api->createApplicationFromRepo('https://github.com/phonegap/phonegap-start', array(
  'title' => 'Phonegap Application',
  // see docs for all options
));
```

From file (preferable):

```
$res = $api->createApplicationFromFile('/path/to/archive.zip', array(
  'title' => 'Phonegap Application',
  // see docs for all options
));
```

##### PUT /api/v1/apps/:id ([docs](http://docs.build.phonegap.com/en_US/developer_api_write.md.html#_put_https_build_phonegap_com_api_v1_apps_id))

[](#put-apiv1appsid-docs)

```
$res = $api->updateApplication(5, array(
  'title' => 'Phonegap Application',
  // better use methods below or see docs for all options
));
```

From remote repo (preferable):

```
$res = $api->updateApplicationFromRepo(5, array(
  'title' => 'Phonegap Application',
  // see docs for all options
));
```

From file (preferable):

```
$res = $api->updateApplicationFromFile(5, '/path/to/archive.zip', array(
  'title' => 'Phonegap Application',
  // see docs for all options
));
```

##### POST /api/v1/apps/:id/icon ([docs](http://docs.build.phonegap.com/en_US/developer_api_write.md.html#_post_https_build_phonegap_com_api_v1_apps_id_icon))

[](#post-apiv1appsidicon-docs)

```
$res = $api->updateApplicationIcon(5, '/path/to/icon.png');
```

##### POST /api/v1/apps/:id/build ([docs](http://docs.build.phonegap.com/en_US/developer_api_write.md.html#_post_https_build_phonegap_com_api_v1_apps_id_build))

[](#post-apiv1appsidbuild-docs)

```
$res = $api->buildApplication(5, array(
  PhonegapBuildApi::IOS, PhonegapBuildApi::ANDROID
));
```

##### POST /api/v1/apps/:id/build/:platform ([docs](http://docs.build.phonegap.com/en_US/developer_api_write.md.html#_post_https_build_phonegap_com_api_v1_apps_id_build_platform))

[](#post-apiv1appsidbuildplatform-docs)

```
$res = $api->buildApplicationPlatform(5, PhonegapBuildApi::IOS);
$res = $api->buildApplicationPlatform(5, PhonegapBuildApi::ANDROID);
```

##### POST /api/v1/apps/:id/collaborators ([docs](http://docs.build.phonegap.com/en_US/developer_api_write.md.html#_post_https_build_phonegap_com_api_v1_apps_id_collaborators))

[](#post-apiv1appsidcollaborators-docs)

```
$res = $api->addCollaborator(5, array(
  'email' => 'collab@example.com',
  'role' => PhonegapBuildApi::ROLE_TESTER, // PhonegapBuildApi::ROLE_DEV
  // see docs for all options
));
```

##### PUT /api/v1/apps/:id/collaborators/:id ([docs](http://docs.build.phonegap.com/en_US/developer_api_write.md.html#_put_https_build_phonegap_com_api_v1_apps_id_collaborators_id))

[](#put-apiv1appsidcollaboratorsid-docs)

```
$res = $api->updateCollaborator(5, 7, array(
  'role' => PhonegapBuildApi::ROLE_TESTER, // PhonegapBuildApi::ROLE_DEV
  // see docs for all options
));
```

##### POST /api/v1/keys/:platform ([docs](http://docs.build.phonegap.com/en_US/developer_api_write.md.html#_post_https_build_phonegap_com_api_v1_keys_platform))

[](#post-apiv1keysplatform-docs)

```
$res = $api->addKeyPlatform(PhonegapBuildApi::IOS, array(
  // better use methods below or see docs for all options
));
$res = $api->addKeyPlatform(PhonegapBuildApi::ANDROID, array(
  // better use methods below or see docs for all options
));
```

Android specific (preferable):

```
$res = $api->addKeyAndroid('Key Title', '/path/to/key.keystore', array(
  'alias' => 'release',
  // see docs for all options
));
```

iOS specific (preferable):

```
$res = $api->addKeyIos('Key Title', '/path/to/key.p12', '/path/to/key.mobileprovision', array(
  // see docs for all options
));
```

##### PUT /api/v1/keys/:platform/:id ([docs](http://docs.build.phonegap.com/en_US/developer_api_write.md.html#_put_https_build_phonegap_com_api_v1_keys_platform))

[](#put-apiv1keysplatformid-docs)

```
$res = $api->updateKeyPlatform(PhonegapBuildApi::IOS, 3, array(
  // better use methods below or see docs for all options
));
$res = $api->updateKeyPlatform(PhonegapBuildApi::ANDROID, 3, array(
  // better use methods below or see docs for all options
));
```

Android specific (preferable):

```
$res = $api->updateKeyIos(3, 'key_password');
```

iOS specific (preferable):

```
$res = $api->updateKeyAndroid(3, 'key_password', 'keystore_password');
```

##### DELETE /api/v1/apps/:id ([docs](http://docs.build.phonegap.com/en_US/developer_api_write.md.html#_delete_https_build_phonegap_com_api_v1_apps_id))

[](#delete-apiv1appsid-docs)

```
$res = $api->deleteApplication(5);
```

##### DELETE /api/v1/apps/:id/collaborators/:id ([docs](http://docs.build.phonegap.com/en_US/developer_api_write.md.html#_delete_https_build_phonegap_com_api_v1_apps_id_collaborators_id))

[](#delete-apiv1appsidcollaboratorsid-docs)

```
$res = $api->deleteCollaborator(5, 7);
```

##### DELETE /api/v1/keys/:platform/:id ([docs](http://docs.build.phonegap.com/en_US/developer_api_write.md.html#_delete_https_build_phonegap_com_api_v1_keys_platform_id))

[](#delete-apiv1keysplatformid-docs)

```
$res = $api->deleteKeyPlatform(PhonegapBuildApi::IOS, 3);
$res = $api->deleteKeyPlatform(PhonegapBuildApi::ANDROID, 3);
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~516 days

Total

4

Last Release

2325d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed9828025541632f8856140c3f9e74d5e2822d690e3fb0cd3d4f1a0ccc1be2b1?d=identicon)[micrddrgn](/maintainers/micrddrgn)

---

Top Contributors

[![mradionov](https://avatars.githubusercontent.com/u/2007370?v=4)](https://github.com/mradionov "mradionov (24 commits)")

---

Tags

cordovaphonegapphonegap-buildphpapibuildphonegap

### Embed Badge

![Health badge](/badges/mradionov-phonegap-build-api/health.svg)

```
[![Health](https://phpackages.com/badges/mradionov-phonegap-build-api/health.svg)](https://phpackages.com/packages/mradionov-phonegap-build-api)
```

###  Alternatives

[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

138110.7k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
