承接 davidzadrazil/airtable-api-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

davidzadrazil/airtable-api-php

最新稳定版本:0.0.3

Composer 安装命令:

composer require davidzadrazil/airtable-api-php

包简介

PHP wrapper for Airtable API

README 文档

README

PHP wrapper for Airtable API.

Getting started

Airtable API does not allow to manipulate with bases or with fields in tables. So you must create tables and its fields manually in Airtable interface.

Important

Every base has own documentation where you find base identificator (starts with app e.g. appGYr9gxkAk0wKNk), which is required parameter. API Key is located in account settings.

Instalation

The best way to install davidzadrazil/airtable-api-php is using Composer:

$ composer require davidzadrazil/airtable-api-php

Usage

Initialize

First of all, you must initialize Airtable class and Request handler:

$airtable = new DavidZadrazil\AirtableApi\Airtable('API_KEY', 'BASE_ID');
$request = new DavidZadrazil\AirtableApi\Request($airtable, 'TABLE_NAME');

Fetching records

Important: Airtable limits response with maximum 100 records.

$tableRequest = $request->getTable();
do {
  foreach ($tableRequest->getRecords() as $record) {
    echo $record->getName();
    echo $record->getEmail();
    echo $record->getAnotherValue();
  }
} while ($tableRequest = $tableRequest->nextPage());

getRecords() returns array of AirtableApi\Record.

Filtration & Other parameters

Fetching records from table can be used with available parameters like filterByFormula, maxRecords, pageSize, sort or view.

$request->getTable(['pageSize' => 50, 'filterByFormula' => '{Name} = "test"']);

Creating records

$response = $request->createRecord(
  [
    'Name' => 'This appears in Name field',
    'Email' => 'john@doe.com',
    'LinkToAnotherTable' => ['recsH5WYbYpwWMlvb']
  ]
);

$response->isSuccess(); // true / false
$response->getRecords(); // returns newly created record with ID

Updating records

Updates specific record with given record ID.

$response = $request->updateRecord('recsH5WYbYpwWMlvb', ['Name' => 'Updated value']);
$response->isSuccess(); // true / false

Deleting records

Delete specific record with given record ID.

$response = $request->deleteRecord('recsH5WYbYpwWMlvb');
$response->isSuccess(); // true / false

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固