ecrocombe / syncromsp_phpclient
dev-main
2022-12-14 09:07 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~1.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2024-09-14 12:54:45 UTC
README
欢迎来到官方Syncro API文档。要使用这些文档,您需要一个有效的Syncro账户。您可以在以下链接注册:[Syncro](https://syncromsp.com) 如果您已有有效账户,请在下方填写您的子域,然后点击“授权”并填写您的API密钥。该密钥仅适用于您的用户账户,可在用户资料页面找到。请在使用API之前查看API许可协议。通过访问我们的API,您同意API许可协议。请注意,API使用率限制为每个IP地址每分钟180个请求。
此PHP包由Swagger Codegen项目自动生成
- API版本:v1
- 构建包:io.swagger.codegen.v3.generators.php.PhpClientCodegen 更多信息请访问 https://help.syncromsp.com/
要求
PHP 5.5 及以上版本
安装和用法
Composer
要使用Composer安装绑定,请将以下内容添加到 composer.json
{
"repositories": [
{
"type": "git",
"url": "https://github.com/ecrocombe/syncroMSP_PHPclient.git"
}
],
"require": {
"ecrocombe/syncromsp_phpclient": "*@dev"
}
}
然后运行 composer install
手动安装
下载文件并包含 autoload.php
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
测试
要运行单元测试
composer install
./vendor/bin/phpunit
入门
请遵循安装流程,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: bearerAuth $config = VereTech\SyncroMSP_PHPclient\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = VereTech\SyncroMSP_PHPclient\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); $apiInstance = new VereTech\SyncroMSP_PHPclient\Client\Api\AppointmentApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $date_from = new \DateTime("2013-10-20"); // \DateTime | Returns Appointments that start after the date. Example \"2019-01-25\" $date_to = new \DateTime("2013-10-20"); // \DateTime | Returns Appointments that start before the date. Example \"2019-12-31\" $mine = true; // bool | Return only current user's appointments $page = 56; // int | Returns provided page of results, each 'page' contains 25 results try { $apiInstance->appointmentsGet($date_from, $date_to, $mine, $page); } catch (Exception $e) { echo 'Exception when calling AppointmentApi->appointmentsGet: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: bearerAuth $config = VereTech\SyncroMSP_PHPclient\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = VereTech\SyncroMSP_PHPclient\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); $apiInstance = new VereTech\SyncroMSP_PHPclient\Client\Api\AppointmentApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $id = 56; // int | try { $apiInstance->appointmentsIdDelete($id); } catch (Exception $e) { echo 'Exception when calling AppointmentApi->appointmentsIdDelete: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: bearerAuth $config = VereTech\SyncroMSP_PHPclient\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = VereTech\SyncroMSP_PHPclient\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); $apiInstance = new VereTech\SyncroMSP_PHPclient\Client\Api\AppointmentApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $id = 56; // int | try { $result = $apiInstance->appointmentsIdGet($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling AppointmentApi->appointmentsIdGet: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: bearerAuth $config = VereTech\SyncroMSP_PHPclient\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = VereTech\SyncroMSP_PHPclient\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); $apiInstance = new VereTech\SyncroMSP_PHPclient\Client\Api\AppointmentApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $id = 56; // int | $body = new \VereTech\SyncroMSP_PHPclient\Client\Model\AppointmentsIdBody(); // \VereTech\SyncroMSP_PHPclient\Client\Model\AppointmentsIdBody | Appointment object that needs to be added try { $apiInstance->appointmentsIdPut($id, $body); } catch (Exception $e) { echo 'Exception when calling AppointmentApi->appointmentsIdPut: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: bearerAuth $config = VereTech\SyncroMSP_PHPclient\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = VereTech\SyncroMSP_PHPclient\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); $apiInstance = new VereTech\SyncroMSP_PHPclient\Client\Api\AppointmentApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $body = new \VereTech\SyncroMSP_PHPclient\Client\Model\AppointmentsBody(); // \VereTech\SyncroMSP_PHPclient\Client\Model\AppointmentsBody | Appointment object that needs to be added try { $apiInstance->appointmentsPost($body); } catch (Exception $e) { echo 'Exception when calling AppointmentApi->appointmentsPost: ', $e->getMessage(), PHP_EOL; } ?>
API端点文档
所有URI均相对于 https://{subdomain}.syncromsp.com/api/v1
模型文档
- AppointmentTypesBody
- AppointmentTypesIdBody
- AppointmentsBody
- AppointmentsIdBody
- ContactsBody
- ContactsIdBody
- ContractsBody
- ContractsIdBody
- CustomerAssetsBody
- CustomerAssetsIdBody
- CustomerIdPaymentProfilesBody
- EstimatesBody
- EstimatesIdBody
- EstimatesLineItems
- IdAddLineItemBody
- IdCommentBody
- IdCreatePoLineItemBody
- IdDeleteAttachmentBody
- IdLocationQuantitiesBody
- IdProcessFormBody
- IdReceiveBody
- IdRemoveLineItemBody
- IdTimerEntryBody
- IdUpdateLineItemBody
- IdUpdateTimerEntryBody
- InlineResponse200
- InlineResponse2001
- InlineResponse2001Properties
- InlineResponse2002
- InlineResponse2003
- InlineResponse2003Customer
- InlineResponse2003CustomerContacts
- InlineResponse2003LineItems
- InlineResponse2004
- InlineResponse2004ProductSerials
- InlineResponse2005
- InlineResponse2005Vendor
- InlineResponse2006
- InlineResponse2006WikiPage
- InlineResponse200Customer
- InvoicesBody
- InvoicesIdBody
- InvoicesLineItems
- LeadsBody
- LeadsIdBody
- NewTicketFormsidprocessFormAppointments
- NewTicketFormsidprocessFormCustomerDetails
- NewTicketFormsidprocessFormTicketDetails
- OtpLoginBody
- PaymentProfilesIdBody
- PaymentsBody
- PortalUsersCreateInvitationBody
- ProductIdProductSerialsBody
- ProductSerialsAttachToLineItemBody
- ProductSerialsIdBody
- ProductsBody
- ProductsIdBody
- ProductsProductSkusAttributes
- ProductsidProductSkusAttributes
- PurchaseOrdersBody
- RmmAlertsBody
- RmmAlertsProperties
- TicketIdWorksheetResultsBody
- TicketsticketIdworksheetResultsidAnswers
- TimelogsBody
- UserDevicesBody
- UserDevicesIdBody
- WikiPagesBody
- WikiPagesIdBody
- WorksheetResultsIdBody
授权文档
bearerAuth
- 类型: API密钥
- API密钥参数名:Authorization
- 位置:HTTP头