TrackMe API

Devices

deviceDelete

Removes existing device


/devices

Usage and SDK Samples


curl -X delete -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/devices?id=&uniqueId="



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .DevicesApi;

import java.io.File;
import java.util.*;

public class DevicesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: TrackMe-Api-Key
        ApiKeyAuth TrackMe-Api-Key = (ApiKeyAuth) defaultClient.getAuthentication("TrackMe-Api-Key");
        TrackMe-Api-Key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //TrackMe-Api-Key.setApiKeyPrefix("Token");

        DevicesApi apiInstance = new DevicesApi();
        Long id = 789; // Long | identifier of device to be deleted
        String uniqueId = uniqueId_example; // String | IMEI of device to be deleted
        try {
            apiInstance.deviceDelete(id, uniqueId);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#deviceDelete");
            e.printStackTrace();
        }
    }
}

                                                  

import .DevicesApi;

public class DevicesApiExample {

    public static void main(String[] args) {
        DevicesApi apiInstance = new DevicesApi();
        Long id = 789; // Long | identifier of device to be deleted
        String uniqueId = uniqueId_example; // String | IMEI of device to be deleted
        try {
            apiInstance.deviceDelete(id, uniqueId);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#deviceDelete");
            e.printStackTrace();
        }
    }
}

                                                  

Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: TrackMe-Api-Key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"TrackMe-Api-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"TrackMe-Api-Key"];


Long *id = 789; // identifier of device to be deleted (optional)
String *uniqueId = uniqueId_example; // IMEI of device to be deleted (optional)

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

