sms api token

Ray4 years ago

Hello,

I have a few clients that would like to recieve sms when leave geofence. Do i need to add every token in my conf file? Or can i use 1 token and send sms to driver or what is the best way to set this up?

It works if i add a client with new entry and token. But is there a other way?

Greetz Ray

Anton Tananaev4 years ago

What service are you planning to use for sending SMS? You can only configure one API key usually.

Ray4 years ago

Well i use your traccar sms gateway.

I have created 2 users with both a device. and both downloaded traccar sms gateway.
Then i edit traccar.xml with the sms entry code like you explained in documentation.
I now get a message from device 1 and device 2. But when i make a new entry with the other device gateway token then all works good.
Client one recieve a sms and client 2.

But do i need the token from all clients in the future and add them apart in a entry in the xml file? Or is there a better way?

Anton Tananaev4 years ago

Currently you can only use one SMS gateway at a time.

Ray4 years ago

So adding them one by one is the only solution for now?

Anton Tananaev4 years ago

What do you mean? Where and what do you add one by one?

Ray4 years ago

In the traccar.xml i give in the entry code for sms with token from the sms gateway.

I copy paste that and replace my token with a new client token from the sms gateway he downloaded.

When i exit geofence i get sms. When new client exit geofence he gets sms.

So therefor i need to make new entry code for every single client.

I post screenshot tonight.

visiondrive3 years ago

Ray each user should have a mobile/cell phone against their account - the SMS sending is to that number when the alerting for geofence in/out is enabled for the device(s) that they have access to

Ray3 years ago

Yes, but if i put there number to there account they do not get a sms. When i add the token from traccar sms gateway. They do. So for every client i need to add a new token to my conf. File. Right??

visiondrive3 years ago

The only token for use is from your account on the traccar website as noted in the doco - that token is displayed in your profile in My Account on the traccar website

Then you still need to configure the SMS API which by the sounds of it you have already done.

Traccar SMS Gateway

Replace TOKEN with the token from the app. If you want to connect to you phone directly, replace URL with the URL from the app and use API key instead of token.

<entry key='notificator.types'>web,mail,sms</entry>
<entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
<entry key='sms.http.url'>https://www.traccar.org/sms/</entry>
<entry key='sms.http.authorization'>TOKEN</entry>
<entry key='sms.http.template'>
    {
        "to": "{phone}",
        "message": "{message}"
    }
</entry>
Ray3 years ago

Hello sorry for my very late response. Family issues.

@Vision drive

So if i use api key. I do not need traccar sms app?

Ray3 years ago

My setup is now like this. With arduino i made a alarm system. What i would like if a powercut from a device is raised. I would like to recieve a sms to my arduino. What would be the best way to achive this?

Erick2 years ago

I am a little confused,

<entry key='sms.http.authorization'>TOKEN</entry>

Where i can get or find this TOKEN?

Hope you can help.

Anton Tananaev2 years ago

In the app.