This SDK helps you connect your JavaScript applications to ARTIK Cloud. The SDK exposes a number of methods to easily execute REST API calls to ARTIK Cloud.
For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install artikcloud-js --save
The library is hosted at this git repository https://github.com/artikcloud/artikcloud-js then install it via:
npm install artikcloud/artikcloud-js --save
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Please follow the installation instruction and execute the following JS code:
var ArtikCloud = require('artikcloud-js');
var defaultClient = ArtikCloud.ApiClient.default;
// Configure OAuth2 access token for authorization: artikcloud_oauth
var artikcloud_oauth = defaultClient.authentications['artikcloud_oauth'];
artikcloud_oauth.accessToken = "YOUR ACCESS TOKEN"
var api = new ArtikCloud.DeviceTypesApi()
var deviceTypeId = "deviceTypeId_example"; // {String} deviceTypeId
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getAvailableManifestVersions(deviceTypeId, callback);
All URIs are relative to https://api.artik.cloud/v1.1
Class | Method | HTTP request | Description |
---|---|---|---|
ArtikCloud.DeviceTypesApi | getAvailableManifestVersions | GET /devicetypes/{deviceTypeId}/availablemanifestversions | Get Available Manifest Versions |
ArtikCloud.DeviceTypesApi | getDeviceType | GET /devicetypes/{deviceTypeId} | Get Device Type |
ArtikCloud.DeviceTypesApi | getDeviceTypes | GET /devicetypes | Get Device Types |
ArtikCloud.DeviceTypesApi | getLatestManifestProperties | GET /devicetypes/{deviceTypeId}/manifests/latest/properties | Get Latest Manifest Properties |
ArtikCloud.DeviceTypesApi | getManifestProperties | GET /devicetypes/{deviceTypeId}/manifests/{version}/properties | Get manifest properties |
ArtikCloud.DevicesApi | addDevice | POST /devices | Add Device |
ArtikCloud.DevicesApi | deleteDevice | DELETE /devices/{deviceId} | Delete Device |
ArtikCloud.DevicesApi | deleteDeviceToken | DELETE /devices/{deviceId}/tokens | Delete Device Token |
ArtikCloud.DevicesApi | getDevice | GET /devices/{deviceId} | Get Device |
ArtikCloud.DevicesApi | getDevicePresence | GET /devices/{deviceId}/presence | Get device presence information |
ArtikCloud.DevicesApi | getDeviceToken | GET /devices/{deviceId}/tokens | Get Device Token |
ArtikCloud.DevicesApi | updateDevice | PUT /devices/{deviceId} | Update Device |
ArtikCloud.DevicesApi | updateDeviceToken | PUT /devices/{deviceId}/tokens | Update Device Token |
ArtikCloud.ExportApi | exportRequest | POST /messages/export | Create Export Request |
ArtikCloud.ExportApi | getExportHistory | GET /messages/export/history | Get Export History |
ArtikCloud.ExportApi | getExportResult | GET /messages/export/{exportId}/result | Get Export Result |
ArtikCloud.ExportApi | getExportStatus | GET /messages/export/{exportId}/status | Check Export Status |
ArtikCloud.MessagesApi | getAggregatesHistogram | GET /messages/analytics/histogram | Get Normalized Message Histogram |
ArtikCloud.MessagesApi | getFieldPresence | GET /messages/presence | Get normalized message presence |
ArtikCloud.MessagesApi | getLastNormalizedMessages | GET /messages/last | Get Last Normalized Message |
ArtikCloud.MessagesApi | getMessageAggregates | GET /messages/analytics/aggregates | Get Normalized Message Aggregates |
ArtikCloud.MessagesApi | getMessageSnapshots | GET /messages/snapshots | Get Message Snapshots |
ArtikCloud.MessagesApi | getNormalizedActions | GET /actions | Get Normalized Actions |
ArtikCloud.MessagesApi | getNormalizedMessages | GET /messages | Get Normalized Messages |
ArtikCloud.MessagesApi | sendActions | POST /actions | Send Actions |
ArtikCloud.MessagesApi | sendMessage | POST /messages | Send Message |
ArtikCloud.RegistrationsApi | confirmUser | PUT /devices/registrations/pin | Confirm User |
ArtikCloud.RegistrationsApi | getRequestStatusForUser | GET /devices/registrations/{requestId}/status | Get Request Status For User |
ArtikCloud.RegistrationsApi | unregisterDevice | DELETE /devices/{deviceId}/registrations | Unregister Device |
ArtikCloud.RulesApi | createRule | POST /rules | Create Rule |
ArtikCloud.RulesApi | deleteRule | DELETE /rules/{ruleId} | Delete Rule |
ArtikCloud.RulesApi | getRule | GET /rules/{ruleId} | Get Rule |
ArtikCloud.RulesApi | updateRule | PUT /rules/{ruleId} | Update Rule |
ArtikCloud.TagsApi | getTagCategories | GET /tags/categories | Get all categories |
ArtikCloud.TagsApi | getTagSuggestions | GET /tags/suggestions | Get tag suggestions |
ArtikCloud.TagsApi | getTagsByCategories | GET /tags | Get all tags of categories |
ArtikCloud.TokensApi | checkToken | POST /accounts/checkToken | Check Token |
ArtikCloud.TokensApi | refreshToken | POST /accounts/token | Refresh Token |
ArtikCloud.TokensApi | tokenInfo | GET /accounts/tokenInfo | Token Info |
ArtikCloud.UsersApi | createUserProperties | POST /users/{userId}/properties | Create User Application Properties |
ArtikCloud.UsersApi | deleteUserProperties | DELETE /users/{userId}/properties | Delete User Application Properties |
ArtikCloud.UsersApi | getSelf | GET /users/self | Get Current User Profile |
ArtikCloud.UsersApi | getUserDeviceTypes | GET /users/{userId}/devicetypes | Get User Device Types |
ArtikCloud.UsersApi | getUserDevices | GET /users/{userId}/devices | Get User Devices |
ArtikCloud.UsersApi | getUserProperties | GET /users/{userId}/properties | Get User application properties |
ArtikCloud.UsersApi | getUserRules | GET /users/{userId}/rules | Get User Rules |
ArtikCloud.UsersApi | updateUserProperties | PUT /users/{userId}/properties | Update User Application Properties |
- ArtikCloud.AckEnvelope
- ArtikCloud.Acknowledgement
- ArtikCloud.Action
- ArtikCloud.ActionArray
- ArtikCloud.ActionDetails
- ArtikCloud.ActionDetailsArray
- ArtikCloud.ActionIn
- ArtikCloud.ActionOut
- ArtikCloud.Actions
- ArtikCloud.AggregateData
- ArtikCloud.AggregatesHistogramData
- ArtikCloud.AggregatesHistogramResponse
- ArtikCloud.AggregatesResponse
- ArtikCloud.AppProperties
- ArtikCloud.CheckTokenMessage
- ArtikCloud.CheckTokenResponse
- ArtikCloud.Device
- ArtikCloud.DeviceArray
- ArtikCloud.DeviceEnvelope
- ArtikCloud.DeviceRegCompleteRequest
- ArtikCloud.DeviceRegConfirmUserRequest
- ArtikCloud.DeviceRegConfirmUserResponse
- ArtikCloud.DeviceRegConfirmUserResponseEnvelope
- ArtikCloud.DeviceRegStatusResponse
- ArtikCloud.DeviceRegStatusResponseEnvelope
- ArtikCloud.DeviceToken
- ArtikCloud.DeviceTokenEnvelope
- ArtikCloud.DeviceType
- ArtikCloud.DeviceTypeArray
- ArtikCloud.DeviceTypeEnvelope
- ArtikCloud.DeviceTypesEnvelope
- ArtikCloud.DevicesEnvelope
- ArtikCloud.ErrorEnvelope
- ArtikCloud.ExportData
- ArtikCloud.ExportDataArray
- ArtikCloud.ExportHistoryResponse
- ArtikCloud.ExportNormalizedMessagesResponse
- ArtikCloud.ExportRequest
- ArtikCloud.ExportRequestData
- ArtikCloud.ExportRequestInfo
- ArtikCloud.ExportRequestResponse
- ArtikCloud.ExportResponse
- ArtikCloud.ExportStatusResponse
- ArtikCloud.FieldPath
- ArtikCloud.FieldPresence
- ArtikCloud.FieldPresenceEnvelope
- ArtikCloud.FieldsActions
- ArtikCloud.ManifestProperties
- ArtikCloud.ManifestPropertiesEnvelope
- ArtikCloud.ManifestVersions
- ArtikCloud.ManifestVersionsEnvelope
- ArtikCloud.Message
- ArtikCloud.MessageAction
- ArtikCloud.MessageID
- ArtikCloud.MessageIDEnvelope
- ArtikCloud.MessageIn
- ArtikCloud.MessageOut
- ArtikCloud.NonEmptyString
- ArtikCloud.NormalizedAction
- ArtikCloud.NormalizedActionsEnvelope
- ArtikCloud.NormalizedMessage
- ArtikCloud.NormalizedMessagesEnvelope
- ArtikCloud.OutputRule
- ArtikCloud.PresenceEnvelope
- ArtikCloud.PresenceModel
- ArtikCloud.PropertiesEnvelope
- ArtikCloud.RefreshTokenResponse
- ArtikCloud.RegisterMessage
- ArtikCloud.RuleArray
- ArtikCloud.RuleCreationInfo
- ArtikCloud.RuleEnvelope
- ArtikCloud.RuleError
- ArtikCloud.RuleUpdateInfo
- ArtikCloud.RuleWarningOutput
- ArtikCloud.RulesEnvelope
- ArtikCloud.SnapshotResponse
- ArtikCloud.SnapshotResponses
- ArtikCloud.SnapshotsResponseEnvelope
- ArtikCloud.Tag
- ArtikCloud.TagArray
- ArtikCloud.TagsEnvelope
- ArtikCloud.Token
- ArtikCloud.TokenInfo
- ArtikCloud.TokenInfoSuccessResponse
- ArtikCloud.TokenRequest
- ArtikCloud.TokenResponse
- ArtikCloud.UnregisterDeviceResponse
- ArtikCloud.UnregisterDeviceResponseEnvelope
- ArtikCloud.User
- ArtikCloud.UserEnvelope
- ArtikCloud.WebSocketError
- Type: OAuth
- Flow: implicit
- Authorizatoin URL: https://accounts.artik.cloud/authorize
- Scopes:
- read:artikcloud: Read from ARTIK Cloud
- write:artikcloud: Write from 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/cloud
Licensed under the Apache License. See LICENSE.
Copyright (c) 2016 Samsung Electronics Co., Ltd.