Zum Hauptinhalt springen

Contagt Location Sharing API

Die Location Sharing API erlaubt es Positionen auf Shares zu schreiben und von diesen zu lesen. Dabei ist es unerheblich ob es sich um Assets oder Live Location Shares handelt.

Um auf Assets schreiben zu können, muss der Account eine entsprechende Berechtigung im Generellen und Zugriff auf das einzelne Asset im Speziellen haben.

Ansonsten wird der Zugriff von der API abgelehnt.

Sharing und Request Aufrufe

Share Location

Function Name:

ShareLocation

Request:

 {
"userToken": String, // Account Usertoken (not API Usertoken)
"sharedSecret": String, // Account's shared secret
"lat" float,
"lon" float,
"alias": String, // The Asset's alias
"description": String, // Optional
"building_id": int, // Optional
"floor": int, // Optional
"validForMinutes": int // Optional, defaults to 60 (irrelevant for Assets)
"forceRecreate": Boolean // Defaults to false (irrelevant for Assets)
}

Response:

{
"success": true,
"response": {
"ShareLocation": [
{
"pintag": "63ob42v8gj",
"alias": "My_Third_Asset"
}
]
}
}

Required Authentication:

API Login, Account Login

Named Params

true

Request Shared Location

Function Name:

RequestSharedLocation

Request:

 {
"userToken": String,
"sharedSecret": String,
"alias": String,
"waitForUpdate": Bool // Defines wether we want to wait for the next update, the request will be held open until a new location is published
}

Response:

{
"success": true,
"response": {
"Login": [
{
"userToken": "TYnfb0N5JaXK2tgh7FehGsI94Nxr9qU6"
}
],
"RequestSharedLocation": [
{
"location": {
"lat": 49.49877,
"lon": 8.46878,
"building_id": 19,
"root_tag": "10000032",
"floor": 0
},
"account": {
"account_id": 52,
"username": "stephan",
"firstname": "Stephan",
"lastname": "Brandt",
"email": "stephan@contagt.com",
"birthday": "2010-10-10 00:00:00",
"twitter": "twitter",
"facebook": "",
"instagram": "",
"linkedin": "linkedin",
"xing": "xing",
"skype": "braandl",
"teams": "",
"zoom": "",
"biography": "Stephan was known to be pwnsome"
},
"remainingMinutes": 0
}
]
}
}

Required Authentication:

API Login, Account Login

Named Params

true

Unshare a published Location

Function Name:

UnshareLocation

Request:

 {
"userToken": String,
"sharedSecret": String,
"alias": String,
}

Response:

{
"success": true,
"response": {
"Login": [
{
"userToken": "TYnfb0N5JaXK2tgh7FehGsI94Nxr9qU6"
}
],
"UnshareLocation": [
true
]
}
}

Required Authentication:

API Login, Account Login

Named Params

true