Accounts Resource

GET /accounts

Returns the list of all the Accounts visible to the currently connected user.

Response Body
media type data type description
application/json AccountsResult (JSON) The list of requested Account objects.
application/xml accountsResult (XML)

Example

Request
GET /accounts
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "account" : [ {
    "id" : 12345,
    "name" : "...",
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "organization" : {
      "name" : "...",
      "personName" : "...",
      "email" : "...",
      "phoneNumber" : "...",
      "addressLine1" : "...",
      "addressLine2" : "...",
      "addressLine3" : "...",
      "zipPostCode" : "...",
      "city" : "...",
      "stateProvinceCounty" : "...",
      "country" : "..."
    },
    "parentAccountId" : 12345,
    "parentAccountPath" : "...",
    "optlock" : 12345
  }, {
    "id" : 12345,
    "name" : "...",
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "organization" : {
      "name" : "...",
      "personName" : "...",
      "email" : "...",
      "phoneNumber" : "...",
      "addressLine1" : "...",
      "addressLine2" : "...",
      "addressLine3" : "...",
      "zipPostCode" : "...",
      "city" : "...",
      "stateProvinceCounty" : "...",
      "country" : "..."
    },
    "parentAccountId" : 12345,
    "parentAccountPath" : "...",
    "optlock" : 12345
  } ]
}
                
              

POST /accounts

Creates a new Account based on the information provided in AccountCreator parameter.

Request Body
media type data type description
application/xml accountCreator (XML) Provides the information for the new Account to be created.
Response Body
media type data type description
application/xml account (XML) The newly created Account object.

Example

Request
POST /accounts
Content-Type: application/xml
Accept: application/xml

                
<accountCreator xmlns="http://eurotech.com/edc/2.0">
  <accountName>...</accountName>
  <accountPassword>...</accountPassword>
  <organizationName>...</organizationName>
  <organizationPersonName>...</organizationPersonName>
  <organizationEmail>...</organizationEmail>
  <organizationPhoneNumber>...</organizationPhoneNumber>
  <organizationAddressLine1>...</organizationAddressLine1>
  <organizationAddressLine2>...</organizationAddressLine2>
  <organizationCity>...</organizationCity>
  <organizationZipPostCode>...</organizationZipPostCode>
  <organizationStateProvinceCounty>...</organizationStateProvinceCounty>
  <organizationCountry>...</organizationCountry>
  <parentAccountId>...</parentAccountId>
  <parentAccountTree>...</parentAccountTree>
  <expirationDate>...</expirationDate>
  <maxNumberOfDevices>...</maxNumberOfDevices>
  <maxNumberOfRules>...</maxNumberOfRules>
  <maxNumberChildAccounts>...</maxNumberChildAccounts>
  <maxNumberVpnConnections>...</maxNumberVpnConnections>
  <maxNumberDeviceJobs>...</maxNumberDeviceJobs>
  <maxNumberProvisionRequests>...</maxNumberProvisionRequests>
  <txByteLimit>...</txByteLimit>
  <rxByteLimit>...</rxByteLimit>
  <dataStorageEnabled>...</dataStorageEnabled>
  <dataTimeToLive>...</dataTimeToLive>
  <dataIndexBy>...</dataIndexBy>
  <auditEnabled>...</auditEnabled>
  <lockoutPolicyEnabled>...</lockoutPolicyEnabled>
  <lockoutPolicyMaxFailures>...</lockoutPolicyMaxFailures>
  <lockoutPolicyResetAfter>...</lockoutPolicyResetAfter>
  <lockoutPolicyLockDuration>...</lockoutPolicyLockDuration>
  <vpnServerId>...</vpnServerId>
  <useLegacyBroker>...</useLegacyBroker>
  <metricsIndexBy>...</metricsIndexBy>
  <simpleConnection>...</simpleConnection>
  <sslConnection>...</sslConnection>
  <mutualSslConnection>...</mutualSslConnection>
  <healthCheckInterval>...</healthCheckInterval>
  <mqttThreshold>...</mqttThreshold>
  <restThreshold>...</restThreshold>
  <restCommandThreshold>...</restCommandThreshold>
  <devNewAllowUnprovisioned>...</devNewAllowUnprovisioned>
  <devDefaultCredentialsTight>...</devDefaultCredentialsTight>
  <brokerClusterId>...</brokerClusterId>
  <createDnsEntry>...</createDnsEntry>
  <metricsIdxTimeToLive>...</metricsIdxTimeToLive>
</accountCreator>

                
              
