LINE Notify

Theerayuttu 2 years ago

Can we config notifications type for "LINE notify", traccar can support or not?

this is example a template format for sending message

{
       ["Authorization"] = "Bearer "<access_token>,
       ["Content-Type"] = "application/x-www-form-urlencoded",
       ["Content-Length"] = "{message}"
}

API document:
LINE Notify API Document

Anton Tananaev 2 years ago

I think it should be possible to configure using this:

https://www.traccar.org/http-sms-api/

Theerayuttu 2 years ago

Thank you Anton, I will to try it.

Theerayuttu 2 years ago

Hi Anton,
I have set the config file per below

<entry key='notificator.types'>web,mail,sms</entry>
<entry key='sms.http.url'>https://notify-api.line.me/api/notify</entry>
<entry key='sms.http.authorization'>Bearer b8b0Cle3--------------------------------</entry>
<entry key='sms.http.template'>
        Content-Type: application/x-www-form-urlencoded
        message:{message}
</entry> 

and then restart service again. and I have to click test channel SMS message on Notifications page. but It doesn't work and no any data in logs file.

I have try to coding http post (coding on Postman) it able to sent it per this script:

POST /api/notify HTTP/1.1
Host: notify-api.line.me
Authorization: Bearer b8b0Cle3-------------------------------
Content-Type: application/x-www-form-urlencoded
Content-Length: 21
message="test send message"

Could you please help to guide me. is the config correct?

Anton Tananaev 2 years ago

Definitely doesn't look right.

Theerayuttu 2 years ago

Do you mean traccar is not support?

Anton Tananaev 2 years ago

No, your configuration looks invalid.

Theerayuttu 2 years ago

Oh Sorry. Can you guide me, how to set config.
Thank you.

Anton Tananaev 2 years ago

Probably you need something like this:

<entry key='notificator.types'>web,mail,sms</entry>
<entry key='sms.http.url'>https://notify-api.line.me/api/notify</entry>
<entry key='sms.http.authorization'>Bearer ...</entry>
<entry key='sms.http.template'>
message={message}
</entry>
Theerayuttu 2 years ago

I already config it but still doesn't work. how can I check the response?
it no report about notify message in logs file.