I have added a device with the admin user and given permission for this device to a standard user. I have logged into Traccar with that user and can see the device. The user does not have 'limit commands' option turned on.
I want to create about 5 of my own commands, ideally through the admin user and then have the standard user be able to run them (without adding that command to every device - or by using a group, because each user should only be able to see their own single device). I tried running an existing saved command created by the admin user:
POST: https://mydomain.com/api/commands/send
BODY:
{
"id": 1
}
400:
Manager access required - SecurityException (PermissionsManager:178 < *:308 < CommandResource:64 < ...)
So instead I create my own version of the command (which as I say, I don't really want to do 50 times, on each device or user) but just to see if this would work:
POST: https://mydomain.com/api/commands
BODY:
{
"deviceId": 1,
"description": "[3G*8809001383*0008*POWEROFF]",
"type": "custom"
}
200:
{
"id": 5,
"attributes": {},
"deviceId": 1,
"type": "custom",
"textChannel": false,
"description": "[3G*8809001383*0008*POWEROFF]"
}
I double check it has been added:
GET: https://mydomain.com/api/commands
200:
[
{
"id": 5,
"attributes": {},
"deviceId": 1,
"type": "custom",
"textChannel": false,
"description": "[3G*8809001383*0008*POWEROFF]"
}
]
I try to run it:
POST: https://mydomain.com/api/commands/send
BODY: {
"id": 5
}
400:
Manager access required - SecurityException (PermissionsManager:178 < *:308 < CommandResource:64 < ...)
I also tried to just send a command (without saving it first) via that endpoint but it just saves it anyway, and doesn't send it.
I also tried commands/send which returns an empty body - bit confused about that?
GET: https://mydomain.com/api/commands/send?deviceId=1
200:
[]
I tried to update the command I just created:
PUT: https://mydomain.com/api/commands/5
BODY: {
"deviceId": 1
}
400:
Manager access required - SecurityException (PermissionsManager:178 < *:353 < BaseObjectResource:125 < ...)
My questions are;
Looking at the above, how can a standard user run commands please?
Is there a way I can add my custom commands just the once, and have them available to X number of users or do I really need to add those custom commands to every device, or user?
Many thanks.
I have added a device with the admin user and given permission for this device to a standard user. I have logged into Traccar with that user and can see the device. The user does not have 'limit commands' option turned on.
I want to create about 5 of my own commands, ideally through the admin user and then have the standard user be able to run them (without adding that command to every device - or by using a group, because each user should only be able to see their own single device). I tried running an existing saved command created by the admin user:
So instead I create my own version of the command (which as I say, I don't really want to do 50 times, on each device or user) but just to see if this would work:
I double check it has been added:
I try to run it:
I also tried to just send a command (without saving it first) via that endpoint but it just saves it anyway, and doesn't send it.
I also tried commands/send which returns an empty body - bit confused about that?
I tried to update the command I just created:
My questions are;
Looking at the above, how can a standard user run commands please?
Is there a way I can add my custom commands just the once, and have them available to X number of users or do I really need to add those custom commands to every device, or user?
Many thanks.