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 ArtikCloudApi = require('artikcloud-js');
var defaultClient = ArtikCloudApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: artikcloud_oauth
var artikcloud_oauth = defaultClient.authentications['artikcloud_oauth'];
artikcloud_oauth.accessToken = "YOUR ACCESS TOKEN"
var api = new ArtikCloudApi.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 |
---|---|---|---|
ArtikCloudApi.DeviceTypesApi | getAvailableManifestVersions | GET /devicetypes/{deviceTypeId}/availablemanifestversions | Get Available Manifest Versions |
ArtikCloudApi.DeviceTypesApi | getDeviceType | GET /devicetypes/{deviceTypeId} | Get Device Type |
ArtikCloudApi.DeviceTypesApi | getDeviceTypes | GET /devicetypes | Get Device Types |
ArtikCloudApi.DeviceTypesApi | getLatestManifestProperties | GET /devicetypes/{deviceTypeId}/manifests/latest/properties | Get Latest Manifest Properties |
ArtikCloudApi.DeviceTypesApi | getManifestProperties | GET /devicetypes/{deviceTypeId}/manifests/{version}/properties | Get manifest properties |
ArtikCloudApi.DevicesApi | addDevice | POST /devices | Add Device |
ArtikCloudApi.DevicesApi | deleteDevice | DELETE /devices/{deviceId} | Delete Device |
ArtikCloudApi.DevicesApi | deleteDeviceToken | DELETE /devices/{deviceId}/tokens | Delete Device Token |
ArtikCloudApi.DevicesApi | getDevice | GET /devices/{deviceId} | Get Device |
ArtikCloudApi.DevicesApi | getDeviceToken | GET /devices/{deviceId}/tokens | Get Device Token |
ArtikCloudApi.DevicesApi | updateDevice | PUT /devices/{deviceId} | Update Device |
ArtikCloudApi.DevicesApi | updateDeviceToken | PUT /devices/{deviceId}/tokens | Update Device Token |
ArtikCloudApi.ExportApi | exportRequest | POST /messages/export | Create Export Request |
ArtikCloudApi.ExportApi | getExportHistory | GET /messages/export/history | Get Export History |
ArtikCloudApi.ExportApi | getExportResult | GET /messages/export/{exportId}/result | Get Export Result |
ArtikCloudApi.ExportApi | getExportStatus | GET /messages/export/{exportId}/status | Check Export Status |
ArtikCloudApi.MessagesApi | getAggregatesHistogram | GET /messages/analytics/histogram | Get Histogram aggregates |
ArtikCloudApi.MessagesApi | getFieldPresence | GET /messages/presence | Get normalized message presence |
ArtikCloudApi.MessagesApi | getLastNormalizedMessages | GET /messages/last | Get Last Normalized Message |
ArtikCloudApi.MessagesApi | getMessageAggregates | GET /messages/analytics/aggregates | Get Normalized Message Aggregates |
ArtikCloudApi.MessagesApi | getNormalizedMessages | GET /messages | Get Normalized Messages |
ArtikCloudApi.MessagesApi | sendMessageAction | POST /messages | Send Message Action |
ArtikCloudApi.RegistrationsApi | confirmUser | PUT /devices/registrations/pin | Confirm User |
ArtikCloudApi.RegistrationsApi | getRequestStatusForUser | GET /devices/registrations/{requestId}/status | Get Request Status For User |
ArtikCloudApi.RegistrationsApi | unregisterDevice | DELETE /devices/{deviceId}/registrations | Unregister Device |
ArtikCloudApi.RulesApi | createRule | POST /rules | Create Rule |
ArtikCloudApi.RulesApi | deleteRule | DELETE /rules/{ruleId} | Delete Rule |
ArtikCloudApi.RulesApi | getRule | GET /rules/{ruleId} | Get Rule |
ArtikCloudApi.RulesApi | updateRule | PUT /rules/{ruleId} | Update Rule |
ArtikCloudApi.TagsApi | getTagCategories | GET /tags/categories | Get all categories |
ArtikCloudApi.TagsApi | getTagSuggestions | GET /tags/suggestions | Get tag suggestions |
ArtikCloudApi.TagsApi | getTagsByCategories | GET /tags | Get all tags of categories |
ArtikCloudApi.TokensApi | checkToken | POST /checkToken | Check Token |
ArtikCloudApi.TokensApi | refreshToken | POST /token | Refresh Token |
ArtikCloudApi.UsersApi | createUserProperties | POST /users/{userId}/properties | Create User Application Properties |
ArtikCloudApi.UsersApi | deleteUserProperties | DELETE /users/{userId}/properties | Delete User Application Properties |
ArtikCloudApi.UsersApi | getSelf | GET /users/self | Get Current User Profile |
ArtikCloudApi.UsersApi | getUserDeviceTypes | GET /users/{userId}/devicetypes | Get User Device Types |
ArtikCloudApi.UsersApi | getUserDevices | GET /users/{userId}/devices | Get User Devices |
ArtikCloudApi.UsersApi | getUserProperties | GET /users/{userId}/properties | Get User application properties |
ArtikCloudApi.UsersApi | getUserRules | GET /users/{userId}/rules | Get User Rules |
ArtikCloudApi.UsersApi | updateUserProperties | PUT /users/{userId}/properties | Update User Application Properties |
- ArtikCloudApi.AckEnvelope
- ArtikCloudApi.Acknowledgement
- ArtikCloudApi.ActionDetails
- ArtikCloudApi.ActionDetailsArray
- ArtikCloudApi.ActionIn
- ArtikCloudApi.ActionOut
- ArtikCloudApi.AggregateData
- ArtikCloudApi.AggregatesHistogramData
- ArtikCloudApi.AggregatesHistogramResponse
- ArtikCloudApi.AggregatesResponse
- ArtikCloudApi.AppProperties
- ArtikCloudApi.CheckTokenMessage
- ArtikCloudApi.CheckTokenResponse
- ArtikCloudApi.Device
- ArtikCloudApi.DeviceArray
- ArtikCloudApi.DeviceEnvelope
- ArtikCloudApi.DeviceRegCompleteRequest
- ArtikCloudApi.DeviceRegConfirmUserRequest
- ArtikCloudApi.DeviceRegConfirmUserResponse
- ArtikCloudApi.DeviceRegConfirmUserResponseEnvelope
- ArtikCloudApi.DeviceRegStatusResponse
- ArtikCloudApi.DeviceRegStatusResponseEnvelope
- ArtikCloudApi.DeviceToken
- ArtikCloudApi.DeviceTokenEnvelope
- ArtikCloudApi.DeviceType
- ArtikCloudApi.DeviceTypeArray
- ArtikCloudApi.DeviceTypeEnvelope
- ArtikCloudApi.DeviceTypesEnvelope
- ArtikCloudApi.DevicesEnvelope
- ArtikCloudApi.ErrorEnvelope
- ArtikCloudApi.ExportData
- ArtikCloudApi.ExportDataArray
- ArtikCloudApi.ExportHistoryResponse
- ArtikCloudApi.ExportNormalizedMessagesResponse
- ArtikCloudApi.ExportRequest
- ArtikCloudApi.ExportRequestData
- ArtikCloudApi.ExportRequestInfo
- ArtikCloudApi.ExportRequestResponse
- ArtikCloudApi.ExportResponse
- ArtikCloudApi.ExportStatusResponse
- ArtikCloudApi.FieldPath
- ArtikCloudApi.FieldPresence
- ArtikCloudApi.FieldPresenceEnvelope
- ArtikCloudApi.FieldsActions
- ArtikCloudApi.ManifestProperties
- ArtikCloudApi.ManifestPropertiesEnvelope
- ArtikCloudApi.ManifestVersions
- ArtikCloudApi.ManifestVersionsEnvelope
- ArtikCloudApi.MessageAction
- ArtikCloudApi.MessageID
- ArtikCloudApi.MessageIDEnvelope
- ArtikCloudApi.MessageIn
- ArtikCloudApi.MessageOut
- ArtikCloudApi.NonEmptyString
- ArtikCloudApi.NormalizedMessage
- ArtikCloudApi.NormalizedMessagesEnvelope
- ArtikCloudApi.OutputRule
- ArtikCloudApi.PropertiesEnvelope
- ArtikCloudApi.RefreshTokenResponse
- ArtikCloudApi.RegisterMessage
- ArtikCloudApi.RuleArray
- ArtikCloudApi.RuleCreationInfo
- ArtikCloudApi.RuleEnvelope
- ArtikCloudApi.RuleError
- ArtikCloudApi.RuleUpdateInfo
- ArtikCloudApi.RuleWarningOutput
- ArtikCloudApi.RulesEnvelope
- ArtikCloudApi.Tag
- ArtikCloudApi.TagArray
- ArtikCloudApi.TagsEnvelope
- ArtikCloudApi.Token
- ArtikCloudApi.TokenRequest
- ArtikCloudApi.TokenResponse
- ArtikCloudApi.UnregisterDeviceResponse
- ArtikCloudApi.UnregisterDeviceResponseEnvelope
- ArtikCloudApi.User
- ArtikCloudApi.UserEnvelope
- ArtikCloudApi.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.