PHPackages                             reganface/rgp - 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. reganface/rgp

AbandonedArchivedLibrary[API Development](/categories/api)

reganface/rgp
=============

PHP library for accessing the RGP API

v1.0.0(6y ago)212GPL-3.0-or-laterPHPPHP &gt;=5.3.0

Since Dec 20Pushed 6y ago1 watchersCompare

[ Source](https://github.com/reganface/RGP-API)[ Packagist](https://packagist.org/packages/reganface/rgp)[ Docs](https://github.com/reganface/RGP-API)[ RSS](/packages/reganface-rgp/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (6)Used By (0)

Rock Gym Pro API
================

[](#rock-gym-pro-api)

Rock Gym Pro has released a basic API as of December 2019. This PHP class aims to make it easy to access all available endpoints that have been provided. RGP has made it clear that future development will be dependent on community interest and usage, so get coding! If there is some functionality you'd like to see added to the API, let RGP support know, as this will help guide development.

API Documentation
-----------------

[](#api-documentation)

You can view RGP's documentation of their API here:

API Keys
--------

[](#api-keys)

You will need to generate an API key before being able to access the API. This [Google Doc](https://docs.google.com/document/d/1J_r1QkUphSsaPa-KdqsUv0xd7r39qp3M4169ouv6rXc/edit) from RGP has instructions on how to generate your key for both cloud and locally hosted servers.

Version 1.0.0 of This Library
=============================

[](#version-100-of-this-library)

The scope of this library has been reduced to provide just the basic wrapper and some small tweaks on the response structure. Previously, there were separate methods for each endpoint of the API. There were multiple changes in the API that each broke the library, so endpoint specific methods were removed in favor of a more generlized approach using the new `get()` method.

Installation
------------

[](#installation)

There are two ways to use this library. You can install it as a dependency with [Composer](https://getcomposer.org/), or you can download RGP.php from this repository and include it in your code.

### Composer

[](#composer)

```
composer require reganface/rgp
```

Include composer's autoload file at the top of your project to load all of your dependencies.

```
require __DIR__ . '/vendor/autoload.php';
```

### Download

[](#download)

Save RGP.php to your project folder and include it in your project.

```
require "/path/to/RGP.php";
```

### cURL

[](#curl)

This class requires curl to be installed and enabled on the version of PHP that you are using. PHP will throw errors if curl is not accessible.

Basic Usage
-----------

[](#basic-usage)

When instantiating the class, you just need to include your api username and api key. Exceptions will be thrown on any errors, so make sure to keep code inside a try/catch block.

```
$api_username = "apiname";	// add your api username here
$api_key = "apikey";		// add your api key here

try {
	$rgp = new reganface\RGP\RGP($api_username, $api_key);

	// do stuff

} catch (Exception $e) {
	// handle errors
}
```

The structure of the data returned by `get()` will differ slightly from what RGP returns if you were to access the API directly. This is done to keep the meta data of the response separate from the data you requested. The structure looks like this:

```
[
	"data"  => [],			// The requested data
	"response"  => [],		// response information
	"pages"  => []			// pagination information (if applicable)
]
```

If you would prefer to have the data exactly as the API returns, you can use `get_raw()` instead.

### Example

[](#example)

```
// Get some data. In this case, a list of all your facilities.
$result = $rgp->get("/facilities");

// The data will always be found in the "data" key.
$facilities  =  $result["data"];

// Output a list of each facility's three character code and the facility name.
if (!empty($facilities)) {
	foreach($facilities as $facility) {
		echo  "{$facility["code"]} - {$facility["name"]}\n";
	}
}
```

Methods
=======

[](#methods)

### get()

[](#get)

```
get (string $path [, array $params])
```

Returns data from the API with a slightly altered data structure as seen below:

```
[
	"data" => array,			// this is the data you are looking for
	"response" => array,		// meta data about the response
	"pages" => [				// this will be here for any endpoints that return paginated data
		"itemTotal" => int,		// total number of results
		"itemPage" => int,		// number of results per page
		"pageTotal" => int,		// total number of pages
		"pageCurrent" => int	// the current page that was just returned
	]
]
```

**path**
This is the path of the API endpoint. The list of all current endpoints is available at . *Note: do not include "/v1" in the path.*

**params**
An associative array of any query paramaters you want to include with the call.

---

### get\_raw()

[](#get_raw)

```
get_raw (string $path [, array $params])
```

This method is identical to `get()` except that it will return the data exactly how the API returns it.

---

### test()

[](#test)

```
test ()
```

Tests the connection to the API. Returns true if a connections can be made successfully.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

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 ~35 days

Total

5

Last Release

2198d ago

Major Versions

v0.2.2 → v1.0.02020-05-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a7dceeecde6616de830f8d15e678adba8ce5955bc3e87311329854318fb25f6?d=identicon)[reganface](/maintainers/reganface)

---

Top Contributors

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

---

Tags

rgpRock Gym Pro

### Embed Badge

![Health badge](/badges/reganface-rgp/health.svg)

```
[![Health](https://phpackages.com/badges/reganface-rgp/health.svg)](https://phpackages.com/packages/reganface-rgp)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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