jbostoen/itop-rest-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jbostoen/itop-rest-php

最新稳定版本:v25.02.09

Composer 安装命令:

composer require jbostoen/itop-rest-php

包简介

iTop REST/JSON API client - PHP library

关键字:

README 文档

README

Copyright (C) 2019-2025 Jeffrey Bostoen

License Donate 🍻 ☕

Need assistance with iTop or one of its extensions?
Need custom development?
Please get in touch to discuss the terms: info@jeffreybostoen.be / https://jeffreybostoen.be

What?

A simple PHP implementation that offers easy access to the most important iTop REST/JSON API actions.

Basic support for:

* core/check_credentials
* core/get
* core/create
* core/update
* core/delete
* core/apply_stimulus

There's a generic method to post and process other info.
Also supports preparing and sending base64 encoded data (files).

Quick install

composer require jbostoen/itop-rest-php

Examples


require('vendor/autoload.php');

use JeffreyBostoen\iTopRestService\Service;

$oService = new iTopRest('user', 'pwd', 'http://localhost/itop/web/webservices/rest.php');

// Fetch objects of type "Person".
$oResponse = $oService->Get([
	'key' => 'SELECT Person',
]);

foreach($oResponse->results as $sId => $aData) {
	
	// Do something.

}

// Create new Person.
$oResponse->Create([
	'class' => 'Person',
	'fields' => [
		'org_id' => 1,
		'first_name' => 'John',
		'name' => 'Smith',
		'notify' => 'yes'
	]
]);

// Update Person.
$oResponse->Update([
	'class' => 'Person',
	'key' => 1, // Id of Person, or OQL string
	'fields' => [
		'notify' => 'yes'
	],
	'comment' => 'Some comment about the update',
]);

// Delete person.
$oResponse->Delete([
	'class' => 'Person',
	'key' => 'SELECT Person WHERE first_name = "John" AND name = "Smith"', // Id of Person, or OQL string
	'comment' => 'Some comment about the deletion',
]);

Options

Show trace output (shows cURL and iTop errors, sent and received data, ...):

$oService->SetTraceLogFileName('/var/log/api.log');

Bypass SSL/TLS check:

$oService->SetSkipCertificateCheck(true);

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-31