traccar sms configuration format

kang the conqueror5 months ago

hello, need some help i try add sms notification but still getting error
this is sample api

curl --location --request POST 'http://smsidad.us/api/message' \
    --header 'Authorization: Bearer your_secret_token' \
    --form 'phone="628950000000"' \
    --form 'message="Hello' \
    --form 'type="text"'

this what i have try but still does not work

<entry key='sms.http.url'>http://smsidad.usapi/message</entry>
<entry key='sms.http.authorization'>Bearer 51f0370a64ZXXXXXXXXXXX</entry>
<entry key='sms.http.user'>[YOUR ACCOUNT SID]</entry>
<entry key='sms.http.password'>[YOUR AUTH TOKEN]</entry>
<entry key='sms.http.template'>
{
'phone="{phone}"'
'message="{message}"'
'type="text"'
}
</entry>
Anton Tananaev5 months ago

It seems like you are sending payload as a form in curl example, but then you configured Traccar to upload in JSON format. Can you explain?

kang the conqueror5 months ago

thanks for answer.

  • this is another sample api:
curl -X POST -H "Authorization: Bearer 51f0370a64ZXXXXXXXXXXX" \
 -d 'phone=628950000000' \
 -d 'message=Hello' \
 -d 'type=text' \
 http://smsidad.us/api/message

what is the proper traccar configuration for the example api?

Anton Tananaev5 months ago

Something like this:

<entry key='sms.http.url'>http://smsidad.usapi/message</entry>
<entry key='sms.http.authorization'>Bearer 51f0370a64ZXXXXXXXXXXX</entry>
<entry key='sms.http.user'>[YOUR ACCOUNT SID]</entry>
<entry key='sms.http.password'>[YOUR AUTH TOKEN]</entry>
<entry key='sms.http.template'>
type=text&amp;phone={phone}&amp;message={message}
</entry>

P.S. Can you please use proper markdown formatting. If you want to format code, the 3 back-ticks should be on their own separate lines, like in the example we provide.