glasswalllab/arofloconnector

dev-main 2021-09-03 06:04 UTC

This package is auto-updated.

Last update: 2024-09-29 05:56:49 UTC


README

此包为 AroFlo (https://aroflo.com/) 提供集成。

API 文档 - https://apidocs.aroflo.com/

Latest Version

安装

您可以通过 composer 安装此包

composer require glasswalllab/arofloconnector 

用法

  1. 在您的 AroFlo 账户中设置 API 应用程序(站点管理 -> 设置 -> AroFlo API)

  2. 在您的 .env 中包含以下变量

AROFLO_UENCODE=YOUR_uENCODE
AROFLO_KEYID=YOUR_pENCODE
AROFLO_SECRET=YOUR_API_SECRET
AROFLO_ORGENCODE=YOUR_orgENCODE
AROFLO_BASE_API_URL=https://api.aroflo.com/
  1. 运行 php artisan migrate 创建 api_logs 数据库表

示例用法(Laravel)

use glasswalllab\arofloconnector\ArofloConnector;

//Get Task Types - with joins and were clauses
$aroflo = new ArofloConnector();
$joins = array('locations,locationcustomfields');
$wheres = array('and|archived|=|false');

//CallAroflo($zone, $joins, $wheres, $postxml, $method, $page)
$aroflo->CallAroflo('tasktypes', $joins, $wheres, '', 'GET',1)

//Post new client
$aroflo = new ArofloConnector();
$org = YOUR_orgENCODE
$postxml = '<clients><client><clientname><![CDATA[ Testing Client ]]></clientname><firstname><![CDATA[ Testing ]]></firstname><surname><![CDATA[ Client ]]></surname><phone>0412345678</phone><mobile>0412345678</mobile><email><![CDATA[ sreid@gwlab.com.au ]]></email><orgs><org><orgid>'.$org.'</orgid></org></orgs><address><addressline1><![CDATA[ 1 Smith Street ]]></addressline1><addressline2></addressline2><suburb></suburb><state><![CDATA[ Tasmania ]]></state><postcode><![CDATA[ 7000 ]]></postcode><country><![CDATA[ Australia ]]></country></address><gpsautogenerate>TRUE</gpsautogenerate><mailingaddress><addressline1><![CDATA[ 1 Smith Street ]]></addressline1><addressline2></addressline2><suburb></suburb><state><![CDATA[ Tasmania ]]></state><postcode>70000</postcode><country><![CDATA[ Australia ]]></country></mailingaddress></client></clients>';

//CallAroflo($zone, $joins, $wheres, $postxml, $method, $page)
$aroflo->CallAroflo('clients', [], [], $postxml, 'POST',null);

安全

如果您发现任何安全相关的问题,请通过电子邮件 sreid@gwlab.com.au 联系我们,而不是使用问题跟踪器。