Use phone variable on {iccid} field on SMS API

Dsuarez5 months ago

Hi,

one question:

May I know what is the phone number variable on traccar? is {phone} ?

I have the below script and i would like to put on {iccid} on the second line the phone number belongs to each device.

 entry key='notificator.types'>traccar,Command,web,sms,mail</entry
 entry key='sms.http.url'>https://api.1nce.com/management-api/v1/sims/{iccid}/sms</entry
 entry key='sms.http.method'>POST</entry
 entry key='sms.http.authorization'>Bearer x.x.x.x.x.x.x.x</entry
 entry key='sms.http.template'
 {
 "source_address": "12345678",
 "payload": "{message}"
 }
 </entry>

phone.JPG

How can I add to the scrip that variable "phone"?

I was thinking something like:

 "iccid": "{phone}",

however, i would like to make sure that the phone number is storage in variable phone if not can you tell me what is the correct name for that variable? and is possible to add according to my idea?

Thank you for your help.

Anton Tananaev5 months ago

You can't use placeholders in the URL. But the variable is {phone} if you want to use it in the payload.

Dsuarez4 months ago

Thank you so much for your reply.