定制 metaline/activecampaign-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

metaline/activecampaign-sdk

最新稳定版本:1.0.4

Composer 安装命令:

composer require metaline/activecampaign-sdk

包简介

A simple PHP wrapper for the ActiveCampaign API v3

README 文档

README

Tests status Coverage Status

This library is a simple PHP wrapper for the ActiveCampaign API v3.

Installation

Install the latest version with Composer:

composer require metaline/activecampaign-sdk

Requirements

This project works with PHP 5.6+ or 7.1+.

You also need a URL and a KEY to access the ActiveCampaign APIs. These parameters are specific to your ActiveCampaign account. You can find them under Settings / Developer section of your profile.

Documentation

First you need to create an instance of the Client:

<?php

require __DIR__ . '/vendor/autoload.php';

use MetaLine\ActiveCampaign\Client;

$apiURL = 'https://<YOUR ACCOUNT>.api-us1.com';
$apiKEY = 'super-secret-key'; // Never publish this key!

$client = new Client($apiURL, $apiKEY);

Now you are ready to talk to the ActiveCampaign API. For example, you can retrieves all contacts:

$result = $client->get('contacts');

Or create a new contact:

$result = $client->post('contacts', [
    'contact' => [
        'email'     => 'johndoe@example.com',
        'firstName' => 'John',
        'lastName'  => 'Doe',
        'phone'     => '7223224241',
    ]
]);

Or delete an existing one:

$result = $client->delete('contacts/' . $contactId);

And so on.

Check the ActiveCampaign documentation for the other APIs.

Work with the Result object

All Client methods return a Result object, that it’s a simple value object:

if ($result->isSuccessful()) {
	$data = $result->getData();
} else {
	$errors = $result->getErrors();
}

Debug the result to discover how to proceed.

Coding Standard

This project follows the PSR-12 coding standard. To ensure code consistency and facilitate development, you can check the codebase against these standards by running the following command:

composer run cs

License

This project is licensed under the MIT License. See the LICENSE file for details.

统计信息

  • 总下载量: 2.1k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-09