🗂️ Accounts

The Accounts module is designed to streamline the management and creation of applications within a company's profile in the Telematics SDK. It offers a simple yet powerful interface for handling various account-related operations, with a focus on creating and configuring applications. Key functionalities include setting up new applications with custom parameters and managing their details. The module simplifies these processes, ensuring ease of integration and use. Below is an overview of its primary method and how to effectively utilize it:

1. Get started

If you haven't already, install the Damoov-Admin SDK for Python.

pip install damoov-admin

Begin by importing the Accounts module and finalizing the authentication process.

from damoov_admin import accounts
email="[email protected]"
password="YOUR PASSWORD"

account = accounts.DamoovAuth(email=email, password=password)

2. Methods

Syntaxes:

  • company_id: The unique identifier of the company. It is a string, typically in UUID format.
  • app_id: The unique identifier of the application. It is a string, typically in UUID format.
  • instance_id: The unique identifier of the instance, also known as a user group. It is a string, typically in UUID format.
  • name: Name of the application. A string representing the application's or instance's name.
  • description: Description of the application or instance. A string providing details about the application or instance
  • status: (Optional) Status of the application or instance. An integer, with the default value being 1.
  • googlePlayLink: (Optional) Link to the application on Google Play. A string, defaulting to an empty string if not provided.
  • appleStoreLink: (Optional) Link to the application on the Apple App Store. A string, defaulting to an empty string if not provided.
    createDefaultGroup: (Optional) Flag to indicate whether to create a default instance, known as a Common group. A boolean, defaulting to True.

create_application

Create a company application.

Parameters

  • company_id: ID of the company
  • name: App name
  • description: App description
  • status 1 - active (default), 2 - Deactivated
  • googlePlayLink(optional)
  • googlePlayLink (optional)
  • createDefaultGroup- automatically create a default instance. True (default)

Request:

application = account.create_application(
		company_id='',
		name='',
		description='',
  	status=1 #optional. default value is 1 - active
  	googlePlayLink='' #optional.
  	appleStoreLink='' #optional.
  	createDefaultGroup=True #optional. default value is True
)

Response:

{
    "Result": {
        "AppId": "xxxd1a2c-b5a6-xxx-xxxx-26d2168xxxxx",
        "Instances": [
            {
                "Id": "xxx80bc1-xxxx-xxxx-96a8-79800b0xxxxx",
                "Key": "xxx471a4-6950-xxxx-xxxx-ae947a6xxxxx"
            }
        ]
    },
    "Status": 200,
    "Title": "",
    "Errors": []
}

get_applications

Retrieve a list of available applications.

Parameters

  • company_id: ID of the company

Request:

application = account.get_applications(
		company_id=''
  )

Response:

{
  "Result":[
        {
            "Id": "xxxxxxxx-02f3-xxxx-xxxx-aadf9c4xxxxx",
            "Name": "ZenRoad",
            "Description": "The Main Telematics Application",
            "Status": "Active",
            "GooglePlayLink": "https://play.google.com/store/apps/details?id=com.telematicssdk.zenroad",
            "AppleStoreLink": "https://apps.apple.com/us/app/zenroad/id1563218393",
            "Instances": null
        },
        {
            "Id": "xxxxxxxx-02f3-xxxx-xxxx-aadf9c5xxxxx",
            "Name": "Smart Fleet Tracking",
            "Description": "Smart Fleet Tracking",
            "Status": "Active",
            "GooglePlayLink": "https://play.google.com/store/apps/details?id=com.smartfleet.smartfleet",
            "AppleStoreLink": "https://apps.apple.com/us/app/smart-fleet-tracking/id1509791662",
            "Instances": null
        }
  ]
    "Status": 200,
    "Title": "",
    "Errors": []
}

get_application_details

Retrieve a list of available applications.

Parameters

  • app_id: ID of the application
  • include_instances: retrieve information about all instances. Optional. default value is False

Request:

