Skip to content

Company App Service

The Company App Service exposes methods to create, update, delete, get, list company apps, also some other operations related to company apps.

Usage

php
use \Lordjoo\Apigee\Facades\Apigee;
$companyAppService = Apigee::edge()->companyApp($companyName);
use \Lordjoo\Apigee\Facades\Apigee;
$companyAppService = Apigee::edge()->companyApp($companyName);

As you can see, the companyApp() method accepts one parameter $companyName which is the name of the company you want to work with.

List all company apps

Using the get() method, you can get a collection of all company apps of the company.

php
$companyApps = $companyAppService->get();
$companyApps = $companyAppService->get();

$companyApps is a Laravel Collection of CompanyApp objects.

Get a company app by name

Using the find() method, you can get a company app by name.

php
$companyApp = $companyAppService->find($appName);
$companyApp = $companyAppService->find($appName);

$companyApp is an instance of CompanyApp object.

Create a company app

Using the create() method, you can create a company app, the create() method accepts one parameter $data where $data is an array of the company app properties CompanyAppRequest

php
$companyApp = $companyAppService->create($data);
$companyApp = $companyAppService->create($data);

Update a company app

Using the update() method, you can update a company app, the update() method accepts two parameters $appName and $data where $appName is the name of the company app you want to update and $data is an array of the company app properties CompanyAppRequest

php
$companyApp = $companyAppService->update($appName, $data);
$companyApp = $companyAppService->update($appName, $data);

Note

The create and update method will do a validation check on the data you passed, so if you passed an invalid data, the method will throw a validation exception.

Delete a company app

Using the delete() method, you can delete a company app by it's name.

php
$companyAppService->delete($appName);
$companyAppService->delete($appName);

Update a company app's status

Using the updateStatus() method, you can change a company app's status by it's name. the updateStatus() method accepts two parameters $appName and $status where $appName is the name of the company app you want to change the status of and $status is the new status of the company app, it can be active or inactive

php
$companyAppService->updateStatus($appName, $status);
$companyAppService->updateStatus($appName, $status);

Entity

Properties

PropertyTypeDescription
namestringThe name of the app.
companyNamestringThe name of the company.
statusstringThe status of the app.
appFamilystringThe app family.
scopesarrayThe scopes associated with the app.
callbackUrlstringThe callback URL.
createdBystringThe user who created the app.
lastModifiedBystringThe user who last modified the app.
developerIdstringThe developer ID.
attributesAttribute[]Attributes of the API Product
credentialsAppKey[]Credentials of the app.
createdAtCarbonThe date and time the app was created.
lastModifiedAtCarbonThe date and time the app was last modified.

AppKey

Properties

PropertyTypeDescription
consumerKeystringThe consumer key.
consumerSecretstringThe consumer secret.
expiresAtCarbonThe date and time the credential expires.
issuedAtCarbonThe date and time the credential was issued.
scopesarrayThe scopes associated with the credential.
apiProductsarrayThe API products associated with the credential.
statusstringThe status of the credential.
appNamestringThe name of the app.
companyNamestring (nullable)The name of the company.
developerIdstring (nullable)The developer ID.

Methods

approve()

Approve the developer app.

php
$developerApp->approve();
$developerApp->approve();

revoke()

Revoke the developer app.

php
$developerApp->revoke();
$developerApp->revoke();

Released under the MIT License.