artikcloud/artikcloud-php

ARTIK Cloud PHP SDK


Keywords
php, api, sdk, artikcloud
License
Other

Documentation

ARTIK Cloud PHP SDK

This SDK helps you connect your PHP scripts to ARTIK Cloud. The SDK exposes a number of methods to easily execute REST API calls to ARTIK Cloud.

  • Package version: 2.2.3

Requirements

PHP 5.5.0 and later

Installation & Usage

Composer

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

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/artikcloud/artikcloud-php.git"
    }
  ],
  "require": {
    "artikcloud/artikcloud-php": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/./autoload.php');

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');

// Configure OAuth2 access token for authorization: artikcloud_oauth
ArtikCloud\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new ArtikCloud\Api\DeviceTypesApi();
$device_type_id = "device_type_id_example"; // string | deviceTypeId

try {
    $result = $api_instance->getAvailableManifestVersions($device_type_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DeviceTypesApi->getAvailableManifestVersions: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://api.artik.cloud/v1.1

Class Method HTTP request Description
DeviceTypesApi getAvailableManifestVersions GET /devicetypes/{deviceTypeId}/availablemanifestversions Get Available Manifest Versions
DeviceTypesApi getDeviceType GET /devicetypes/{deviceTypeId} Get Device Type
DeviceTypesApi getDeviceTypes GET /devicetypes Get Device Types
DeviceTypesApi getDeviceTypesByApplication GET /applications/{appId}/devicetypes Get Device Types by Application
DeviceTypesApi getLatestManifestProperties GET /devicetypes/{deviceTypeId}/manifests/latest/properties Get Latest Manifest Properties
DeviceTypesApi getManifestProperties GET /devicetypes/{deviceTypeId}/manifests/{version}/properties Get manifest properties
DevicesApi addDevice POST /devices Add Device
DevicesApi deleteDevice DELETE /devices/{deviceId} Delete Device
DevicesApi deleteDeviceToken DELETE /devices/{deviceId}/tokens Delete Device Token
DevicesApi getDevice GET /devices/{deviceId} Get Device
DevicesApi getDevicePresence GET /devices/{deviceId}/presence Get device presence information
DevicesApi getDeviceToken GET /devices/{deviceId}/tokens Get Device Token
DevicesApi updateDevice PUT /devices/{deviceId} Update Device
DevicesApi updateDeviceToken PUT /devices/{deviceId}/tokens Update Device Token
DevicesManagementApi createTasks POST /devicemgmt/tasks Create a new task for one or more devices
DevicesManagementApi deleteServerProperties DELETE /devicemgmt/devices/{did}/serverproperties Deletes a device's properties.
DevicesManagementApi getAllByDid GET /devicemgmt/devices/{did}/tasks Returns the list of tasks for a particular device id with optional status filter.
DevicesManagementApi getDeviceTypesInfo GET /devicemgmt/devicetypes/{dtid} Read a device type device management information.
DevicesManagementApi getManifestProperties GET /devicemgmt/devicetypes/{dtid}/manifest/properties Get a device type's device management manifest properties
DevicesManagementApi getProperties GET /devicemgmt/devices/{did}/properties Read a device's properties.
DevicesManagementApi getStatuses GET /devicemgmt/tasks/{tid}/statuses Returns the details and status of a task id and the individual statuses of each device id in the list.
DevicesManagementApi getStatusesHistory GET /devicemgmt/tasks/{tid}/statuses/history Returns the history of the status changes for a specific task id, or for a specific device id in that task.
DevicesManagementApi getTaskByID GET /devicemgmt/tasks/{tid} Returns the details and global status of a specific task id.
DevicesManagementApi getTasks GET /devicemgmt/tasks Returns the all the tasks for a device type.
DevicesManagementApi queryProperties GET /devicemgmt/devices/properties Query device properties across devices.
DevicesManagementApi updateDeviceTypesInfo PUT /devicemgmt/devicetypes/{dtid} Updates a device type information
DevicesManagementApi updateServerProperties POST /devicemgmt/devices/{did}/serverproperties Updates a device's server properties.
DevicesManagementApi updateTask PUT /devicemgmt/tasks/{tid} Updates a task for all devices - For now just allows changing the state to cancelled.
DevicesManagementApi updateTaskForDevice PUT /devicemgmt/tasks/{tid}/devices/{did} Updates a task for a specific device - For now just allows changing the state to cancelled.
DevicesSharesApi createShareForDevice POST /devices/{deviceId}/shares Share a device
DevicesSharesApi deleteSharingForDevice DELETE /devices/{deviceId}/shares/{shareId} Delete specific share of the given device id
DevicesSharesApi getAllSharesForDevice GET /devices/{deviceId}/shares List all shares for the given device id
DevicesSharesApi getSharingForDevice GET /devices/{deviceId}/shares/{shareId} Get specific share of the given device id
DevicesStatusApi getDeviceStatus GET /devices/{deviceId}/status Get Device Status
DevicesStatusApi getDevicesStatus GET /devices/status Get Devices Status
DevicesStatusApi putDeviceStatus PUT /devices/{deviceId}/status Update Device Status
ExportApi exportRequest POST /messages/export Create Export Request
ExportApi getExportHistory GET /messages/export/history Get Export History
ExportApi getExportResult GET /messages/export/{exportId}/result Get Export Result
ExportApi getExportStatus GET /messages/export/{exportId}/status Check Export Status
MessagesApi getAggregatesHistogram GET /messages/analytics/histogram Get Normalized Message Histogram
MessagesApi getFieldPresence GET /messages/presence Get normalized message presence
MessagesApi getLastNormalizedMessages GET /messages/last Get Last Normalized Message
MessagesApi getMessageAggregates GET /messages/analytics/aggregates Get Normalized Message Aggregates
MessagesApi getMessageSnapshots GET /messages/snapshots Get Message Snapshots
MessagesApi getNormalizedActions GET /actions Get Normalized Actions
MessagesApi getNormalizedMessages GET /messages Get Normalized Messages
MessagesApi sendActions POST /actions Send Actions
MessagesApi sendMessage POST /messages Send Message
MonetizationApi createPricingTiers POST /pricing/devicetypes/{dtid}/pricingtiers Define devicetype's pricing tiers.
MonetizationApi getPricingTiers GET /pricing/devices/{did}/pricingtiers Get a device's pricing tiers
MonetizationApi getThePricingTiers GET /pricing/devicetypes/{dtid}/pricingtiers Get devicetype's pricing tiers.
MonetizationApi getUpgradePath GET /pricing/devices/{did}/revenueshare/upgradepath Get upgrade path
MonetizationApi setPricingTier PUT /pricing/devices/{did}/pricingtiers Set a device's pricing tier
RegistrationsApi confirmUser PUT /devices/registrations/pin Confirm User
RegistrationsApi getRequestStatusForUser GET /devices/registrations/{requestId}/status Get Request Status For User
RegistrationsApi unregisterDevice DELETE /devices/{deviceId}/registrations Unregister Device
RulesApi createRule POST /rules Create Rule
RulesApi deleteRule DELETE /rules/{ruleId} Delete Rule
RulesApi getRule GET /rules/{ruleId} Get Rule
RulesApi updateRule PUT /rules/{ruleId} Update Rule
SubscriptionsApi createSubscription POST /subscriptions Create Subscription
SubscriptionsApi deleteSubscription DELETE /subscriptions/{subId} Delete Subscription
SubscriptionsApi getAllSubscriptions GET /subscriptions Get All Subscriptions
SubscriptionsApi getMessages GET /notifications/{notifId}/messages Get Messages
SubscriptionsApi getSubscription GET /subscriptions/{subId} Get Subscription
SubscriptionsApi validateSubscription POST /subscriptions/{subId}/validate Validate Subscription
TagsApi getTagCategories GET /tags/categories Get all categories
TagsApi getTagSuggestions GET /tags/suggestions Get tag suggestions
TagsApi getTagsByCategories GET /tags Get all tags of categories
TokensApi checkToken POST /accounts/checkToken Check Token
TokensApi refreshToken POST /accounts/token Refresh Token
TokensApi tokenInfo GET /accounts/tokenInfo Token Info
UsersApi createUserProperties POST /users/{userId}/properties Create User Application Properties
UsersApi deleteUserProperties DELETE /users/{userId}/properties Delete User Application Properties
UsersApi getSelf GET /users/self Get Current User Profile
UsersApi getUserDeviceTypes GET /users/{userId}/devicetypes Get User Device Types
UsersApi getUserDevices GET /users/{userId}/devices Get User Devices
UsersApi getUserProperties GET /users/{userId}/properties Get User application properties
UsersApi getUserRules GET /users/{userId}/rules Get User Rules
UsersApi listAllSharesForUser GET /users/{userId}/shares Get User shares
UsersApi updateUserProperties PUT /users/{userId}/properties Update User Application Properties
WhitelistingApi deleteVdid DELETE /devicetypes/{dtid}/whitelist/{vdid} Delete a vdid from the devicetype whitelist.
WhitelistingApi deleteWhitelistCertificate DELETE /devicetypes/{dtid}/whitelist/certificates/{cid} Delete a whitelist certificate associated with a devicetype.
WhitelistingApi enableWhitelist PUT /devicetypes/:dtid/whitelist/enable Enable or disble whitelist feature of a device type
WhitelistingApi getRejectedRowList GET /devicetypes/{dtid}/whitelist/{uploadId}/rejectedRows Get the list of rejected rows for an uploaded CSV file.
WhitelistingApi getUploadStatus GET /devicetypes/{dtid}/whitelist/{uploadId}/status Get the status of a uploaded CSV file.
WhitelistingApi getWhitelist GET /devicetypes/{dtid}/whitelist Get whitelisted vdids of a device type.
WhitelistingApi getWhitelistCertificate GET /devicetypes/{dtid}/whitelist/certificates Get whitelist certificate of device type.
WhitelistingApi getWhitelistStatus GET /devicetypes/{dtid}/whitelist/status Get the status of whitelist feature (enabled/disabled) of a device type.
WhitelistingApi uploadCSV POST /devicetypes/{dtid}/whitelist Upload a CSV file related to the Device Type.

Documentation For Models

Documentation For Authorization

artikcloud_oauth

Usage

Peek into tests for examples about how to use the SDK.

More about ARTIK Cloud

If you are not familiar with ARTIK Cloud, we have extensive documentation at https://developer.artik.cloud/documentation

The full ARTIK Cloud API specification can be found at https://developer.artik.cloud/documentation/api-reference/

Check out advanced sample applications at https://developer.artik.cloud/documentation/samples/

To create and manage your services and devices on ARTIK Cloud, create an account at https://developer.artik.cloud

Also see the ARTIK Cloud blog for tutorials, updates, and more: http://artik.io/blog

License and Copyright

Licensed under the Apache License. See LICENSE.