Skip to content

Latest commit

 

History

History
460 lines (312 loc) · 13.8 KB

ACDevicesApi.md

File metadata and controls

460 lines (312 loc) · 13.8 KB

ACDevicesApi

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

Method HTTP request Description
addDevice POST /devices Add Device
deleteDevice DELETE /devices/{deviceId} Delete Device
deleteDeviceToken DELETE /devices/{deviceId}/tokens Delete Device Token
getDevice GET /devices/{deviceId} Get Device
getDevicePresence GET /devices/{deviceId}/presence Get device presence information
getDeviceToken GET /devices/{deviceId}/tokens Get Device Token
updateDevice PUT /devices/{deviceId} Update Device
updateDeviceToken PUT /devices/{deviceId}/tokens Update Device Token

addDevice

-(NSURLSessionTask*) addDeviceWithDevice: (ACDevice*) device
        completionHandler: (void (^)(ACDeviceEnvelope* output, NSError* error)) handler;

Add Device

Create a device

Example

ACDefaultConfiguration *apiConfig = [ACDefaultConfiguration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: artikcloud_oauth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


ACDevice* device = [[ACDevice alloc] init]; // Device to be added to the user

ACDevicesApi*apiInstance = [[ACDevicesApi alloc] init];

// Add Device
[apiInstance addDeviceWithDevice:device
          completionHandler: ^(ACDeviceEnvelope* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling ACDevicesApi->addDevice: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
device ACDevice* Device to be added to the user

Return type

ACDeviceEnvelope*

Authorization

artikcloud_oauth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteDevice

-(NSURLSessionTask*) deleteDeviceWithDeviceId: (NSString*) deviceId
        completionHandler: (void (^)(ACDeviceEnvelope* output, NSError* error)) handler;

Delete Device

Deletes a device

Example

ACDefaultConfiguration *apiConfig = [ACDefaultConfiguration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: artikcloud_oauth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


NSString* deviceId = @"deviceId_example"; // deviceId

ACDevicesApi*apiInstance = [[ACDevicesApi alloc] init];

// Delete Device
[apiInstance deleteDeviceWithDeviceId:deviceId
          completionHandler: ^(ACDeviceEnvelope* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling ACDevicesApi->deleteDevice: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
deviceId NSString* deviceId

Return type

ACDeviceEnvelope*

Authorization

artikcloud_oauth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteDeviceToken

-(NSURLSessionTask*) deleteDeviceTokenWithDeviceId: (NSString*) deviceId
        completionHandler: (void (^)(ACDeviceTokenEnvelope* output, NSError* error)) handler;

Delete Device Token

Deletes a device's token

Example

ACDefaultConfiguration *apiConfig = [ACDefaultConfiguration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: artikcloud_oauth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


NSString* deviceId = @"deviceId_example"; // deviceId

ACDevicesApi*apiInstance = [[ACDevicesApi alloc] init];

// Delete Device Token
[apiInstance deleteDeviceTokenWithDeviceId:deviceId
          completionHandler: ^(ACDeviceTokenEnvelope* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling ACDevicesApi->deleteDeviceToken: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
deviceId NSString* deviceId

Return type

ACDeviceTokenEnvelope*

Authorization

artikcloud_oauth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getDevice

-(NSURLSessionTask*) getDeviceWithDeviceId: (NSString*) deviceId
        completionHandler: (void (^)(ACDeviceEnvelope* output, NSError* error)) handler;

Get Device

Retrieves a device

Example

ACDefaultConfiguration *apiConfig = [ACDefaultConfiguration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: artikcloud_oauth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


NSString* deviceId = @"deviceId_example"; // deviceId

ACDevicesApi*apiInstance = [[ACDevicesApi alloc] init];

// Get Device
[apiInstance getDeviceWithDeviceId:deviceId
          completionHandler: ^(ACDeviceEnvelope* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling ACDevicesApi->getDevice: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
deviceId NSString* deviceId

Return type

ACDeviceEnvelope*

Authorization

artikcloud_oauth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getDevicePresence

-(NSURLSessionTask*) getDevicePresenceWithDeviceId: (NSString*) deviceId
        completionHandler: (void (^)(ACPresenceEnvelope* output, NSError* error)) handler;

Get device presence information

Return the presence status of the given device along with the time it was last seen

Example

ACDefaultConfiguration *apiConfig = [ACDefaultConfiguration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: artikcloud_oauth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


NSString* deviceId = @"deviceId_example"; // Device ID.

ACDevicesApi*apiInstance = [[ACDevicesApi alloc] init];

// Get device presence information
[apiInstance getDevicePresenceWithDeviceId:deviceId
          completionHandler: ^(ACPresenceEnvelope* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling ACDevicesApi->getDevicePresence: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
deviceId NSString* Device ID.

Return type

ACPresenceEnvelope*

Authorization

artikcloud_oauth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getDeviceToken

-(NSURLSessionTask*) getDeviceTokenWithDeviceId: (NSString*) deviceId
        completionHandler: (void (^)(ACDeviceTokenEnvelope* output, NSError* error)) handler;

Get Device Token

Retrieves a device's token

Example

ACDefaultConfiguration *apiConfig = [ACDefaultConfiguration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: artikcloud_oauth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


NSString* deviceId = @"deviceId_example"; // deviceId

ACDevicesApi*apiInstance = [[ACDevicesApi alloc] init];

// Get Device Token
[apiInstance getDeviceTokenWithDeviceId:deviceId
          completionHandler: ^(ACDeviceTokenEnvelope* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling ACDevicesApi->getDeviceToken: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
deviceId NSString* deviceId

Return type

ACDeviceTokenEnvelope*

Authorization

artikcloud_oauth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateDevice

-(NSURLSessionTask*) updateDeviceWithDeviceId: (NSString*) deviceId
    device: (ACDevice*) device
        completionHandler: (void (^)(ACDeviceEnvelope* output, NSError* error)) handler;

Update Device

Updates a device

Example

ACDefaultConfiguration *apiConfig = [ACDefaultConfiguration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: artikcloud_oauth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


NSString* deviceId = @"deviceId_example"; // deviceId
ACDevice* device = [[ACDevice alloc] init]; // Device to be updated

ACDevicesApi*apiInstance = [[ACDevicesApi alloc] init];

// Update Device
[apiInstance updateDeviceWithDeviceId:deviceId
              device:device
          completionHandler: ^(ACDeviceEnvelope* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling ACDevicesApi->updateDevice: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
deviceId NSString* deviceId
device ACDevice* Device to be updated

Return type

ACDeviceEnvelope*

Authorization

artikcloud_oauth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateDeviceToken

-(NSURLSessionTask*) updateDeviceTokenWithDeviceId: (NSString*) deviceId
        completionHandler: (void (^)(ACDeviceTokenEnvelope* output, NSError* error)) handler;

Update Device Token

Updates a device's token

Example

ACDefaultConfiguration *apiConfig = [ACDefaultConfiguration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: artikcloud_oauth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


NSString* deviceId = @"deviceId_example"; // deviceId

ACDevicesApi*apiInstance = [[ACDevicesApi alloc] init];

// Update Device Token
[apiInstance updateDeviceTokenWithDeviceId:deviceId
          completionHandler: ^(ACDeviceTokenEnvelope* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling ACDevicesApi->updateDeviceToken: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
deviceId NSString* deviceId

Return type

ACDeviceTokenEnvelope*

Authorization

artikcloud_oauth

HTTP request headers

  • Content-Type: text/plain
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]