Custom event attributes

jeorryb8 years ago

Is it possible to tag events with a custom attribute. We are using a device for a proof of concept and we will be issuing the same device to different drivers at certain times. Is there a way to assign events to one driver and then when we issue it to another driver change an attribute for events going forward?

Anton Tananaev8 years ago

Just use different devices (in the database) for different drivers.

jeorryb8 years ago

Ok, so there won't be any issues if we add the same device with a different name and the same EIN ?

Anton Tananaev8 years ago

Well, you need to change unique id to the real one when you assign device to a particular driver.

Fergal Powell5 years ago

Hello,

We are hoping to use a custom event attribute to store notes about an event. We were hoping to achieve this by using the Traccar API to update the event with a new attribute "notes" which would take a string from user input in our custom app. Unfortunately it looks like from the API documentation that the PUT method is not allowed with events.

I thought that instead I would store these notes in an event_notes array in the device attributes with a reference to the event ID. Has anybody done something similar or has a better idea?

Thanks,
Fergal

Anton Tananaev5 years ago

That's a bad idea. Attributes have a limited length.

Fergal Powell5 years ago

I was thinking of storing an object something like this: {"id": event.id, "answered": true, "notes": "Fergal says false alarm"} inside an events array in device attributes.

How many object would be able to be stored like that?

Anton Tananaev5 years ago

Check column limit in the database.

Fergal Powell5 years ago

Okay actually I know that NotificationTokens, in the user attributes, can only store up to around 25 firebase tokens.

So you are right it's not good idea to store them in list in device attributes. However it would work ok if there was a way to update the event attribute with the API.

Can you think of any work around that might help solve this?

Thanks,
Fergal

Fergal Powell5 years ago

Each object I will store in device attributes is 100 char long. I checked the db column length and it is 4000 varchar. So as long as I limit storing up to 30 objects (just to be safe) in the attributes should everything be fine? Our trackers don't store any data in the device attributes. Do you see any problem in doing this as long as it is limited?