PHPackages                             apli/integration-rdstation - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. apli/integration-rdstation

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

apli/integration-rdstation
==========================

Aplí RDStation Client Library

v1.0.0(6y ago)1220MITPHPPHP ^7.2

Since Nov 26Pushed 6y ago2 watchersCompare

[ Source](https://github.com/dmandrade/apli-integration-rdstation)[ Packagist](https://packagist.org/packages/apli/integration-rdstation)[ RSS](/packages/apli-integration-rdstation/feed)WikiDiscussions dev Synced 2d ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Aplí RDStation Client
=====================

[](#aplí-rdstation-client)

A simple package to integrate your application with [RD Station Marketing](https://rdstation.com) using oauth authentication.

Requirements
------------

[](#requirements)

The following versions of PHP are supported.

- PHP 7.3

Basi Usage
----------

[](#basi-usage)

Create a provide instance in yours controller constructor

```
use Apli\Integration\RdStation\Provider\RdStation;

$this->oauthProvider = new RdStation([
    'clientId'          => Env::get('RDSTATION_CLIENT_ID'),
    'clientSecret'      => Env::get('RDSTATION_CLIENT_SECRET'),
    'redirectUri'       => url('auth/rdstation/callback'),
]);
```

In authorization route call provider authorize method

```
$this->oauthProvider->authorize();
```

In callback route call getAccessToken:

```
use Apli\OAuth2\Client\Auth\Tokens\AccessTokenInterface;
use Apli\OAuth2\Client\Support\Utils\GrantType;

/** @var AccessTokenInterface $accessToken */
$accessToken = $this->oauthProvider->getAccessToken(GrantType::AUTHORIZATION_CODE, [
    'code' => $request->get('code')
]);
```

### Resource Owner

[](#resource-owner)

To request RDStation data like contacts or updating funnels/event you need a ResourceOwner instance. This object is a representation of rdstation authorized account.

```
use Apli\Integration\RdStation\Provider\RdStationAccount;

$rdstationAccount = $this->oauthProvider->getResourceOwner($accessToken);
```

#### Contacts

[](#contacts)

```
$contact = $rdstationAccount->contacts()->getByIdentifier('email@domain.com');

or you can use uuid

$contact = $rdstationAccount->contacts()->getByIdentifier('11111111-1111-1111-1111-111111111111');
```

To update a contact

```
$contact->setJobTitle('Developer');
$contact->getAddress()->setState('SP');
$contact->getPhone()->setMobilePhone('9876543210');
$contact->getSocialNetwork()->setTwitter('teste');
$rdstationAccount->contacts()->patch($contact);
```

#### Funnels

[](#funnels)

```
$funnel = $rdstationAccount->funnels()->getByIdentifier('email@domain.com');

// or you can use uuid

$funnel = $rdstationAccount->funnels()->getByIdentifier('11111111-1111-1111-1111-111111111111');
```

To update a funnel

```
use Apli\Integration\RdStation\Entities\Funnel;

$funnel->setLifecycleStage(Funnel::STAGE_LEAD);
$rdstationAccount->funnels()->put('email@domain.com', $funnel);

// or you can use uuid

$rdstationAccount->funnels()->put('11111111-1111-1111-1111-111111111111', $funnel);
```

#### Events

[](#events)

```
use Apli\Integration\RdStation\Entities\Event;

$event = new Event(
    Event::FAMILY_CDP,
    Event::TYPE_CONVERSION,
    [
        'conversion_identifier' => 'conversionName',
        'email' => 'email@domain.com'
    ]
);
$rdstationAccount->events()->post($event);
```

Persisting Access Token
-----------------------

[](#persisting-access-token)

You can save access token data in a database to reuse, for that we provide a toArray() method

```
$accessTokenData = $accessToken->toArray()

// response:
// [
//     "access_token" => "xxxx",
//     "refresh_token" => "xxxxx",
//     "expires" => 1574799849,
//     "grant_type" => "Authorization",
//     "provider_name" => "rdstation"
// ]
```

Restore Access Token Object
---------------------------

[](#restore-access-token-object)

To restore access token object:

```
use Apli\OAuth2\Client\Auth\Tokens\AccessToken;

$accessToken = new AccessToken($accessTokenData);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

2360d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/46c152ad4f73337f281add1d284040cf3ce36c8e16987c4668cc213f2bb90826?d=identicon)[dmandrade](/maintainers/dmandrade)

---

Top Contributors

[![dmandrade](https://avatars.githubusercontent.com/u/7275012?v=4)](https://github.com/dmandrade "dmandrade (1 commits)")

---

Tags

apiclientAuthenticationoauthoauth2

### Embed Badge

![Health badge](/badges/apli-integration-rdstation/health.svg)

```
[![Health](https://phpackages.com/badges/apli-integration-rdstation/health.svg)](https://phpackages.com/packages/apli-integration-rdstation)
```

###  Alternatives

[league/oauth2-server

A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.

6.6k136.0M248](/packages/league-oauth2-server)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

251.7M1](/packages/mollie-oauth2-mollie-php)[cronofy/cronofy

SDK for Cronofy - the Scheduling Platform for Business

21778.5k](/packages/cronofy-cronofy)[andalisolutions/oauth2-anaf

Anaf OAuth 2.0 support for the PHP League's OAuth 2.0 Client

194.1k](/packages/andalisolutions-oauth2-anaf)

PHPackages © 2026

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