Contagt Asset Sharing API
Die contagt Asset Sharing API unterstützt sowohl das Live-Location Sharing für Accounts, als auch das Teilen von Assets und statischen Inhalten.
Assets sind dabei immer an Accounts mit der Asset-Permission gekoppelt. Nur Accounts, die eine Asset-Permission haben, können auch Assets erstellen oder einsehen.
Alle im folgenden dargestellten Methoden sind im strict
-Modus.
Creating an Asset
Function Name:
CreateAsset
Request:
{
"userToken": String, // Account Usertoken (not API Usertoken)
"sharedSecret": String, // Account's shared secret
"assetAlias": String, // An Account Alias (a token that will be shared with accounts)
"assetName": String // The name of the Asset
}
Response:
{
"success": true,
"response": {
"CreateAsset": [
"My_Third_Asset2323"
]
}
}
Required Authentication:
API Login, Account Login, Asset Permission
Named Params
true
Deleting an Asset
Function Name:
DeleteAsset
Request:
{
"userToken": String, // Account Usertoken (not API Usertoken)
"sharedSecret": String, // Account's shared secret
"assetAlias": String, // An Account Alias (a token that will be shared with accounts)
}
Response:
{
"success": true,
"response": {
"DeleteAsset": [
true
]
}
}
Required Authentication:
API Login, Account Login, Asset Permission
Named Params
true
Add an Attribute to an Asset
Function Name:
AddAttributeToAsset
Request:
{
"userToken": String, // Account Usertoken (not API Usertoken)
"sharedSecret": String, // Account's shared secret
"assetAlias": String, // An Account Alias (a token that will be shared with accounts)
"attributeName": String, // A Name for the new Attriubte
"attributeValue": String // A Value for that Attribute
}
Response:
{
"success": true,
"response": {
"AddAttributeToAsset": [
true
]
}
}
Required Authentication:
API Login, Account Login, Asset Permission
Named Params
true
Remove an Attribute from an Asset
Function Name:
RemoveAttributeFromAsset
Request:
{
"userToken": String, // Account Usertoken (not API Usertoken)
"sharedSecret": String, // Account's shared secret
"assetAlias": String, // An Account Alias (a token that will be shared with accounts)
"attributeName": String // A Name for the new Attriubte
}
Response:
{
"success": true,
"response": {
"AddAttributeToAsset": true
}
}
Required Authentication:
API Login, Account Login, Asset Permission
Named Params
true
Retrieve all Assets of the Account
This API Method allows the User to retrieve all of its managed Assets.
Function Name:
GetAssetsOfAccount
Request:
{
"userToken": String, // Account Usertoken (not API Usertoken)
"sharedSecret": String // Account's shared secret
}
Response:
{
"success": true,
"response": {
"GetAssetsOfAccount": [
{
"assetAlias": "My_First_Asset",
"assetName": "Mein erstes TestAsset",
"attributes": [],
"location": {
"lat": 49.49876,
"lon": 8.46867,
"building_id": 19,
"root_tag": "10000032",
"floor": 0
},
"remainingMinutes": 0,
"room": [
{
"roomId": 78,
"buildingId": 1,
"floor": 0,
"roomName": "Seminarraum",
"color": "19232D5C",
"bgColor": "ffffffff",
"textColor": "ff000000",
"connectedTag": "bMxa6bwY",
"roomHandle": "00110WVoU2bDFabeGbwuopLvbOQN9XI0Rzomv",
"roomUri": "00110WVoU2bDFabeGbwuopLvbOQN9XI0Rzomv",
"imageUri": null,
"panoramaUri": null,
"panoramaThumbUri": null,
"contentMode": 0,
"externalIdentifier": "",
"statistics": {
"visitors": null
}
}
]
}
]
}
}
Required Authentication:
API Login, Account Login, Asset Permission
Named Params
true
Find an Asset
Function Name:
FindAsset
Request:
{
"userToken": String, // Account Usertoken (not API Usertoken)
"sharedSecret": String, // Account's shared secret
"lat": float, // Latitude
"lon": float, // Longitude
"radius": float, // The maximum Distance the given location can be away from the Asset.
"searchKey": String, // The Fulltext-Searchterm. Searches in Attriutes and Names of Assets
"limit": Int // Maxmimum number of Searchresults
}
Response:
{
"success": true,
"response": {
"FindAsset": [
{
"assetAlias": "My_Third_Asset",
"assetName": "Mein drittes TestAsset",
"attributes": {
"Gemüsekisten": "Gurken und Tomaten"
},
"location": {
"lat": 54.512,
"lon": 8.22,
"building_id": 51,
"root_tag": "CbMYAhkv",
"floor": 0
},
"room": [ // Optional
{
"roomId": 78,
"buildingId": 1,
"floor": 0,
"roomName": "Seminarraum",
"color": "19232D5C",
"bgColor": "ffffffff",
"textColor": "ff000000",
"connectedTag": "bMxa6bwY",
"roomHandle": "00110WVoU2bDFabeGbwuopLvbOQN9XI0Rzomv",
"roomUri": "00110WVoU2bDFabeGbwuopLvbOQN9XI0Rzomv",
"imageUri": null,
"panoramaUri": null,
"panoramaThumbUri": null,
"contentMode": 0,
"externalIdentifier": "",
"statistics": {
"visitors": null
}
}
],
"remainingMinutes": 0,
"distance": 557713.87
}
]
}
}
Required Authentication:
API Login, Account Login, Asset Permission
Named Params
true
Find an Asset in Room
Function Name:
FindAssetInRoom
Request:
{
"userToken": String, // Account Usertoken (not API Usertoken)
"sharedSecret": String, // Account's shared secret
"roomId": Int // Limits the Search to a Single Room
"searchKey": String, // The Fulltext-Searchterm. Searches in Attriutes and Names of Assets
"limit": Int // Maxmimum number of Searchresults
}
Response:
{
"success": true,
"response": {
"FindAssetInRoom": [
{
"assetAlias": "My_Third_Asset",
"assetName": "Mein drittes TestAsset",
"attributes": {
"Gemüsekisten": "Gurken und Tomaten"
},
"location": {
"lat": 54.512,
"lon": 8.22,
"building_id": 51,
"root_tag": "CbMYAhkv",
"floor": 0
},
"room": [ // Optional
{
"roomId": 78,
"buildingId": 1,
"floor": 0,
"roomName": "Seminarraum",
"color": "19232D5C",
"bgColor": "ffffffff",
"textColor": "ff000000",
"connectedTag": "bMxa6bwY",
"roomHandle": "00110WVoU2bDFabeGbwuopLvbOQN9XI0Rzomv",
"roomUri": "00110WVoU2bDFabeGbwuopLvbOQN9XI0Rzomv",
"imageUri": null,
"panoramaUri": null,
"panoramaThumbUri": null,
"contentMode": 0,
"externalIdentifier": "",
"statistics": {
"visitors": null
}
}
],
"remainingMinutes": 0,
"distance": 557713.87
}
]
}
}
Required Authentication:
API Login, Account Login, Asset Permission
Named Params
true
Share Asset
Allows to share an Asset with another account. That account will not be able to modify any asset information.
Function Name:
ShareAsset
Request:
{
"userToken": String, // Account Usertoken (not API Usertoken)
"sharedSecret": String, // Account's shared secret string
"assetAlias": String,
"username": String,
"writeAccess": Boolean // Whether the User can Edit and/or Update the Shares Location or not
}
Response:
{
"success": true,
"response": {
"ShareAsset": [
true
]
}
}
Required Authentication:
API Login, Account Login, Asset Permission
Named Params
true
Unshare Asset
Revokes the Share of an Asset with the defined User.
Function Name:
UnshareAsset
Request:
{
"userToken": String, // Account Usertoken (not API Usertoken)
"sharedSecret": String, // Account's shared secret string
"assetAlias": String
"username": String
}
Response:
{
"success": true,
"response": {
"UnshareAsset": [
true
]
}
}
Required Authentication:
API Login, Account Login, Asset Permission
Named Params
true
Edit SharingToken of Asset
The AssetAlias is a unique and immutable attribute of any asset.
To allow a more dynamic naming and adressing of Assets,
sharingTokens
can be defined and altered with this method.
sharingTokens
are optional and can also be deleted again by sending null
as the new sharingToken
.
After defining a sharingToken
it can be used instead of the assetAlias
on the entire Asset API.
SharingTokens
are also required to be unique within all other tokens
and all assetAlias
, trying to set an already exisiting token will
make the API deny the request. SharingTokens
are AlphaNumeric and use up to 128 characters and must
have a minimal length of four characters.
Function Name:
EditSharingTokenOfAsset
Request:
{
"userToken": String, // Account Usertoken (not API Usertoken)
"sharedSecret": String, // Account's shared secret string
"assetAlias": String, // The Assets original Alias
"sharingToken": String|null // The Assets new SharingToken or null to remove it.
}
Response:
{
"success": true,
"response": {
"EditSharingTokenOfAsset": [
true
]
}
}
Required Authentication:
API Login, Account Login, Asset Permission
Named Params
true
Export Statistical Position Data
Exports the History of any Pintag (Asset,LivelocationShare, etc.)
Function Name:
GetPintagAliasHistory
Request:
{
"pintag": String // Gleich dem Sharing-Alias
"startDate": "01.01.2021 14:18:06", // (Date, UTC)
"endDate": "24.03.2022 14:18:06"// (Date, UTC)
"noAutoScale": true // (optional, when set to true, the scale will always be on minutewise-resolution)
}
Response:
{
"success": true,
"response": {
"GetPintagAliasHistory": [
{
"dayIndx": "344",
"usedYear": "2021",
"currHour": "12",
"currMin": "38",
"lat": "0",
"lon": "0",
"floor": "0",
"building_id": "16",
"est_height": null,
"created_on": "2021-12-10 12:38:05",
"timestamp": "2021-11-30 16:15:27", // The Actual Sample Date
"value": "Fw6w7r1b6n2tugc05oA"
},
{
"dayIndx": "344",
"usedYear": "2021",
"currHour": "13",
"currMin": "6",
"lat": "49.71395",
"lon": "9.12707",
"floor": "0",
"building_id": null,
"est_height": null,
"created_on": "2021-12-10 12:38:05",
"timestamp": "2021-12-10 12:38:32",
"value": "Fw6w7r1b6n2tugc05oA"
}
...
]
}
}
Required Authentication:
API Login
Named Params
true