Response
HTTP/1.1 201 Created
Content-Type: application/xml

                
<account xmlns="http://eurotech.com/edc/2.0">
  <id>...</id>
  <name>...</name>
  <createdOn>...</createdOn>
  <createdBy>...</createdBy>
  <modifiedOn>...</modifiedOn>
  <modifiedBy>...</modifiedBy>
  <organization>
    <name>...</name>
    <personName>...</personName>
    <email>...</email>
    <phoneNumber>...</phoneNumber>
    <addressLine1>...</addressLine1>
    <addressLine2>...</addressLine2>
    <addressLine3>...</addressLine3>
    <zipPostCode>...</zipPostCode>
    <city>...</city>
    <stateProvinceCounty>...</stateProvinceCounty>
    <country>...</country>
  </organization>
  <parentAccountId>...</parentAccountId>
  <parentAccountPath>...</parentAccountPath>
  <optlock>...</optlock>
</account>

                
              

DELETE /accounts/{accountId}

Deletes the Account specified by the "id" path parameter.

Request Parameters
name type description constraints
accountId path The id of the Account to be deleted. long

Example

Request
DELETE /accounts/{accountId}
Content-Type: */*

                
...
                
              
Response
HTTP/1.1 204 No Content

              

GET /accounts/{accountId}

Returns the Account specified by the "id" path parameter.

Request Parameters
name type description constraints
accountId path The id of the Account requested. long
Response Body
media type data type description
application/json Account (JSON) The requested Account object.
application/xml account (XML)

Example

Request
GET /accounts/{accountId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "id" : 12345,
  "name" : "...",
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "organization" : {
    "name" : "...",
    "personName" : "...",
    "email" : "...",
    "phoneNumber" : "...",
    "addressLine1" : "...",
    "addressLine2" : "...",
    "addressLine3" : "...",
    "zipPostCode" : "...",
    "city" : "...",
    "stateProvinceCounty" : "...",
    "country" : "..."
  },
  "parentAccountId" : 12345,
  "parentAccountPath" : "...",
  "optlock" : 12345
}
                
              

PUT /accounts/{accountId}

Updates the Account specified by the "id" path parameter based on the information provided in the Account parameter.

Request Parameters
name type description constraints
accountId path The id of the Account to be updated. long
Request Body
media type data type description
application/xml account (XML) The modified Account whose attributed need to be updated.
Response Body
media type data type description
application/xml account (XML) The updated account.

Example

Request
PUT /accounts/{accountId}
Content-Type: application/xml
Accept: application/xml

                
<account xmlns="http://eurotech.com/edc/2.0">
  <id>...</id>
  <name>...</name>
  <createdOn>...</createdOn>
  <createdBy>...</createdBy>
  <modifiedOn>...</modifiedOn>
  <modifiedBy>...</modifiedBy>
  <organization>
    <name>...</name>
    <personName>...</personName>
    <email>...</email>
    <phoneNumber>...</phoneNumber>
    <addressLine1>...</addressLine1>
    <addressLine2>...</addressLine2>
    <addressLine3>...</addressLine3>
    <zipPostCode>...</zipPostCode>
    <city>...</city>
    <stateProvinceCounty>...</stateProvinceCounty>
    <country>...</country>
  </organization>
  <parentAccountId>...</parentAccountId>
  <parentAccountPath>...</parentAccountPath>
  <optlock>...</optlock>
</account>

                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/xml

                
<account xmlns="http://eurotech.com/edc/2.0">
  <id>...</id>
  <name>...</name>
  <createdOn>...</createdOn>
  <createdBy>...</createdBy>
  <modifiedOn>...</modifiedOn>
  <modifiedBy>...</modifiedBy>
  <organization>
    <name>...</name>
    <personName>...</personName>
    <email>...</email>
    <phoneNumber>...</phoneNumber>
    <addressLine1>...</addressLine1>
    <addressLine2>...</addressLine2>
    <addressLine3>...</addressLine3>
    <zipPostCode>...</zipPostCode>
    <city>...</city>
    <stateProvinceCounty>...</stateProvinceCounty>
    <country>...</country>
  </organization>
  <parentAccountId>...</parentAccountId>
  <parentAccountPath>...</parentAccountPath>
  <optlock>...</optlock>
</account>

                
              

GET /accounts/{accountId}/childAccounts

Returns the list of all direct child accounts for the Account specified by the "id" path parameter.

Request Parameters
name type description default constraints
accountId path The id of the Account requested.   long
recoursive query false boolean
Response Body
media type data type description
application/json AccountsResult (JSON) The requested list of child accounts.
application/xml accountsResult (XML)

Example

Request
GET /accounts/{accountId}/childAccounts
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "account" : [ {
    "id" : 12345,
    "name" : "...",
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "organization" : {
      "name" : "...",
      "personName" : "...",
      "email" : "...",
      "phoneNumber" : "...",
      "addressLine1" : "...",
      "addressLine2" : "...",
      "addressLine3" : "...",
      "zipPostCode" : "...",
      "city" : "...",
      "stateProvinceCounty" : "...",
      "country" : "..."
    },
    "parentAccountId" : 12345,
    "parentAccountPath" : "...",
    "optlock" : 12345
  }, {
    "id" : 12345,
    "name" : "...",
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "organization" : {
      "name" : "...",
      "personName" : "...",
      "email" : "...",
      "phoneNumber" : "...",
      "addressLine1" : "...",
      "addressLine2" : "...",
      "addressLine3" : "...",
      "zipPostCode" : "...",
      "city" : "...",
      "stateProvinceCounty" : "...",
      "country" : "..."
    },
    "parentAccountId" : 12345,
    "parentAccountPath" : "...",
    "optlock" : 12345
  } ]
}
                
              

GET /accounts/{accountId}/servicePlan

Returns the Service Plan for the Account specified by the "id" path parameter.

Request Parameters
name type description constraints
accountId path The id of the Account for which the Service Plan is requested. long
Response Body
media type data type description
application/json AccountServicePlan (JSON) The requested AccountServicePlan object.
application/xml accountServicePlan (XML)

Example

Request
GET /accounts/{accountId}/servicePlan
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "accountId" : 12345,
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "status" : "BEING_PROVISIONED",
  "provisioningStatus" : "FAILED",
  "expirationDate" : 12345,
  "maxNumberOfDevices" : 12345,
  "maxNumberOfRules" : 12345,
  "maxNumberChildAccounts" : 12345,
  "maxNumberVpnConnections" : 12345,
  "txByteLimit" : 12345,
  "rxByteLimit" : 12345,
  "dataStorageEnabled" : true,
  "dataTimeToLive" : 12345,
  "dataIndexBy" : "DEVICE_TIMESTAMP",
  "auditEnabled" : true,
  "lockoutPolicy" : {
    "enabled" : true,
    "maxLoginFailures" : 12345,
    "loginResetAfter" : 12345,
    "lockDuration" : 12345
  },
  "metricsIndexBy" : "TIMESTAMP",
  "maxNumberProvisionRequests" : 12345,
  "maxNumberDeviceJobs" : 12345,
  "healthCheckInterval" : 12345,
  "mqttThreshold" : 12345,
  "restThreshold" : 12345,
  "restCommandThreshold" : 12345,
  "devNewAllowUnprovisioned" : true,
  "devDefaultCredentialsTight" : "STRICT",
  "metricsIdxTimeToLive" : 12345
}
                
              

GET /accounts/{accountId}/usageByDay

Returns the daily usage for the Account specified by the "id" path parameter.

Request Parameters
name type description default constraints
accountId path The id of the Account for which the usage is requested.   long
endDate query End date of the date range requested. The parameter is expressed as a long counting the number of milliseconds since January 1, 1970, 00:00:00 GMT. The default value of 0 means no end date. Alternatively, the date can be expressed as a string following the ISO 8601 format. 0  
limit query Maximum number of entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. 50 int
offset query Starting offset for the entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. 0 int
startDate query Start date of the date range requested. The parameter is expressed as a long counting the number of milliseconds since January 1, 1970, 00:00:00 GMT. The default value of 0 means no start date. Alternatively, the date can be expressed as a string following the ISO 8601 format. 0  
Response Body
media type data type description
application/json UsageResult (JSON) The requested UsageResult object.
application/xml usageResult (XML)

Example

Request
GET /accounts/{accountId}/usageByDay
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "usage" : [ {
    "timestamp" : 12345,
    "usage" : 12345
  }, {
    "timestamp" : 12345,
    "usage" : 12345
  } ]
}
                
              

GET /accounts/{accountId}/usageByHour

Returns the usage for the Account specified by the "id" path parameter.

Request Parameters
name type description default constraints
accountId path The id of the Account for which the usage is requested.   long
endDate query End date of the date range requested. The parameter is expressed as a long counting the number of milliseconds since January 1, 1970, 00:00:00 GMT. The default value of 0 means no end date. Alternatively, the date can be expressed as a string following the ISO 8601 format. 0  
limit query Maximum number of entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. 50 int
offset query Starting offset for the entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. 0 int
startDate query Start date of the date range requested. The parameter is expressed as a long counting the number of milliseconds since January 1, 1970, 00:00:00 GMT. The default value of 0 means no start date. Alternatively, the date can be expressed as a string following the ISO 8601 format. 0  
Response Body
media type data type description
application/json UsageResult (JSON) The requested UsageResult object.
application/xml usageResult (XML)

Example

Request
GET /accounts/{accountId}/usageByHour
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "usage" : [ {
    "timestamp" : 12345,
    "usage" : 12345
  }, {
    "timestamp" : 12345,
    "usage" : 12345
  } ]
}
                
              

GET /accounts/{accountId}/devices/count

Returns the number of currently connected devices for the specified account.

Request Parameters
name type description constraints
accountId path The id of the Account. long
Response Body
media type data type description
application/json CountResult (JSON) The requested DeviceCountResult object.
application/xml countResult (XML)

Example

Request
GET /accounts/{accountId}/devices/count
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "count" : 12345
}