application = account.get_application_details(
		app_id='',
  include_instances=True
  )

Response:

{
    "Result": {
        "Id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "Name": "Ghost App",
        "Description": "",
        "Status": "Active",
        "GooglePlayLink": "",
        "AppleStoreLink": "",
        "Instances": [
            {
                "Id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                "Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                "Name": "Development",
                "Status": "Active"
            },
            {
                "Id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                "Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                "Name": "Production",
                "Status": "Active"
            }
        ]
    },
    "Status": 200,
    "Title": "",
    "Errors": []
}

update_application_details

Retrieve details of the application

Parameters

  • app_id
  • status
  • name
  • description

Request:

application = account.update_application_details(
		app_id='',
    status=1,
    name='',
    description-''
    )

Response:

{
  "status": 0,
  "title": "string",
  "errors": [
    {
      "key": "string",
      "message": "string"
    }
  ]
}

delete_application

Delete the application.

Parameters

  • app_id: ID of the application

Request:

application = account.delete_application(
		app_id=''
)

Response:

{
  "status": 0,
  "title": "string",
  "errors": [
    {
      "key": "string",
      "message": "string"
    }
  ]
}

create_instance

Create an application instance/ user group.

Parameters

  • app_id: ID of the company
  • name: App name
  • description: App description
  • status 1 - active (default), 2 - Deactivated

Request:

instance = account.create_instance(
		app_id='',
    name='',
    description=''
)

Response:

{
    "Result": {
        "Id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    },
    "Status": 200,
    "Title": "",
    "Errors": []
}

get_instances

Retrieve a list of available instances.

Parameters

  • app_id: ID of the application

Request:

instance = account.get_instances(
		app_id=''
)

Response:

{
    "Result": [
        {
            "Id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "Name": "Development",
            "Description": "Default group",
            "Status": "Active",
            "InviteCode": "XXXXXX",
            "AppId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "AppName": "Ghost App",
            "CompanyId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        },
        {
            "Id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "Name": "Test",
            "Description": "test enviroment",
            "Status": "Active",
            "InviteCode": "XXXXXX",
            "AppId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "AppName": "Ghost App",
            "CompanyId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        }
    ],
    "Status": 200,
    "Title": "",
    "Errors": []
}

get_instance_details

Retrieve information about the instance

Parameters

  • instance_id: ID of the instance/User group

Request:

instance = account.get_instance_details(
		instance_id=''
)

Response:

{
    "Result": {
        "Id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "Name": "Development",
        "Description": "Default group",
        "Status": "Active",
        "InviteCode": "XXXXXX",
        "AppId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "AppName": "Ghost App",
        "CompanyId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    },
    "Status": 200,
    "Title": "",
    "Errors": []
}

get_instance_details_by_invite_code

Retrieve information about the instance

Parameters

  • app_id: ID of the instance/User group
  • invite_code: unique code that app users can use to join an instance/ user group

Request:

instance = account.get_instance_details(
		app_id='',
  	invite_code=''
)

Request:

{
    "Result": {
        "Id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "Key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "Name": "Development",
        "Description": "Default group",
        "Status": "Active",
        "InviteCode": "XXXXXX",
        "AppId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "AppName": "Ghost App",
        "CompanyId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    },
    "Status": 200,
    "Title": "",
    "Errors": []
}

update_instance_details

Retrieve details of the instance

Parameters

  • instance_id
  • status
  • name
  • description

Request:

instance = account.update_instance_details(
		instance_id='',
    status=1,
    name='',
    description-''
    )

Response:

{
  "status": 0,
  "title": "string",
  "errors": [
    {
      "key": "string",
      "message": "string"
    }
  ]
}

delete_instance

Delete the instance.

Parameters

  • instance_id: ID of the application

Request:

instance=account.delete_instance(
  instance_id=''
  )

Response:

{
  "status": 0,
  "title": "string",
  "errors": [
    {
      "key": "string",
      "message": "string"
    }
  ]
}