It is possible that a new feature is added to Servitly or an existing one is updated, causing a change in the public API set.
In these cases, the affected API is versioned, and the previous one is deprecated, allowing consumers to keep working without disservice until they will be updated.
This page reports all the deprecated features and API and how to perform the porting to the latest version.
Data Export API
The API used to export data of a single thing has been deprecated and replaced by the new bulk data export API.
If you are using these end-points:
/data/exports
/data/exports/{export-uuid}
you must migrate to the new end-points:
/data/dataExports
/data/dataExports/{exportId}
Note that the request payload and responses are different, you can find the full reference of the new API endpoints in the REST API Reference article, under the Data Export section.
Active/Historical Work Session List Widgets V1
The old Active and Historical list widgets have been deprecated, you can continue to use them, but they will no longer be supported.
You must use the new version, and to migrate the templates, simply add the suffix "-v2" to the widget tag.
<active-work-session-list-widget> --> <active-work-session-list-widget-v2>
<historical-work-session-list-widget> --> <historical-work-session-list-widget-v2>
For more details, you can refer to the widget documentation pages:
Note that from now on, when you open the Design view of the template editor, the old widgets will be recognized as custom HTML.
Delta Metrics
Delta metrics used to save increment values of another metric are no longer available in the Console. Instead of Delta metrics, you must use only absolute metrics (continuously increasing) and use the DELTA with a specific timeframe when printing the metric value.
For instance, in a time-series-chart widget, you can display the Daily Consumption by referencing the Total Consumption metric with the DELTA_DAYS_1 aggregation.
Tabs Widget
The tabs widget has been deprecated and will be removed starting from Servitly 1.140.
Instead of the <tabs> widget, you can use the <mat-tab-group>, which is a standard Angular component.
OLD TEMPLATE
<tabs>
<tab name="general" title="General"></tab>
<tab name="documentation" title="Documentation"></tab>
</tabs>
NEW TEMPLATE
<mat-tab-group>
<mat-tab label="General">
<ng-template matTabContent>
<include-template name="general"></include-template>
</ng-template>
</mat-tab>
<mat-tab label="Documentation">
<ng-template matTabContent>
<include-template name="documentation"></include-template>
</ng-template>
</mat-tab>
</mat-tab-group>
Into each <mat-tab> you can also directly embed the content without using another template (<include-template>).
The conversion of the already present templates will be automatically performed when the new version is released. Where possible the conversion will create tab elements on the page (first-level tab only).
As described by the Angular Material documentation, the ng-template tag is not strictly necessary, but it is recommended in case the included template, or inline-defined content is complex. If it is missing, unexpected or incomplete page refreshes can occur.
Thing Count property
The customer and location objects were enriched with the number of underlying things. This count was stored as a first-level field of the customer or location object.
{
"name": "Acme",
"properties": {...},
"thingCount": 21
}
Starting from the 1.135 version (24th January 2022), the thingCount property has been removed and replaced with an explicitly defined property mapped on the thingCount statistic.
As a standard property, the new thingCount property is stored in the properties node.
{
"name": "Acme",
"properties": {
"thingCount": 21
}
}
The new thingCount property can then be displayed in this way.
<customer-list-widget-v2>
<property name="name"></property>
<property name="properties.thingCount"></property>
</customer-list-widget-v2>
Subscriptions management API
The way Subscriptions are managed has been reviewed due to the introduction of the 3D Secure payment method.
The subscription details for Service Plans and Services were saved as sub-nodes directly under the Thing or Customer objects.
{ "id": "123445", "name": "Oven-123", "subscription":{ "serviceLevelId": "456789", "serviceLevel": {"id": "456789", "name": "Premium"}, "endTimestamp": 1637322094000 }, "serviceSubscriptions": [{"serviceId": "876564", "service": "24 Hours Repair"}], "serviceLevel": {"id": "456789", "name": "Premium"} }
The new Stripe subscriptions management has added more control attributes, which has required promoting these sub-nodes to a first-level entity, called Subscription.
The property thing.subscription.endTimestamp has been moved to thing.cloudExpireDate.
The "subscription" and "serviceSubscriptions" nodes have been removed in favor of the new Subscription entity.
Instead of reading/updating things, now subscriptions management is made through the following end-points:
-
GET /inventory/subscriptions
-
POST /inventory/subscriptions
-
GET /inventory/subscriptions/{subscriptionId}
-
PUT /inventory/subscriptions/{subscriptionId}
-
DELETE /inventory/subscriptions/{subscriptionId}
Refer to the REST API Reference page for more details.
Comments
0 comments
Please sign in to leave a comment.