Download the PHP package fieldnation/fieldnation-sdk without Composer

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

WE do not support SOAP API for new developement, This code is for reference only

Field Nation PHP SDK

Build Status

Build Status

Installation

PHP Support

PHP Requirements

Your php runtime needs to have Soap enabled. Follow the installation instructions for enabling the Soap module.

Installation with Composer

Require the fieldnation/fieldnation-sdk package in your project.

Usage

The key concept to successfully integrating with Field Nation is describing how your business objects become Field Nation objects. We provide interfaces for describing how your data can be created on Field Nation.

Authentication

To use the SDK you need to generate an API key for your company. You can create an API key at https://app.fieldnation.com/api. Once you have a key you can create a connection. `

Environment

The default environment for the SDK is set to production. If you would like to use another environment for testing you can do so by setting the value on the credentials object.

Create a Work Order

First, let's create a simple example of what your data model might look like.

Now that we have our business logic in our MyBusinessTicket, how can we start creating work orders on Field Nation? Simple -- we update MyBusinessTicket to implement FieldNation\WorkOrderSerializerInterface (or better yet, create a new class MyFieldNationBusinessTicket that extends MyBusinessTicket and implements FieldNation\WorkOrderSerializerInterface).

Let's take a second to break down what we added.

These methods are a requirement of the WorkOrderSerializerInterface. This interface describes how your data translates to Field Nation data, and is a requirement of the SDK for creating work orders. Each method is documented with what it does, and what the return type should be. For more information about the types see the interfaces section.

There are a number of methods that require you to map your data to a type that is provided by the SDK. Let's use getPayInfo as an example. Field Nation requires a specific schema for describing the pay info for a work order. Because we don't know how you pay technicians, we provide an interface, PayInfoInterface, for translating your pay structure into a pay structure that we understand. The PayInfoInterface acts as container for the potential pay types -- FixedPayInterface, RatePayInterface, and BlendedPayInterface. Each of these pay interfaces also has a concrete class provided with the SDK (FixedPay, RatePay, BlendedPay). You can use the classes that we've implemented to translate your pay structure into a Field Nation pay structure, or you could create your own concrete classes that implement the provided interfaces.

Now that we understand how our business objects translate to Field Nation business objects we can create a work order. `

Work Order Actions and Metadata

Updating a work order is similar to creating a work order, but there are granular actions that you can make on a work order instance.

There are 2 ways of getting a Field Nation work order object. 1) If you just created one through the SDK::createWorkOrder method 2) If you called the SDK::getExistingWorkOrder method.

Now that you have a Field Nation work order instance you can execute actions or get metadata about it.

Publish

Publish your work order on Field Nation

Route to Provider

Route your work order to a Provider. When creating a Provider object you need to set the Provider ID so it will be properly routed.

Route to Group

Route your work order to a Group. When creating a Group object you need to set the Group ID so it will be properly routed.

Approve

Approve your work order.

Cancel

Sometimes you need to cancel your work order and start over.

Attach Documents

Attach a document to your work order.

Detach Documents

Remove a document from your work order.

Add a Custom Field

Your work orders are yours. Make them yours by adding a custom field.

Add a Label

Add labels to your work order.

Remove a Label

Remove a label from your work order.

Resolving a Closeout Requirement

Mark a closeout requirement as resolved.

Add a Shipment

Add a shipment for Field Nation to track to your work order.

Delete a Shipment

If a shipment no longer needs to be tracked delete it from your work order.

Update Schedule

Things change -- update the schedule for your work order.

Get the Entire Work Order

Occasionally it makes sense to get the entire work order. Here's how!

If you need something specific you should be calling that getter directly. This action is expensive so use it when you really need it.

Get the Status

Get the status of your work order

Get the Assigned Provider

Get the information about the Provider that is assigned to your work order.

Get Progress

Get the progress of your work order.

Get Payment

Get the payment information about your work order.

Get Messages

Get the messages on your work order

Get Attached Documents

Get the attached documents on your work order.

Get Shipments

Get the tracked shipments for your work order.

Get Your Work Orders

Sometimes you need to get all of your work orders. Here's how!

Get Your Projects

Use to get all of the projects for your company.

Get Your Documents

Get all of the documents for your company.

Convert a Tracking Number to a Shipping ID

If you have a tracking number for a shipment you created, but didn't save the Field Nation shipping ID you can get it here.

Using Your Classes

You may be wondering if you have to use our PHP classes. The good news is that you don't! We implement all of our own interfaces with plain ol' php objects as a set of defaults, but if your classes implement our interfaces you can configure the SDK to use your classes. The only hard rule we have is that your class must implement the interface for the type you're trying to inject. If your class doesn't implement the interface we will throw a TypeError.

Example replacing our WorkOrder with your class that implements our WorkOrderInterface.

Here is a list of all of the classes that are considered injectable.

Contributing

Tests

All merge requests require tests passing tests. Merge requests will not be approved if the tests do not pass, and if there are no new tests for the changes.

Coding Standards

We follow the PSR-2 coding style. We will lint the code and merge requests will not be approved if they do not pass linting. You can lint using PHP_CodeSniffer.

If you have lint errors or warnings you can try to auto clean them with composer lint:fix. If the errors/warnings can't be fixed on their own you will have to manually fix them. composer lint:check should always exit with a 0.

Changelog

Please see the CHANGELOG or view the releases.

License

Copyright © 2017 Field Nation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


All versions of fieldnation-sdk with dependencies

PHP Build Version
Package Version
No informations.
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 fieldnation/fieldnation-sdk contains the following files

Loading the files please wait ....