Download the PHP package roydejong/superoffice-webapi without Composer

On this page you can find all versions of the php package roydejong/superoffice-webapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package superoffice-webapi

superoffice-webapi

Latest Stable Version PHPUnit

Unofficial PHP SDK for SuperOffice Web API

This library provides a PHP SDK for the SuperOffice REST WebAPI, specifically targeting CRM Online (SuperOffice Cloud).

This library's functionality is currently limited to Projects, Appointments and Documents, but it should be easy enough to expand it to other SuperOffice types as well if you need them - just note that some work is needed.

Installation

The recommended way to install this library is with Composer, by adding the superoffice-webapi package as a dependency to your application:

composer require softwarepunt/superoffice-webapi

Configuration

You will need to be registered as a SuperOffice developer, and you must have a registered app to receive the necessary client credentials.

Initializing

When initializing the client, you must pass a Config object:

You can also set the configuration values by array:

Options

Available configuration options:

Key Type Required? Description
environment string Yes SuperOffice environment (sod, stage or online).
tenantId string Yes Customer / Context ID, usually in the format Cust12345.
clientId string For OAuth Client ID (Application ID).
clientSecret string For OAuth Client secret (Application Token).
redirectUri string For OAuth OAuth callback URL. Must exactly match a redirect URI registered with SuperOffice.

Authentication (OAuth / SuperId)

If you are targeting Online CRM, you must use OAuth to aquire a BEARER access token for the web api.

Local installations must use BASIC / SOTICKET authentication methods (currently not supported by this library).

Redirect user to authorization screen

After setting your configuration, you can ask the client to generate the OAuth authorization URL:

`

This will generate a redirect URL like https://env-name.superoffice.com/login/common/oauth/authorize?client_id=....

When you redirect the user to this URL, they will be asked to authorize your application and grant access to their account.

Request access token

Once the user authorizes your app, you will receive a callback request on your configured requestUri.

You can can exchange the code parameter in the request for an access token:

The TokenResponse object contains the following keys:

Key Type Description
token_type string Should be set to Bearer.
access_token string The actual access token.
expires_in int The lifetime in seconds of the access token.
refresh_token string Can be used to generate access tokens, as long as the user hasn't revoked application access.
id_token string JSON Web Token (JWT), can be used to verify that the tokens came from the real SuperId server.

Your application is responsible for storing these tokens.

Refresh access token

You can use the refresh_token to generate new access tokens, as long as the user hasn't revoked your application's access:

This response will be a TokenResponse object, but with refresh_token set to null.

Verify JWT

To comply with SuperOffice requirements, your application should verify the JWT from each token response (so when requesting a new token or refreshing a token):

This will validate the token (valid issuer, not expired) and verify it against the appropriate SuperOffice certificate for the configured environment.

Configure access token

You must explicitly set the access token you want to use with the client before performing any requests:

Tenant status check

You can perform a tenant status check to retrieve information about the customer's environment. You can use this to determine whether the environment is available or not, and get a load-balanced target URL for your API requests.

"Each tenant has a status page where you can check its state to ensure your application remains stable and responds accordingly."

The TenantStatus object contains the following keys:

Key Type Description
ContextIdentifier string Customer instance id, typically formatted like "Cust12345".
Endpoint string The load-balanced base URL of the customer installation.
State string Tenant status. Should be "Running" under normal conditions.
IsRunning bool This indicates whether the tenant is up and running.
ValidUntil DateTime When to check next time if an updated state is needed.

Collections

This library exposes different collections of API entities that you can interact with. Each collection can be accesed via the client instance, e.g. $client->projects().

Name Call Wraps API
Projects $client->projects() /api/v1/Project
Appointments $client->appointments() /api/v1/Appointment
Documents $client->documents() /api/v1/Document

All versions of superoffice-webapi with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-curl Version *
ext-json Version *
ext-mbstring Version *
ext-openssl Version *
guzzlehttp/guzzle Version ~7
lcobucci/jwt Version ^4.0
spatie/guzzle-rate-limiter-middleware Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package roydejong/superoffice-webapi contains the following files

Loading the files please wait ....