Download the PHP package wallstreetio/ontraport without Composer

On this page you can find all versions of the php package wallstreetio/ontraport. 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 ontraport

Ontraport API

Build Status Latest Version

The Ontraport API package, by WallStreet.io, is a simple and elegant way to communicate with Ontraport.

Installation

Configuration

Once you have the package installed, you can start using the API right away.

Usage

The Ontraport API provides a fluent, query builder syntax that you might be used to from the popular Eloquent ORM.

In the examples below we will focus on the Contacts endpoint in Ontraport, but the same syntax can apply to any of the Ontraport objects.

List Objects

The get method will return an array of all of the objects (within Ontraport's limit of 50).

You may wish to add constraints to the query to retrieve a subset of the objects. For example:

In the above example, we fetched all the contacts with the firstname, Bob, in ascending order sorted by the id field.

For pagination, you can limit the number of results to retrieve as well as the offset to start.

The above examples will grab 25 contacts offset by the first 50 contacts.

Find Object

In addition to retrieving all of the objects, you may also retrieve single objects using find and first. Instead of an array of objects, these methods return a single object:

Like the get method, we can stack the first method with constraints as well.

The contact variable that is returned is an instance of \Wsio\Ontraport\Fluent which allows us to treat the Ontraport response as an object.

Create Object

You may also come across situations where you want to update an existing record or create a new record if none exists. The Ontraport API provides a saveOrUpdate method to allow for this.

Update Object

If we have already retrieved an object, we can change the attributes of the object using the Fluent interface. When we are ready to save the changes we can call the save method. For example:

Delete Object

Similary, if we have previously retrieved the object, we can utilize the delete method to remove the object in Ontraport.

Delete Many Objects

Examples

Fetch all contacts where the lastname attribute is empty.

Fetch all the products with the names: ONTRAPages and ONTRAForms.

Fetch all contacts in descending order.

The Ontraport API allows you to stack these methods on top of each other, for example:

In the above example, we grabbed all the active contacts without a firstname attribute in descending order.

List of Provided Ontraport Objects

For the full list of objects that Ontraport provides and better documentation for each of the endpoints, please refer to the Ontraport Documentation.

Each of these objects can be called directly on the Ontraport instance.

Extension

In attempt to mimic Ontraport's dynamic nature, internally all Ontraport endpoints are treated as if they were the same. If an endpoint does not exist or requires a different structure, extending/overriding is a breeze.

Let's say we have a tasks objects but it doesn't have the assign endpoint we need. We can extend the ontraport instance to allow for it.

First we will create a new Task class that extends the Resource class.

Then we call the extend method on an our ontraport instance.

The endpoint can now be accessed through the ontraport instance and tasks object.

Likewise, this approach can be used for objects that this package does not offer in the list above.

In most cases this can be a little much especially for one-off requests. The Ontraport instance provides get, post, put, and delete helper methods that you can utilize instead.

Documentation

Tests

To run the testsuite, you will need to clone this repository and install the dev requirements.

Then you can run the unit tests

If you want to run the full test suite, you will need to edit your phpunit.xml file with the proper ONTRAPORT_APP_ID and ONTRAPORT_API_KEY.

Note: The full testsuite will run tests that will add, change, and delete contacts. Make sure you are using a testing account.

License

WallStreet.io Ontraport API is open-sourced software licensed under The MIT License (MIT).


All versions of ontraport with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
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 wallstreetio/ontraport contains the following files

Loading the files please wait ....