This SDK helps you connect your iOS or OS X applications to ARTIK Cloud. It exposes a number of methods to easily execute REST API calls to ARTIK Cloud.
The SDK requires ARC (Automatic Reference Counting) to be enabled in the Xcode project.
Install from Github using CocoaPods
Add the following to the Podfile:
pod 'ArtikCloud', :git => 'https://github.com/artikcloud/artikcloud-objc.git'
To specify a particular branch, append , :branch => 'branch-name-here'
To specify a particular commit, append , :commit => '11aa22'
Install from local path using CocoaPods
Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/ArtikCloud) and then add the following to the Podfile:
pod 'ArtikCloud', :path => 'Vendor/ArtikCloud'
Import the following:
#import <ArtikCloud/ACApiClient.h>
#import <ArtikCloud/ACConfiguration.h>
// load models
#import <ArtikCloud/ACAckEnvelope.h>
#import <ArtikCloud/ACAcknowledgement.h>
#import <ArtikCloud/ACAction.h>
#import <ArtikCloud/ACActionArray.h>
#import <ArtikCloud/ACActionDetails.h>
#import <ArtikCloud/ACActionDetailsArray.h>
#import <ArtikCloud/ACActionIn.h>
#import <ArtikCloud/ACActionOut.h>
#import <ArtikCloud/ACActions.h>
#import <ArtikCloud/ACAggregateData.h>
#import <ArtikCloud/ACAggregatesHistogramData.h>
#import <ArtikCloud/ACAggregatesHistogramResponse.h>
#import <ArtikCloud/ACAggregatesResponse.h>
#import <ArtikCloud/ACAppProperties.h>
#import <ArtikCloud/ACCheckTokenMessage.h>
#import <ArtikCloud/ACCheckTokenResponse.h>
#import <ArtikCloud/ACDevice.h>
#import <ArtikCloud/ACDeviceArray.h>
#import <ArtikCloud/ACDeviceEnvelope.h>
#import <ArtikCloud/ACDeviceRegCompleteRequest.h>
#import <ArtikCloud/ACDeviceRegConfirmUserRequest.h>
#import <ArtikCloud/ACDeviceRegConfirmUserResponse.h>
#import <ArtikCloud/ACDeviceRegConfirmUserResponseEnvelope.h>
#import <ArtikCloud/ACDeviceRegStatusResponse.h>
#import <ArtikCloud/ACDeviceRegStatusResponseEnvelope.h>
#import <ArtikCloud/ACDeviceToken.h>
#import <ArtikCloud/ACDeviceTokenEnvelope.h>
#import <ArtikCloud/ACDeviceType.h>
#import <ArtikCloud/ACDeviceTypeArray.h>
#import <ArtikCloud/ACDeviceTypeEnvelope.h>
#import <ArtikCloud/ACDeviceTypesEnvelope.h>
#import <ArtikCloud/ACDevicesEnvelope.h>
#import <ArtikCloud/ACErrorEnvelope.h>
#import <ArtikCloud/ACExportData.h>
#import <ArtikCloud/ACExportDataArray.h>
#import <ArtikCloud/ACExportHistoryResponse.h>
#import <ArtikCloud/ACExportNormalizedMessagesResponse.h>
#import <ArtikCloud/ACExportRequest.h>
#import <ArtikCloud/ACExportRequestData.h>
#import <ArtikCloud/ACExportRequestInfo.h>
#import <ArtikCloud/ACExportRequestResponse.h>
#import <ArtikCloud/ACExportResponse.h>
#import <ArtikCloud/ACExportStatusResponse.h>
#import <ArtikCloud/ACFieldPath.h>
#import <ArtikCloud/ACFieldPresence.h>
#import <ArtikCloud/ACFieldPresenceEnvelope.h>
#import <ArtikCloud/ACFieldsActions.h>
#import <ArtikCloud/ACManifestProperties.h>
#import <ArtikCloud/ACManifestPropertiesEnvelope.h>
#import <ArtikCloud/ACManifestVersions.h>
#import <ArtikCloud/ACManifestVersionsEnvelope.h>
#import <ArtikCloud/ACMessage.h>
#import <ArtikCloud/ACMessageAction.h>
#import <ArtikCloud/ACMessageID.h>
#import <ArtikCloud/ACMessageIDEnvelope.h>
#import <ArtikCloud/ACMessageIn.h>
#import <ArtikCloud/ACMessageOut.h>
#import <ArtikCloud/ACNonEmptyString.h>
#import <ArtikCloud/ACNormalizedAction.h>
#import <ArtikCloud/ACNormalizedActionsEnvelope.h>
#import <ArtikCloud/ACNormalizedMessage.h>
#import <ArtikCloud/ACNormalizedMessagesEnvelope.h>
#import <ArtikCloud/ACOutputRule.h>
#import <ArtikCloud/ACPresenceEnvelope.h>
#import <ArtikCloud/ACPresenceModel.h>
#import <ArtikCloud/ACPropertiesEnvelope.h>
#import <ArtikCloud/ACRefreshTokenResponse.h>
#import <ArtikCloud/ACRegisterMessage.h>
#import <ArtikCloud/ACRuleArray.h>
#import <ArtikCloud/ACRuleCreationInfo.h>
#import <ArtikCloud/ACRuleEnvelope.h>
#import <ArtikCloud/ACRuleError.h>
#import <ArtikCloud/ACRuleUpdateInfo.h>
#import <ArtikCloud/ACRuleWarningOutput.h>
#import <ArtikCloud/ACRulesEnvelope.h>
#import <ArtikCloud/ACSnapshotResponse.h>
#import <ArtikCloud/ACSnapshotResponses.h>
#import <ArtikCloud/ACSnapshotsResponseEnvelope.h>
#import <ArtikCloud/ACTag.h>
#import <ArtikCloud/ACTagArray.h>
#import <ArtikCloud/ACTagsEnvelope.h>
#import <ArtikCloud/ACToken.h>
#import <ArtikCloud/ACTokenInfo.h>
#import <ArtikCloud/ACTokenInfoSuccessResponse.h>
#import <ArtikCloud/ACTokenRequest.h>
#import <ArtikCloud/ACTokenResponse.h>
#import <ArtikCloud/ACUnregisterDeviceResponse.h>
#import <ArtikCloud/ACUnregisterDeviceResponseEnvelope.h>
#import <ArtikCloud/ACUser.h>
#import <ArtikCloud/ACUserEnvelope.h>
#import <ArtikCloud/ACWebSocketError.h>
// load API classes for accessing endpoints
#import <ArtikCloud/ACDeviceTypesApi.h>
#import <ArtikCloud/ACDevicesApi.h>
#import <ArtikCloud/ACExportApi.h>
#import <ArtikCloud/ACMessagesApi.h>
#import <ArtikCloud/ACRegistrationsApi.h>
#import <ArtikCloud/ACRulesApi.h>
#import <ArtikCloud/ACTagsApi.h>
#import <ArtikCloud/ACTokensApi.h>
#import <ArtikCloud/ACUsersApi.h>
It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issue.
Please follow the installation procedure and then run the following:
ACConfiguration *apiConfig = [ACConfiguration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: artikcloud_oauth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
NSString* *deviceTypeId = @"deviceTypeId_example"; // deviceTypeId
ACDeviceTypesApi *apiInstance = [[ACDeviceTypesApi alloc] init];
// Get Available Manifest Versions
[apiInstance getAvailableManifestVersionsWithDeviceTypeId:deviceTypeId
completionHandler: ^(ACManifestVersionsEnvelope* output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
All URIs are relative to https://api.artik.cloud/v1.1
Class | Method | HTTP request | Description |
---|---|---|---|
ACDeviceTypesApi | getAvailableManifestVersions | GET /devicetypes/{deviceTypeId}/availablemanifestversions | Get Available Manifest Versions |
ACDeviceTypesApi | getDeviceType | GET /devicetypes/{deviceTypeId} | Get Device Type |
ACDeviceTypesApi | getDeviceTypes | GET /devicetypes | Get Device Types |
ACDeviceTypesApi | getLatestManifestProperties | GET /devicetypes/{deviceTypeId}/manifests/latest/properties | Get Latest Manifest Properties |
ACDeviceTypesApi | getManifestProperties | GET /devicetypes/{deviceTypeId}/manifests/{version}/properties | Get manifest properties |
ACDevicesApi | addDevice | POST /devices | Add Device |
ACDevicesApi | deleteDevice | DELETE /devices/{deviceId} | Delete Device |
ACDevicesApi | deleteDeviceToken | DELETE /devices/{deviceId}/tokens | Delete Device Token |
ACDevicesApi | getDevice | GET /devices/{deviceId} | Get Device |
ACDevicesApi | getDevicePresence | GET /devices/{deviceId}/presence | Get device presence information |
ACDevicesApi | getDeviceToken | GET /devices/{deviceId}/tokens | Get Device Token |
ACDevicesApi | updateDevice | PUT /devices/{deviceId} | Update Device |
ACDevicesApi | updateDeviceToken | PUT /devices/{deviceId}/tokens | Update Device Token |
ACExportApi | exportRequest | POST /messages/export | Create Export Request |
ACExportApi | getExportHistory | GET /messages/export/history | Get Export History |
ACExportApi | getExportResult | GET /messages/export/{exportId}/result | Get Export Result |
ACExportApi | getExportStatus | GET /messages/export/{exportId}/status | Check Export Status |
ACMessagesApi | getAggregatesHistogram | GET /messages/analytics/histogram | Get Normalized Message Histogram |
ACMessagesApi | getFieldPresence | GET /messages/presence | Get normalized message presence |
ACMessagesApi | getLastNormalizedMessages | GET /messages/last | Get Last Normalized Message |
ACMessagesApi | getMessageAggregates | GET /messages/analytics/aggregates | Get Normalized Message Aggregates |
ACMessagesApi | getMessageSnapshots | GET /messages/snapshots | Get Message Snapshots |
ACMessagesApi | getNormalizedActions | GET /actions | Get Normalized Actions |
ACMessagesApi | getNormalizedMessages | GET /messages | Get Normalized Messages |
ACMessagesApi | sendActions | POST /actions | Send Actions |
ACMessagesApi | sendMessage | POST /messages | Send Message |
ACRegistrationsApi | confirmUser | PUT /devices/registrations/pin | Confirm User |
ACRegistrationsApi | getRequestStatusForUser | GET /devices/registrations/{requestId}/status | Get Request Status For User |
ACRegistrationsApi | unregisterDevice | DELETE /devices/{deviceId}/registrations | Unregister Device |
ACRulesApi | createRule | POST /rules | Create Rule |
ACRulesApi | deleteRule | DELETE /rules/{ruleId} | Delete Rule |
ACRulesApi | getRule | GET /rules/{ruleId} | Get Rule |
ACRulesApi | updateRule | PUT /rules/{ruleId} | Update Rule |
ACTagsApi | getTagCategories | GET /tags/categories | Get all categories |
ACTagsApi | getTagSuggestions | GET /tags/suggestions | Get tag suggestions |
ACTagsApi | getTagsByCategories | GET /tags | Get all tags of categories |
ACTokensApi | checkToken | POST /accounts/checkToken | Check Token |
ACTokensApi | refreshToken | POST /accounts/token | Refresh Token |
ACTokensApi | tokenInfo | GET /accounts/tokenInfo | Token Info |
ACUsersApi | createUserProperties | POST /users/{userId}/properties | Create User Application Properties |
ACUsersApi | deleteUserProperties | DELETE /users/{userId}/properties | Delete User Application Properties |
ACUsersApi | getSelf | GET /users/self | Get Current User Profile |
ACUsersApi | getUserDeviceTypes | GET /users/{userId}/devicetypes | Get User Device Types |
ACUsersApi | getUserDevices | GET /users/{userId}/devices | Get User Devices |
ACUsersApi | getUserProperties | GET /users/{userId}/properties | Get User application properties |
ACUsersApi | getUserRules | GET /users/{userId}/rules | Get User Rules |
ACUsersApi | updateUserProperties | PUT /users/{userId}/properties | Update User Application Properties |
- ACAckEnvelope
- ACAcknowledgement
- ACAction
- ACActionArray
- ACActionDetails
- ACActionDetailsArray
- ACActionIn
- ACActionOut
- ACActions
- ACAggregateData
- ACAggregatesHistogramData
- ACAggregatesHistogramResponse
- ACAggregatesResponse
- ACAppProperties
- ACCheckTokenMessage
- ACCheckTokenResponse
- ACDevice
- ACDeviceArray
- ACDeviceEnvelope
- ACDeviceRegCompleteRequest
- ACDeviceRegConfirmUserRequest
- ACDeviceRegConfirmUserResponse
- ACDeviceRegConfirmUserResponseEnvelope
- ACDeviceRegStatusResponse
- ACDeviceRegStatusResponseEnvelope
- ACDeviceToken
- ACDeviceTokenEnvelope
- ACDeviceType
- ACDeviceTypeArray
- ACDeviceTypeEnvelope
- ACDeviceTypesEnvelope
- ACDevicesEnvelope
- ACErrorEnvelope
- ACExportData
- ACExportDataArray
- ACExportHistoryResponse
- ACExportNormalizedMessagesResponse
- ACExportRequest
- ACExportRequestData
- ACExportRequestInfo
- ACExportRequestResponse
- ACExportResponse
- ACExportStatusResponse
- ACFieldPath
- ACFieldPresence
- ACFieldPresenceEnvelope
- ACFieldsActions
- ACManifestProperties
- ACManifestPropertiesEnvelope
- ACManifestVersions
- ACManifestVersionsEnvelope
- ACMessage
- ACMessageAction
- ACMessageID
- ACMessageIDEnvelope
- ACMessageIn
- ACMessageOut
- ACNonEmptyString
- ACNormalizedAction
- ACNormalizedActionsEnvelope
- ACNormalizedMessage
- ACNormalizedMessagesEnvelope
- ACOutputRule
- ACPresenceEnvelope
- ACPresenceModel
- ACPropertiesEnvelope
- ACRefreshTokenResponse
- ACRegisterMessage
- ACRuleArray
- ACRuleCreationInfo
- ACRuleEnvelope
- ACRuleError
- ACRuleUpdateInfo
- ACRuleWarningOutput
- ACRulesEnvelope
- ACSnapshotResponse
- ACSnapshotResponses
- ACSnapshotsResponseEnvelope
- ACTag
- ACTagArray
- ACTagsEnvelope
- ACToken
- ACTokenInfo
- ACTokenInfoSuccessResponse
- ACTokenRequest
- ACTokenResponse
- ACUnregisterDeviceResponse
- ACUnregisterDeviceResponseEnvelope
- ACUser
- ACUserEnvelope
- ACWebSocketError
- Type: OAuth
- Flow: implicit
- Authorization URL: https://accounts.artik.cloud/authorize
- Scopes:
- read:artikcloud: Read from ARTIK Cloud
- write:artikcloud: Write from ARTIK Cloud
Peek into tests for examples about how to use the SDK.
In addition, you can look at our tutorial and sample applications. These will give you a good overview of what you can do and how to do it.
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.