定制 emnify/emnify-sdk 二次开发

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

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

emnify/emnify-sdk

Composer 安装命令:

composer require emnify/emnify-sdk

包简介

Supply your swarm of IoT devices with cloud connectivity by emnify. Automate your routines with this SDK for PHP.

README 文档

README

Rest API resources of the emnify System.

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "require": {
    "emnify/emnify-sdk": "*@dev"
  }
}

Then run composer install

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');


$apiInstance = new Swagger\Client\Api\ApplicationTokensApi(
    // 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 \Swagger\Client\Model\ApplicationToken(); // \Swagger\Client\Model\ApplicationToken | 
$app_token_id = 1.2; // float | application token ID

try {
    $apiInstance->applicationTokenByIdPatch($body, $app_token_id);
} catch (Exception $e) {
    echo 'Exception when calling ApplicationTokensApi->applicationTokenByIdPatch: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\ApplicationTokensApi(
    // 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
);

try {
    $result = $apiInstance->applicationTokenGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ApplicationTokensApi->applicationTokenGet: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\ApplicationTokensApi(
    // 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 \Swagger\Client\Model\CreateApplicationTokenrequest(); // \Swagger\Client\Model\CreateApplicationTokenrequest | 

try {
    $result = $apiInstance->applicationTokenPost($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ApplicationTokensApi->applicationTokenPost: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to https://cdn.emnify.net

Class Method HTTP request Description
ApplicationTokensApi applicationTokenByIdPatch PATCH /api/v1/application_token/{app_token_id} Update Application Token
ApplicationTokensApi applicationTokenGet GET /api/v1/application_token List Application Tokens
ApplicationTokensApi applicationTokenPost POST /api/v1/application_token Create Application Token
AuthenticationApi authenticate POST /api/v1/authenticate Retrieve Authentication Token
AuthenticationApi postMfa POST /api/v1/user/mfa Create an MFA key
AuthenticationApi userMfaByIdPatch PATCH /api/v1/user/mfa/{key_id} Activate MFA key
AuthenticationApi userMfaByUserIdAndKeyIdDelete DELETE /api/v1/user/{user_id}/mfa/{key_id} Delete an MFA key
AuthenticationApi userMfaStatusGet GET /api/v1/user/mfa/status List MFA key Statuses
AuthenticationApi userMfaTrustedDeviceByUserIdAndDeviceIdDelete DELETE /api/v1/user/{user_id}/mfa/trusted_device/{device_id} Delete a Trusted Device
AuthenticationApi userMfaTrustedDeviceByUserIdGet GET /api/v1/user/{user_id}/mfa/trusted_device List Trusted Devices
AuthenticationApi userMfaTypeGet GET /api/v1/user/mfa/type List MFA key types
CloudConnectApi createCloudConnectAttachmentTGW POST /api/v1/cnc/breakout/tgw Create a CloudConnect attachment via Transit Gateway
CloudConnectApi createCloudConnectAttachmentVPN POST /api/v1/cnc/breakout/vpn Create a CloudConnect attachment via IPSec VPN
CloudConnectApi deleteCloudConnectAttachment DELETE /api/v1/cnc/breakout/{cloudconnect_attachment_id} Delete a specific CloudConnect attachment
CloudConnectApi getCloudConnectAttachmentById GET /api/v1/cnc/breakout/{cloudconnect_attachment_id} View details of a CloudConnect attachment
CloudConnectApi getCloudConnectAttachments GET /api/v1/cnc/breakout List all CloudConnect attachments of an organisation
CloudConnectApi getCloudConnectAvailableRegionsByBreakoutType GET /api/v1/cnc/breakout_type/{breakout_type_id}/available_region Get list of available CloudConnect regions by breakout type
CloudConnectApi getCloudConnectBreakoutTypes GET /api/v1/cnc/breakout_type List CloudConnect breakout types
CloudConnectApi getCloudConnectRegions GET /api/v1/cnc/region Get list of available CloudConnect regions
CloudConnectApi listCloudConnectCustomPrices GET /api/v1/cnc/pricing List CloudConnect prices
CloudConnectApi retryCloudConnectAttachment PATCH /api/v1/cnc/breakout/{cloudconnect_attachment_id} Retry creation of an expired TGW breakout
EndpointApi createEndpoint POST /api/v1/endpoint Create Endpoint
EndpointApi deleteEndpointDataQuotaById DELETE /api/v1/endpoint/{endpoint_id}/quota/data Remove Data Quota
EndpointApi deleteEndpointSmsQuotaById DELETE /api/v1/endpoint/{endpoint_id}/quota/sms Remove SMS Quota
EndpointApi endpointBalanceByEndpointIdDelete DELETE /api/v1/endpoint/{endpoint_id}/balance Reset Prepaid Balance
EndpointApi endpointBalanceByEndpointIdGet GET /api/v1/endpoint/{endpoint_id}/balance Endpoint Prepaid Balance
EndpointApi endpointBalanceByEndpointIdPost POST /api/v1/endpoint/{endpoint_id}/balance Update Prepaid Balance
EndpointApi endpointByIdDelete DELETE /api/v1/endpoint/{endpoint_id} Delete an Endpoint
EndpointApi endpointByIdGet GET /api/v1/endpoint/{endpoint_id} Endpoint Details
EndpointApi endpointByIdPatch PATCH /api/v1/endpoint/{endpoint_id} Update an Endpoint
EndpointApi endpointConnectivityByIdGet GET /api/v1/endpoint/{endpoint_id}/connectivity Endpoint Connectivity Status
EndpointApi endpointEventsByID GET /api/v1/endpoint/{endpoint_id}/event List Endpoint events
EndpointApi endpointOperatorBlacklistByEndpointIdGet GET /api/v1/endpoint/{endpoint_id}/operator_blacklist List Operator Blacklist for Endpoint
EndpointApi endpointOperatorBlacklistByEpIdAndOperatorIdDelete DELETE /api/v1/endpoint/{endpoint_id}/operator_blacklist/{operator_id} Remove an Operator from the Blacklist
EndpointApi endpointOperatorBlacklistByEpIdAndOperatorIdPut PUT /api/v1/endpoint/{endpoint_id}/operator_blacklist/{operator_id} Add an Operator to the Blacklist
EndpointApi endpointQuotaDataByEndpointIdGet GET /api/v1/endpoint/{endpoint_id}/quota/data Retrieve Data Quota details
EndpointApi endpointQuotaDataByEndpointIdPost POST /api/v1/endpoint/{endpoint_id}/quota/data Set Data Quota
EndpointApi endpointQuotaSmsByEndpointIdGet GET /api/v1/endpoint/{endpoint_id}/quota/sms Show SMS Quota details
EndpointApi endpointQuotaSmsByEndpointIdPost POST /api/v1/endpoint/{endpoint_id}/quota/sms Set SMS Quota
EndpointApi endpointSmsByEndpointIdAndSmsIdDelete DELETE /api/v1/endpoint/{endpoint_id}/sms/{sms_id} Cancel SMS
EndpointApi endpointSmsByEndpointIdAndSmsIdGet GET /api/v1/endpoint/{endpoint_id}/sms/{sms_id} SMS details
EndpointApi endpointSmsByIdGet GET /api/v1/endpoint/{endpoint_id}/sms List sent and received SMS
EndpointApi endpointSmsByIdPost POST /api/v1/endpoint/{endpoint_id}/sms Send SMS to an Endpoint
EndpointApi endpointStatsByIdGet GET /api/v1/endpoint/{endpoint_id}/stats Endpoint Usage and Cost Statistics
EndpointApi endpointStatsDailyByIdGet GET /api/v1/endpoint/{endpoint_id}/stats/daily Daily Endpoint Usage Statistics
EndpointApi endpointStatusGet GET /api/v1/endpoint/status List Endpoint Statuses
EndpointApi getConnectivityInfoByEndpointId GET /api/v1/endpoint/{endpoint_id}/connectivity_info Connectivity Info of an Endpoint
EndpointApi getEndpoints GET /api/v1/endpoint List Endpoints
EndpointApi updateEndpointConnectivityById PATCH /api/v1/endpoint/{endpoint_id}/connectivity Reset Endpoint Connectivity
EventsApi eventTypeGet GET /api/v1/event/type List Event Types
EventsApi getEvents GET /api/v1/event List Events
IPAddressSpacesApi ipAddressSpaceAvailableByIpAddressVersionGet GET /api/v1/ip_address_space/available Get Random Address Spaces
IPAddressSpacesApi ipAddressSpaceByIdDelete DELETE /api/v1/ip_address_space/{address_space_id} Release an IP Address Space from an Organisation
IPAddressSpacesApi ipAddressSpaceByIdPut PUT /api/v1/ip_address_space/{address_space_id} Assign an IP Address Space to an Organisation
IPAddressSpacesApi ipAddressSpaceGet GET /api/v1/ip_address_space List IP Address Spaces
IntegrationsApi createCallbackSecret POST /api/v1/api_secret Create a Callback Secret
IntegrationsApi createCallbackURL POST /api/v1/api_callback Create a Callback URL
IntegrationsApi createDataStreamer POST /api/v2/data_stream Create Data Stream
IntegrationsApi dataStreamerV2ByIdRestart POST /api/v2/data_stream/{data_stream_id}/restart Restart Existing Data Stream
IntegrationsApi deleteCallbackSecret DELETE /api/v1/api_secret/{api_secret_id} Delete a Callback Secret
IntegrationsApi deleteCallbackURL DELETE /api/v1/api_callback/{api_callback_id} Delete a Callback URL
IntegrationsApi deleteDataStreamerV2 DELETE /api/v2/data_stream/{data_stream_id} Delete Existing Data Stream
IntegrationsApi getAPICallbackSecret GET /api/v1/api_secret List API Callback Secrets
IntegrationsApi getAPICallbackURLs GET /api/v1/api_callback Retrieve list of API Callback URLs
IntegrationsApi getCallbackSecretbyID GET /api/v1/api_secret/{api_secret_id} Get a Callback Secret by ID
IntegrationsApi getCallbackURLbyID GET /api/v1/api_callback/{api_callback_id} Get a Callback URL by ID
IntegrationsApi getDataStreamerByIdV2 GET /api/v2/data_stream/{data_stream_id} Get Details on Existing Data Stream
IntegrationsApi getDataStreamerDataStreamType GET /api/v2/data_stream/type Get Data Stream Types
IntegrationsApi getDataStreamerEnumFilterFieldType GET /api/v2/data_stream/filter_field_type Get Possible Data Stream Filter Fields
IntegrationsApi getDataStreamerStatuses GET /api/v2/data_stream/status Get Possible Data Stream Statuses
IntegrationsApi listDataStreamerV2s GET /api/v2/data_stream List Data Stream configurations of your organization
IntegrationsApi patchV2DataStream PATCH /api/v2/data_stream/{data_stream_id} Modify Existing Data Stream
LookupsApi breakoutRegionGet GET /api/v1/breakout_region List Breakout Regions
LookupsApi countryGet GET /api/v1/country List Country Codes
LookupsApi currencyGet GET /api/v1/currency List Currencies
LookupsApi dataBlocksizeGet GET /api/v1/data_blocksize List Data blocksizes
LookupsApi dataThrottleGet GET /api/v1/data_throttle List Data Throttles
LookupsApi esmeInterfaceTypeGet GET /api/v1/esme_interface_type List ESME Interface Types
LookupsApi listServiceLevels GET /api/v1/service_level Get list of service levels
LookupsApi ratType GET /api/v1/rat_type List RAT types
OperatorApi operatorGet GET /api/v1/operator List Operators
OrganisationApi assignRatezoneInclusiveVolume PUT /api/v1/organisation/{org_id_or_my}/inclusive_volume/{inclusive_volume_id} Assign a ratezone inclusive volume to an organisation
OrganisationApi getActiveOrganisationInclusiveVolume GET /api/v1/organisation/{org_id_or_my}/inclusive_volume/active Get list of active organisation inclusive volumes
OrganisationApi getOrganisationDailyStats GET /api/v1/organisation/{org_id_or_my}/stats/daily Daily organisation traffic and cost statistics
OrganisationApi getOrganisationHourlyStats GET /api/v1/organisation/{org_id_or_my}/stats/hourly Hourly organisation traffic statistics
OrganisationApi getOrganisationMonthlyStats GET /api/v1/organisation/{org_id_or_my}/stats Monthly organisation traffic and cost statistics
OrganisationApi myOrganisationGet GET /api/v1/organisation/my My Organisation Details
OrganisationApi organisationStatusGet GET /api/v1/organisation/status List Organisation Status
OrganisationApi statisticsDailyByIdGet GET /api/v1/stats/daily Organisation Usage and Costs Statistics per day for the current month
OrganisationApi updateOrganisationTariff PATCH /api/v1/organisation/{org_id}/tariff Update assigned tariff
PasswordManagementAndActivationApi userActivationPost POST /api/v1/user/activation Activate User
PasswordManagementAndActivationApi userActivationResendPost POST /api/v1/user/activation_resend Resend User Activation E-mail
PasswordManagementAndActivationApi userPasswordPatch PATCH /api/v1/user/password Change Password
SIMApi getEsimInstallationCode GET /api/v1/sim/{sim_id}/installation_code Get the code to install an eSIM
SIMApi registerSIMBatchByBIC PATCH /api/v1/sim_batch/bic/{bic} Register a given batch by BIC
SIMApi sIMStatisticsDailyByIdGet GET /api/v1/sim/{sim_id}/stats/daily Daily SIM Usage Statistics
SIMApi simByIdDelete DELETE /api/v1/sim/{sim_id} Delete a SIM
SIMApi simByIdGet GET /api/v1/sim/{sim_id} SIM Details
SIMApi simByIdPatch PATCH /api/v1/sim/{sim_id} Update a SIM
SIMApi simEventPagePerPageSortBySimIdAndQGet GET /api/v1/sim/{sim_id}/event List SIM Events
SIMApi simPerPageSortByQAndPageGet GET /api/v1/sim List SIMs
SIMApi simStatsByIdGet GET /api/v1/sim/{sim_id}/stats SIM Usage and Cost Statistics
SIMApi simStatusGet GET /api/v1/sim/status List SIM Statuses
SIMApi validateSIMBatchByBIC GET /api/v1/sim_batch/bic/{bic} Validate if a given batch can be registered by BIC
ServiceLookupsAndConfigurationApi dnsByIdDelete DELETE /api/v1/dns/{dns_id} Delete DNS config
ServiceLookupsAndConfigurationApi dnsGet GET /api/v1/dns List DNS Configs
ServiceLookupsAndConfigurationApi dnsPost POST /api/v1/dns Create DNS config
ServiceLookupsAndConfigurationApi serviceGet GET /api/v1/service List Services
ServiceLookupsAndConfigurationApi serviceTrafficLimitByIdGet GET /api/v1/service/{service_id}/traffic_limit Get Service Traffic Limit
ServiceLookupsAndConfigurationApi trafficLimitGet GET /api/v1/traffic_limit List Traffic Limits
ServiceProfilesApi addTrafficLimit PUT /api/v1/service_profile/{profile_id}/service/{service_id}/traffic_limit/{limit_id} Add Traffic Limit to Service Profile
ServiceProfilesApi deleteQuotaByServiceProfileId DELETE /api/v1/service_profile/{profile_id}/quota/{quota_type} Remove all quotas of assigned endpoints
ServiceProfilesApi removeTrafficLimit DELETE /api/v1/service_profile/{profile_id}/service/{service_id}/traffic_limit/{limit_id} Remove Traffic Limit from a Service Profile
ServiceProfilesApi serviceProfileByProfileIdDelete DELETE /api/v1/service_profile/{profile_id} Delete a Service Profile
ServiceProfilesApi serviceProfileByProfileIdGet GET /api/v1/service_profile/{profile_id} Retrieve a Service Profile
ServiceProfilesApi serviceProfileByProfileIdPatch PATCH /api/v1/service_profile/{profile_id} Update Service Profile
ServiceProfilesApi serviceProfileGet GET /api/v1/service_profile List Service Profiles
ServiceProfilesApi serviceProfilePost POST /api/v1/service_profile Create Service Profile
ServiceProfilesApi serviceProfileServiceByProfileAndServiceDelete DELETE /api/v1/service_profile/{profile_id}/service/{service_id} Remove a Service from a Service Profile
ServiceProfilesApi serviceProfileServiceByProfileAndServicePut PUT /api/v1/service_profile/{profile_id}/service/{service_id} Add a Service to a Service Profile
TariffPlansApi getOrganisationActiveTariffPlan GET /api/v1/organisation/{org_id_or_my}/tariff_plan/active Get the active tariff plan for the given organisation
TariffPlansApi organisationTariffPlanByOrgIdGet GET /api/v1/organisation/{org_id}/tariff_plan List Organisation Tariff Plans
TariffProfilesApi tariffProfileByIdDelete DELETE /api/v1/tariff_profile/{tariff_profile_id} Delete Tariff Profile
TariffProfilesApi tariffProfileByIdGet GET /api/v1/tariff_profile/{tariff_profile_id} Tariff Profile Details
TariffProfilesApi tariffProfileByIdPatch PATCH /api/v1/tariff_profile/{tariff_profile_id} Update Tariff Profile
TariffProfilesApi tariffProfileCoverageByTpIdGet GET /api/v1/tariff_profile/{tariff_profile_id}/coverage List Tariff Profile Coverage
TariffProfilesApi tariffProfileGet GET /api/v1/tariff_profile List Tariff Profiles
TariffProfilesApi tariffProfileInclusiveVolumeAssignment PUT /api/v1/tariff_profile/{tariff_profile_id}/inclusive_volume/{inclusive_volume_id} Assign Inclusive Volume to Tarriff Profile
TariffProfilesApi tariffProfileInclusiveVolumeRemoveAssignment DELETE /api/v1/tariff_profile/{tariff_profile_id}/inclusive_volume/{inclusive_volume_id} Unassign Inclusive Volume from Tariff Profile
TariffProfilesApi tariffProfilePost POST /api/v1/tariff_profile Create Tariff Profile
TariffProfilesApi tariffProfileRatezoneSelectionByTpIdAndRzIdDelete DELETE /api/v1/tariff_profile/{tariff_profile_id}/ratezone_selection/{ratezone_id} Delete Ratezone from Tariff Profile
TariffProfilesApi tariffProfileRatezoneSelectionByTpIdAndRzIdPut PUT /api/v1/tariff_profile/{tariff_profile_id}/ratezone_selection/{ratezone_id} Assign Ratezone to Tarriff Profile
USSDApi endpointUssdByIdPost POST /api/v1/endpoint/{endpoint_id}/ussd Create USSD dialog
UserManagementApi userByIdDelete DELETE /api/v1/user/{user_id} Delete User by ID
UserManagementApi userByIdDeleteV2 DELETE /api/v2/user/{user_id} Delete User by ID
UserManagementApi userByIdGet GET /api/v1/user/{user_id} Get User by ID or Username
UserManagementApi userByIdPatch PATCH /api/v1/user/{user_id} Update User by ID
UserManagementApi userByIdV2CreateSupportToken POST /api/v2/user/{user_id}/support_token Create support access token for given user
UserManagementApi userEventPagePerPageSortByUserIdAndQGet GET /api/v1/user/{user_id}/event List User Events
UserManagementApi userPerPageSortByQAndPageGet GET /api/v1/user List User Accounts
UserManagementApi userPerPageSortByQAndPagePost POST /api/v1/user Create User
UserManagementApi userRoleByIdAndRoleIdDelete DELETE /api/v1/user/{user_id}/role/{role_id} Delete User Role
UserManagementApi userRoleByIdAndRoleIdPut PUT /api/v1/user/{user_id}/role/{role_id} Assign Role to User
UserManagementApi userRoleGet GET /api/v1/user/role List User Roles
UserManagementApi userRolePermissionByIdGet GET /api/v1/user/{user_id}/role/permission List User Role Permissions
UserManagementApi userStatusGet GET /api/v1/user/status List User Statuses

Documentation For Models

Documentation For Authorization

bearerAuth

  • Type: HTTP bearer authentication

Author

emnify/emnify-sdk 适用场景与选型建议

emnify/emnify-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 572 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 07 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「rest」 「api」 「sdk」 「swagger」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 emnify/emnify-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 emnify/emnify-sdk 我们能提供哪些服务?
定制开发 / 二次开发

基于 emnify/emnify-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-29