// 
[apiInstance deviceDeleteWith:id
    uniqueId:uniqueId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');
var defaultClient = .ApiClient.instance;

// Configure API key authorization: TrackMe-Api-Key
var TrackMe-Api-Key = defaultClient.authentications['TrackMe-Api-Key'];
TrackMe-Api-Key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TrackMe-Api-Key.apiKeyPrefix['TrackMe-Api-Key'] = "Token"

var api = new .DevicesApi()

var opts = { 
  'id': 789, // {Long} identifier of device to be deleted
  'uniqueId': uniqueId_example // {String} IMEI of device to be deleted
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deviceDelete(opts, callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class deviceDeleteExample
    {
        public void main()
        {
            
            // Configure API key authorization: TrackMe-Api-Key
            Configuration.Default.ApiKey.Add("TrackMe-Api-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("TrackMe-Api-Key", "Bearer");

            var apiInstance = new DevicesApi();
            var id = 789;  // Long | identifier of device to be deleted (optional) 
            var uniqueId = uniqueId_example;  // String | IMEI of device to be deleted (optional) 

            try
            {
                // 
                apiInstance.deviceDelete(id, uniqueId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DevicesApi.deviceDelete: " + e.Message );
            }
        }
    }
}

                                                    

setApiKey('TrackMe-Api-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('TrackMe-Api-Key', 'Bearer');

$api_instance = new io.swagger.client\Api\DevicesApi();
$id = 789; // Long | identifier of device to be deleted
$uniqueId = uniqueId_example; // String | IMEI of device to be deleted

try {
    $api_instance->deviceDelete($id, $uniqueId);
} catch (Exception $e) {
    echo 'Exception when calling DevicesApi->deviceDelete: ', $e->getMessage(), PHP_EOL;
}

                                                  

Parameters

Query parameters
Name Description
id
uniqueId

Responses

Status: 200 - device successfully removed

Status: 401 - unauthorized

Status: 404 - device with such identifier not found

Status: 500 - unexpected internal server error


devicePost

Register new device


/devices

Usage and SDK Samples


curl -X post -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/devices"



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .DevicesApi;

import java.io.File;
import java.util.*;

public class DevicesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: TrackMe-Api-Key
        ApiKeyAuth TrackMe-Api-Key = (ApiKeyAuth) defaultClient.getAuthentication("TrackMe-Api-Key");
        TrackMe-Api-Key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //TrackMe-Api-Key.setApiKeyPrefix("Token");

        DevicesApi apiInstance = new DevicesApi();
        Device body = ; // Device | user to add to the system
        try {
            Device result = apiInstance.devicePost(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#devicePost");
            e.printStackTrace();
        }
    }
}

                                                  

import .DevicesApi;

public class DevicesApiExample {

    public static void main(String[] args) {
        DevicesApi apiInstance = new DevicesApi();
        Device body = ; // Device | user to add to the system
        try {
            Device result = apiInstance.devicePost(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#devicePost");
            e.printStackTrace();
        }
    }
}

                                                  

Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: TrackMe-Api-Key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"TrackMe-Api-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"TrackMe-Api-Key"];


Device *body = ; // user to add to the system

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

// 
[apiInstance devicePostWith:body
              completionHandler: ^(Device output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');
var defaultClient = .ApiClient.instance;

// Configure API key authorization: TrackMe-Api-Key
var TrackMe-Api-Key = defaultClient.authentications['TrackMe-Api-Key'];
TrackMe-Api-Key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TrackMe-Api-Key.apiKeyPrefix['TrackMe-Api-Key'] = "Token"

var api = new .DevicesApi()

var body = ; // {Device} user to add to the system


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.devicePost(body, callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class devicePostExample
    {
        public void main()
        {
            
            // Configure API key authorization: TrackMe-Api-Key
            Configuration.Default.ApiKey.Add("TrackMe-Api-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("TrackMe-Api-Key", "Bearer");

            var apiInstance = new DevicesApi();
            var body = new Device(); // Device | user to add to the system

            try
            {
                // 
                Device result = apiInstance.devicePost(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DevicesApi.devicePost: " + e.Message );
            }
        }
    }
}

                                                    

setApiKey('TrackMe-Api-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('TrackMe-Api-Key', 'Bearer');

$api_instance = new io.swagger.client\Api\DevicesApi();
$body = ; // Device | user to add to the system

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

                                                  

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - The device object

Status: 400 - Error when field validation fails

Status: 401 - Unauthorized

Status: 409 - Error when device already exists

Status: 500 - Unexpected internal server error


devicePut

Updates existing device


/devices

Usage and SDK Samples


curl -X put -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/devices"



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .DevicesApi;

import java.io.File;
import java.util.*;

public class DevicesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: TrackMe-Api-Key
        ApiKeyAuth TrackMe-Api-Key = (ApiKeyAuth) defaultClient.getAuthentication("TrackMe-Api-Key");
        TrackMe-Api-Key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //TrackMe-Api-Key.setApiKeyPrefix("Token");

        DevicesApi apiInstance = new DevicesApi();
        Device body = ; // Device | user to add to the system
        try {
            Device result = apiInstance.devicePut(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#devicePut");
            e.printStackTrace();
        }
    }
}

                                                  

import .DevicesApi;

public class DevicesApiExample {

    public static void main(String[] args) {
        DevicesApi apiInstance = new DevicesApi();
        Device body = ; // Device | user to add to the system
        try {
            Device result = apiInstance.devicePut(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#devicePut");
            e.printStackTrace();
        }
    }
}

                                                  

Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: TrackMe-Api-Key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"TrackMe-Api-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"TrackMe-Api-Key"];


Device *body = ; // user to add to the system

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

// 
[apiInstance devicePutWith:body
              completionHandler: ^(Device output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');
var defaultClient = .ApiClient.instance;

// Configure API key authorization: TrackMe-Api-Key
var TrackMe-Api-Key = defaultClient.authentications['TrackMe-Api-Key'];
TrackMe-Api-Key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TrackMe-Api-Key.apiKeyPrefix['TrackMe-Api-Key'] = "Token"

var api = new .DevicesApi()

var body = ; // {Device} user to add to the system


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.devicePut(body, callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class devicePutExample
    {
        public void main()
        {
            
            // Configure API key authorization: TrackMe-Api-Key
            Configuration.Default.ApiKey.Add("TrackMe-Api-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("TrackMe-Api-Key", "Bearer");

            var apiInstance = new DevicesApi();
            var body = new Device(); // Device | user to add to the system

            try
            {
                // 
                Device result = apiInstance.devicePut(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DevicesApi.devicePut: " + e.Message );
            }
        }
    }
}

                                                    

setApiKey('TrackMe-Api-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('TrackMe-Api-Key', 'Bearer');

$api_instance = new io.swagger.client\Api\DevicesApi();
$body = ; // Device | user to add to the system

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

                                                  

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - The device object

Status: 400 - field validation fails

Status: 401 - unauthorized

Status: 409 - device with such unique id already exists

Status: 500 - unexpected internal server error


deviceShare

Shares existing device to user


/devices/{deviceId}/share

Usage and SDK Samples


curl -X post -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/devices/{deviceId}/share?userId=&userEmail=&userName="



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .DevicesApi;

import java.io.File;
import java.util.*;

public class DevicesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: TrackMe-Api-Key
        ApiKeyAuth TrackMe-Api-Key = (ApiKeyAuth) defaultClient.getAuthentication("TrackMe-Api-Key");
        TrackMe-Api-Key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //TrackMe-Api-Key.setApiKeyPrefix("Token");

        DevicesApi apiInstance = new DevicesApi();
        Long deviceId = 789; // Long | identifier of device to be shared
        Long userId = 789; // Long | identifier of user to share device to
        String userEmail = userEmail_example; // String | email of user to share device to
        String userName = userName_example; // String | username of user to share device to
        try {
            apiInstance.deviceShare(deviceId, userId, userEmail, userName);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#deviceShare");
            e.printStackTrace();
        }
    }
}

                                                  

import .DevicesApi;

public class DevicesApiExample {

    public static void main(String[] args) {
        DevicesApi apiInstance = new DevicesApi();
        Long deviceId = 789; // Long | identifier of device to be shared
        Long userId = 789; // Long | identifier of user to share device to
        String userEmail = userEmail_example; // String | email of user to share device to
        String userName = userName_example; // String | username of user to share device to
        try {
            apiInstance.deviceShare(deviceId, userId, userEmail, userName);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#deviceShare");
            e.printStackTrace();
        }
    }
}

                                                  

Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: TrackMe-Api-Key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"TrackMe-Api-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"TrackMe-Api-Key"];


Long *deviceId = 789; // identifier of device to be shared
Long *userId = 789; // identifier of user to share device to (optional)
String *userEmail = userEmail_example; // email of user to share device to (optional)
String *userName = userName_example; // username of user to share device to (optional)

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

// 
[apiInstance deviceShareWith:deviceId
    userId:userId
    userEmail:userEmail
    userName:userName
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');
var defaultClient = .ApiClient.instance;

// Configure API key authorization: TrackMe-Api-Key
var TrackMe-Api-Key = defaultClient.authentications['TrackMe-Api-Key'];
TrackMe-Api-Key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TrackMe-Api-Key.apiKeyPrefix['TrackMe-Api-Key'] = "Token"

var api = new .DevicesApi()

var deviceId = 789; // {Long} identifier of device to be shared

var opts = { 
  'userId': 789, // {Long} identifier of user to share device to
  'userEmail': userEmail_example, // {String} email of user to share device to
  'userName': userName_example // {String} username of user to share device to
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deviceShare(deviceId, opts, callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class deviceShareExample
    {
        public void main()
        {
            
            // Configure API key authorization: TrackMe-Api-Key
            Configuration.Default.ApiKey.Add("TrackMe-Api-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("TrackMe-Api-Key", "Bearer");

            var apiInstance = new DevicesApi();
            var deviceId = 789;  // Long | identifier of device to be shared
            var userId = 789;  // Long | identifier of user to share device to (optional) 
            var userEmail = userEmail_example;  // String | email of user to share device to (optional) 
            var userName = userName_example;  // String | username of user to share device to (optional) 

            try
            {
                // 
                apiInstance.deviceShare(deviceId, userId, userEmail, userName);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DevicesApi.deviceShare: " + e.Message );
            }
        }
    }
}

                                                    

setApiKey('TrackMe-Api-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('TrackMe-Api-Key', 'Bearer');

$api_instance = new io.swagger.client\Api\DevicesApi();
$deviceId = 789; // Long | identifier of device to be shared
$userId = 789; // Long | identifier of user to share device to
$userEmail = userEmail_example; // String | email of user to share device to
$userName = userName_example; // String | username of user to share device to

try {
    $api_instance->deviceShare($deviceId, $userId, $userEmail, $userName);
} catch (Exception $e) {
    echo 'Exception when calling DevicesApi->deviceShare: ', $e->getMessage(), PHP_EOL;
}

                                                  

Parameters

Path parameters
Name Description
deviceId*
Query parameters
Name Description
userId
userEmail
userName

Responses

Status: 200 - device was shared successfully

Status: 401 - unauthorized

Status: 404 - device with such identifier not found

Status: 409 - device was already shared to this user

Status: 500 - unexpected internal server error


deviceStopSharing

Stop sharing existing device to user


/devices/{deviceId}/share

Usage and SDK Samples


curl -X delete -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/devices/{deviceId}/share?userId=&userEmail=&userName="



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .DevicesApi;

import java.io.File;
import java.util.*;

public class DevicesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: TrackMe-Api-Key
        ApiKeyAuth TrackMe-Api-Key = (ApiKeyAuth) defaultClient.getAuthentication("TrackMe-Api-Key");
        TrackMe-Api-Key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //TrackMe-Api-Key.setApiKeyPrefix("Token");

        DevicesApi apiInstance = new DevicesApi();
        Long deviceId = 789; // Long | identifier of device
        Long userId = 789; // Long | identifier of user
        String userEmail = userEmail_example; // String | email of user to share device to
        String userName = userName_example; // String | username of user to share device to
        try {
            apiInstance.deviceStopSharing(deviceId, userId, userEmail, userName);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#deviceStopSharing");
            e.printStackTrace();
        }
    }
}

                                                  

import .DevicesApi;

public class DevicesApiExample {

    public static void main(String[] args) {
        DevicesApi apiInstance = new DevicesApi();
        Long deviceId = 789; // Long | identifier of device
        Long userId = 789; // Long | identifier of user
        String userEmail = userEmail_example; // String | email of user to share device to
        String userName = userName_example; // String | username of user to share device to
        try {
            apiInstance.deviceStopSharing(deviceId, userId, userEmail, userName);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#deviceStopSharing");
            e.printStackTrace();
        }
    }
}

                                                  

Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: TrackMe-Api-Key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"TrackMe-Api-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"TrackMe-Api-Key"];


Long *deviceId = 789; // identifier of device
Long *userId = 789; // identifier of user (optional)
String *userEmail = userEmail_example; // email of user to share device to (optional)
String *userName = userName_example; // username of user to share device to (optional)

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

// 
[apiInstance deviceStopSharingWith:deviceId
    userId:userId
    userEmail:userEmail
    userName:userName
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');
var defaultClient = .ApiClient.instance;

// Configure API key authorization: TrackMe-Api-Key
var TrackMe-Api-Key = defaultClient.authentications['TrackMe-Api-Key'];
TrackMe-Api-Key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TrackMe-Api-Key.apiKeyPrefix['TrackMe-Api-Key'] = "Token"

var api = new .DevicesApi()

var deviceId = 789; // {Long} identifier of device

var opts = { 
  'userId': 789, // {Long} identifier of user
  'userEmail': userEmail_example, // {String} email of user to share device to
  'userName': userName_example // {String} username of user to share device to
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deviceStopSharing(deviceId, opts, callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class deviceStopSharingExample
    {
        public void main()
        {
            
            // Configure API key authorization: TrackMe-Api-Key
            Configuration.Default.ApiKey.Add("TrackMe-Api-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("TrackMe-Api-Key", "Bearer");

            var apiInstance = new DevicesApi();
            var deviceId = 789;  // Long | identifier of device
            var userId = 789;  // Long | identifier of user (optional) 
            var userEmail = userEmail_example;  // String | email of user to share device to (optional) 
            var userName = userName_example;  // String | username of user to share device to (optional) 

            try
            {
                // 
                apiInstance.deviceStopSharing(deviceId, userId, userEmail, userName);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DevicesApi.deviceStopSharing: " + e.Message );
            }
        }
    }
}

                                                    

setApiKey('TrackMe-Api-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('TrackMe-Api-Key', 'Bearer');

$api_instance = new io.swagger.client\Api\DevicesApi();
$deviceId = 789; // Long | identifier of device
$userId = 789; // Long | identifier of user
$userEmail = userEmail_example; // String | email of user to share device to
$userName = userName_example; // String | username of user to share device to

try {
    $api_instance->deviceStopSharing($deviceId, $userId, $userEmail, $userName);
} catch (Exception $e) {
    echo 'Exception when calling DevicesApi->deviceStopSharing: ', $e->getMessage(), PHP_EOL;
}

                                                  

Parameters

Path parameters
Name Description
deviceId*
Query parameters
Name Description
userId
userEmail
userName

Responses

Status: 200 - sharing of device was stopped successfully

Status: 401 - unauthorized

Status: 404 - device with such identifier not found

Status: 409 - device is not being shared to user

Status: 500 - unexpected internal server error


devicesGet

List all available devices for user


/devices

Usage and SDK Samples


curl -X get -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/devices"



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .DevicesApi;

import java.io.File;
import java.util.*;

public class DevicesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: TrackMe-Api-Key
        ApiKeyAuth TrackMe-Api-Key = (ApiKeyAuth) defaultClient.getAuthentication("TrackMe-Api-Key");
        TrackMe-Api-Key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //TrackMe-Api-Key.setApiKeyPrefix("Token");

        DevicesApi apiInstance = new DevicesApi();
        try {
            apiInstance.devicesGet();
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#devicesGet");
            e.printStackTrace();
        }
    }
}

                                                  

import .DevicesApi;

public class DevicesApiExample {

    public static void main(String[] args) {
        DevicesApi apiInstance = new DevicesApi();
        try {
            apiInstance.devicesGet();
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#devicesGet");
            e.printStackTrace();
        }
    }
}

                                                  

Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: TrackMe-Api-Key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"TrackMe-Api-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"TrackMe-Api-Key"];



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

// 
[apiInstance devicesGetWithCompletionHandler: 
              ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');
var defaultClient = .ApiClient.instance;

// Configure API key authorization: TrackMe-Api-Key
var TrackMe-Api-Key = defaultClient.authentications['TrackMe-Api-Key'];
TrackMe-Api-Key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TrackMe-Api-Key.apiKeyPrefix['TrackMe-Api-Key'] = "Token"

var api = new .DevicesApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.devicesGet(callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class devicesGetExample
    {
        public void main()
        {
            
            // Configure API key authorization: TrackMe-Api-Key
            Configuration.Default.ApiKey.Add("TrackMe-Api-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("TrackMe-Api-Key", "Bearer");

            var apiInstance = new DevicesApi();

            try
            {
                // 
                apiInstance.devicesGet();
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DevicesApi.devicesGet: " + e.Message );
            }
        }
    }
}

                                                    

setApiKey('TrackMe-Api-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('TrackMe-Api-Key', 'Bearer');

$api_instance = new io.swagger.client\Api\DevicesApi();

try {
    $api_instance->devicesGet();
} catch (Exception $e) {
    echo 'Exception when calling DevicesApi->devicesGet: ', $e->getMessage(), PHP_EOL;
}

                                                  

Parameters

Responses

Status: 200 - The device object

Status: 401 - unauthorized

Status: 500 - unexpected internal server error


Login

usersPost

Login


/login

Usage and SDK Samples


curl -X post -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/login"



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .LoginApi;

import java.io.File;
import java.util.*;

public class LoginApiExample {

    public static void main(String[] args) {
        
        LoginApi apiInstance = new LoginApi();
        LoginInfo body = ; // LoginInfo | Authorized user profile
        try {
            User result = apiInstance.usersPost(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LoginApi#usersPost");
            e.printStackTrace();
        }
    }
}

                                                  

import .LoginApi;

public class LoginApiExample {

    public static void main(String[] args) {
        LoginApi apiInstance = new LoginApi();
        LoginInfo body = ; // LoginInfo | Authorized user profile
        try {
            User result = apiInstance.usersPost(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LoginApi#usersPost");
            e.printStackTrace();
        }
    }
}

                                                  


LoginInfo *body = ; // Authorized user profile

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

// 
[apiInstance usersPostWith:body
              completionHandler: ^(User output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');

var api = new .LoginApi()

var body = ; // {LoginInfo} Authorized user profile


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.usersPost(body, callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class usersPostExample
    {
        public void main()
        {
            
            var apiInstance = new LoginApi();
            var body = new LoginInfo(); // LoginInfo | Authorized user profile

            try
            {
                // 
                User result = apiInstance.usersPost(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling LoginApi.usersPost: " + e.Message );
            }
        }
    }
}

                                                    

usersPost($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LoginApi->usersPost: ', $e->getMessage(), PHP_EOL;
}

                                                  

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - The user object

Status: 400 - Error when validation fails

Status: 404 - Error when no user with such login/email exists

Status: 500 - Unexpected internal server error


Positions

devicePositionsGet

Get latest positions of device with specified identifier


/positions/{deviceId}

Usage and SDK Samples


curl -X get -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/positions/{deviceId}"



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .PositionsApi;

import java.io.File;
import java.util.*;

public class PositionsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: TrackMe-Api-Key
        ApiKeyAuth TrackMe-Api-Key = (ApiKeyAuth) defaultClient.getAuthentication("TrackMe-Api-Key");
        TrackMe-Api-Key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //TrackMe-Api-Key.setApiKeyPrefix("Token");

        PositionsApi apiInstance = new PositionsApi();
        Long deviceId = 789; // Long | 
        try {
            Position result = apiInstance.devicePositionsGet(deviceId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PositionsApi#devicePositionsGet");
            e.printStackTrace();
        }
    }
}

                                                  

import .PositionsApi;

public class PositionsApiExample {

    public static void main(String[] args) {
        PositionsApi apiInstance = new PositionsApi();
        Long deviceId = 789; // Long | 
        try {
            Position result = apiInstance.devicePositionsGet(deviceId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PositionsApi#devicePositionsGet");
            e.printStackTrace();
        }
    }
}

                                                  

Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: TrackMe-Api-Key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"TrackMe-Api-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"TrackMe-Api-Key"];


Long *deviceId = 789; // 

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

// 
[apiInstance devicePositionsGetWith:deviceId
              completionHandler: ^(Position output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');
var defaultClient = .ApiClient.instance;

// Configure API key authorization: TrackMe-Api-Key
var TrackMe-Api-Key = defaultClient.authentications['TrackMe-Api-Key'];
TrackMe-Api-Key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TrackMe-Api-Key.apiKeyPrefix['TrackMe-Api-Key'] = "Token"

var api = new .PositionsApi()

var deviceId = 789; // {Long} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.devicePositionsGet(deviceId, callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class devicePositionsGetExample
    {
        public void main()
        {
            
            // Configure API key authorization: TrackMe-Api-Key
            Configuration.Default.ApiKey.Add("TrackMe-Api-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("TrackMe-Api-Key", "Bearer");

            var apiInstance = new PositionsApi();
            var deviceId = 789;  // Long | 

            try
            {
                // 
                Position result = apiInstance.devicePositionsGet(deviceId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PositionsApi.devicePositionsGet: " + e.Message );
            }
        }
    }
}

                                                    

setApiKey('TrackMe-Api-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('TrackMe-Api-Key', 'Bearer');

$api_instance = new io.swagger.client\Api\PositionsApi();
$deviceId = 789; // Long | 

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

                                                  

Parameters

Path parameters
Name Description
deviceId*

Responses

Status: 200 - The position object

Status: 401 - unauthorized

Status: 404 - device with specified identifier was not found

Status: 500 - unexpected internal server error


positionsGet

List latest positions of all available devices for user


/positions

Usage and SDK Samples


curl -X get -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/positions"



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .PositionsApi;

import java.io.File;
import java.util.*;

public class PositionsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: TrackMe-Api-Key
        ApiKeyAuth TrackMe-Api-Key = (ApiKeyAuth) defaultClient.getAuthentication("TrackMe-Api-Key");
        TrackMe-Api-Key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //TrackMe-Api-Key.setApiKeyPrefix("Token");

        PositionsApi apiInstance = new PositionsApi();
        try {
            apiInstance.positionsGet();
        } catch (ApiException e) {
            System.err.println("Exception when calling PositionsApi#positionsGet");
            e.printStackTrace();
        }
    }
}

                                                  

import .PositionsApi;

public class PositionsApiExample {

    public static void main(String[] args) {
        PositionsApi apiInstance = new PositionsApi();
        try {
            apiInstance.positionsGet();
        } catch (ApiException e) {
            System.err.println("Exception when calling PositionsApi#positionsGet");
            e.printStackTrace();
        }
    }
}

                                                  

Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: TrackMe-Api-Key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"TrackMe-Api-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"TrackMe-Api-Key"];



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

// 
[apiInstance positionsGetWithCompletionHandler: 
              ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');
var defaultClient = .ApiClient.instance;

// Configure API key authorization: TrackMe-Api-Key
var TrackMe-Api-Key = defaultClient.authentications['TrackMe-Api-Key'];
TrackMe-Api-Key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TrackMe-Api-Key.apiKeyPrefix['TrackMe-Api-Key'] = "Token"

var api = new .PositionsApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.positionsGet(callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class positionsGetExample
    {
        public void main()
        {
            
            // Configure API key authorization: TrackMe-Api-Key
            Configuration.Default.ApiKey.Add("TrackMe-Api-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("TrackMe-Api-Key", "Bearer");

            var apiInstance = new PositionsApi();

            try
            {
                // 
                apiInstance.positionsGet();
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PositionsApi.positionsGet: " + e.Message );
            }
        }
    }
}

                                                    

setApiKey('TrackMe-Api-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('TrackMe-Api-Key', 'Bearer');

$api_instance = new io.swagger.client\Api\PositionsApi();

try {
    $api_instance->positionsGet();
} catch (Exception $e) {
    echo 'Exception when calling PositionsApi->positionsGet: ', $e->getMessage(), PHP_EOL;
}

                                                  

Parameters

Responses

Status: 200 - The position objects

Status: 401 - unauthorized

Status: 500 - unexpected internal server error


Recoverpassword

recoverPassword

Recover Password


/recover_password

Usage and SDK Samples


curl -X post -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/recover_password?email="



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .RecoverpasswordApi;

import java.io.File;
import java.util.*;

public class RecoverpasswordApiExample {

    public static void main(String[] args) {
        
        RecoverpasswordApi apiInstance = new RecoverpasswordApi();
        String email = email_example; // String | User email
        try {
            apiInstance.recoverPassword(email);
        } catch (ApiException e) {
            System.err.println("Exception when calling RecoverpasswordApi#recoverPassword");
            e.printStackTrace();
        }
    }
}

                                                  

import .RecoverpasswordApi;

public class RecoverpasswordApiExample {

    public static void main(String[] args) {
        RecoverpasswordApi apiInstance = new RecoverpasswordApi();
        String email = email_example; // String | User email
        try {
            apiInstance.recoverPassword(email);
        } catch (ApiException e) {
            System.err.println("Exception when calling RecoverpasswordApi#recoverPassword");
            e.printStackTrace();
        }
    }
}

                                                  


String *email = email_example; // User email

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

// 
[apiInstance recoverPasswordWith:email
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');

var api = new .RecoverpasswordApi()

var email = email_example; // {String} User email


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.recoverPassword(email, callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class recoverPasswordExample
    {
        public void main()
        {
            
            var apiInstance = new RecoverpasswordApi();
            var email = email_example;  // String | User email

            try
            {
                // 
                apiInstance.recoverPassword(email);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling RecoverpasswordApi.recoverPassword: " + e.Message );
            }
        }
    }
}

                                                    

recoverPassword($email);
} catch (Exception $e) {
    echo 'Exception when calling RecoverpasswordApi->recoverPassword: ', $e->getMessage(), PHP_EOL;
}

                                                  

Parameters

Query parameters
Name Description
email*

Responses

Status: 200 - Recover email has been sent

Status: 400 - Error when validation fails

Status: 404 - Error when no user with such email exists

Status: 500 - Unexpected internal server error


usersPut

Update password


/recover_password

Usage and SDK Samples


curl -X put -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/recover_password"



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .RecoverpasswordApi;

import java.io.File;
import java.util.*;

public class RecoverpasswordApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: TrackMe-Api-Key
        ApiKeyAuth TrackMe-Api-Key = (ApiKeyAuth) defaultClient.getAuthentication("TrackMe-Api-Key");
        TrackMe-Api-Key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //TrackMe-Api-Key.setApiKeyPrefix("Token");

        RecoverpasswordApi apiInstance = new RecoverpasswordApi();
        String body = body_example; // String | New user password
        try {
            apiInstance.usersPut(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling RecoverpasswordApi#usersPut");
            e.printStackTrace();
        }
    }
}

                                                  

import .RecoverpasswordApi;

public class RecoverpasswordApiExample {

    public static void main(String[] args) {
        RecoverpasswordApi apiInstance = new RecoverpasswordApi();
        String body = body_example; // String | New user password
        try {
            apiInstance.usersPut(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling RecoverpasswordApi#usersPut");
            e.printStackTrace();
        }
    }
}

                                                  

Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: TrackMe-Api-Key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"TrackMe-Api-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"TrackMe-Api-Key"];


String *body = body_example; // New user password

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

// 
[apiInstance usersPutWith:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');
var defaultClient = .ApiClient.instance;

// Configure API key authorization: TrackMe-Api-Key
var TrackMe-Api-Key = defaultClient.authentications['TrackMe-Api-Key'];
TrackMe-Api-Key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TrackMe-Api-Key.apiKeyPrefix['TrackMe-Api-Key'] = "Token"

var api = new .RecoverpasswordApi()

var body = body_example; // {String} New user password


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.usersPut(body, callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class usersPutExample
    {
        public void main()
        {
            
            // Configure API key authorization: TrackMe-Api-Key
            Configuration.Default.ApiKey.Add("TrackMe-Api-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("TrackMe-Api-Key", "Bearer");

            var apiInstance = new RecoverpasswordApi();
            var body = body_example;  // String | New user password

            try
            {
                // 
                apiInstance.usersPut(body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling RecoverpasswordApi.usersPut: " + e.Message );
            }
        }
    }
}

                                                    

setApiKey('TrackMe-Api-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('TrackMe-Api-Key', 'Bearer');

$api_instance = new io.swagger.client\Api\RecoverpasswordApi();
$body = body_example; // String | New user password

try {
    $api_instance->usersPut($body);
} catch (Exception $e) {
    echo 'Exception when calling RecoverpasswordApi->usersPut: ', $e->getMessage(), PHP_EOL;
}

                                                  

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - Password updated

Status: 400 - Error when validation fails

Status: 401 - Not authorized

Status: 500 - Unexpected internal server error


Users

getCurrentUser

Get information about currently logged in user


/users/me

Usage and SDK Samples


curl -X get -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/users/me"



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .UsersApi;

import java.io.File;
import java.util.*;

public class UsersApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: TrackMe-Api-Key
        ApiKeyAuth TrackMe-Api-Key = (ApiKeyAuth) defaultClient.getAuthentication("TrackMe-Api-Key");
        TrackMe-Api-Key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //TrackMe-Api-Key.setApiKeyPrefix("Token");

        UsersApi apiInstance = new UsersApi();
        try {
            User result = apiInstance.getCurrentUser();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UsersApi#getCurrentUser");
            e.printStackTrace();
        }
    }
}

                                                  

import .UsersApi;

public class UsersApiExample {

    public static void main(String[] args) {
        UsersApi apiInstance = new UsersApi();
        try {
            User result = apiInstance.getCurrentUser();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UsersApi#getCurrentUser");
            e.printStackTrace();
        }
    }
}

                                                  

Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: TrackMe-Api-Key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"TrackMe-Api-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"TrackMe-Api-Key"];



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

// 
[apiInstance getCurrentUserWithCompletionHandler: 
              ^(User output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');
var defaultClient = .ApiClient.instance;

// Configure API key authorization: TrackMe-Api-Key
var TrackMe-Api-Key = defaultClient.authentications['TrackMe-Api-Key'];
TrackMe-Api-Key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TrackMe-Api-Key.apiKeyPrefix['TrackMe-Api-Key'] = "Token"

var api = new .UsersApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getCurrentUser(callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class getCurrentUserExample
    {
        public void main()
        {
            
            // Configure API key authorization: TrackMe-Api-Key
            Configuration.Default.ApiKey.Add("TrackMe-Api-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("TrackMe-Api-Key", "Bearer");

            var apiInstance = new UsersApi();

            try
            {
                // 
                User result = apiInstance.getCurrentUser();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling UsersApi.getCurrentUser: " + e.Message );
            }
        }
    }
}

                                                    

setApiKey('TrackMe-Api-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('TrackMe-Api-Key', 'Bearer');

$api_instance = new io.swagger.client\Api\UsersApi();

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

                                                  

Parameters

Responses

Status: 200 - The user object

Status: 401 - Not authorized

Status: 500 - Unexpected internal server error


registerUsers

Register new user


/users

Usage and SDK Samples


curl -X post -H "apiKey: [[apiKey]]" -H "apiSecret: [[apiSecret]]" "https://portal.trackme.lk/api/v1/users"



import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .UsersApi;

import java.io.File;
import java.util.*;

public class UsersApiExample {

    public static void main(String[] args) {
        
        UsersApi apiInstance = new UsersApi();
        User body = ; // User | user to add to the system
        try {
            User result = apiInstance.registerUsers(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UsersApi#registerUsers");
            e.printStackTrace();
        }
    }
}

                                                  

import .UsersApi;

public class UsersApiExample {

    public static void main(String[] args) {
        UsersApi apiInstance = new UsersApi();
        User body = ; // User | user to add to the system
        try {
            User result = apiInstance.registerUsers(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UsersApi#registerUsers");
            e.printStackTrace();
        }
    }
}

                                                  


User *body = ; // user to add to the system

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

// 
[apiInstance registerUsersWith:body
              completionHandler: ^(User output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

                                                    

var  = require('');

var api = new .UsersApi()

var body = ; // {User} user to add to the system


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.registerUsers(body, callback);

                                                    

using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;

namespace Example
{
    public class registerUsersExample
    {
        public void main()
        {
            
            var apiInstance = new UsersApi();
            var body = new User(); // User | user to add to the system

            try
            {
                // 
                User result = apiInstance.registerUsers(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling UsersApi.registerUsers: " + e.Message );
            }
        }
    }
}

                                                    

registerUsers($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->registerUsers: ', $e->getMessage(), PHP_EOL;
}

                                                  

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - The user object

Status: 400 - Error when field validation fails

Status: 409 - Error when user already exists

Status: 500 - Unexpected internal server error


Generated 2016-09-07T18:32:38.871Z