Clicksend troubleshooting

Anders15 days ago

I cant get clicksend to work, after updating templates I dont get any error messages but no sms is sent. I got this from the ClickSend support. Perhaps Anton can see if the api follow what support writes

Here are some troubleshooting steps to try:

  1. Check Your API Request Payload

Ensure that the payload sent to ClickSend's API includes a properly formatted messages array. A typical ClickSend SMS API payload looks like this:

json

Copy code

{

"messages": [

{

"to": "UK number here",

"from": "+35..."

"body": "Your GPS notification message here."

}

]

}

Verify:

The to field contains a valid phone number, including the country code and plus sign

The body field contains the message text.

  1. Debug the Traccar Notification Settings

Traccar must be configured to send the correct payload to the ClickSend API. Verify the following:

In the Traccar configuration (traccar.xml or through the web interface), ensure the notification settings are correctly set for SMS notifications.

The API URL for ClickSend should match their documentation (e.g., https://rest.clicksend.com/v3/sms/send).

Ensure that the notification template or logic in Traccar is generating a message to populate the messages array.

  1. Logging and Debugging

Enable logging in Traccar to inspect the outgoing API request. This will show you what Traccar is sending to ClickSend. Look specifically for:

Whether the messages array exists in the payload.

Whether it has at least one message.

Traccar logs can typically be found in the logs directory in your Traccar installation. The error trace (HttpSmsClient:99 < NotificatorSms:48 < Notificator:39 < NotificationResource:107) indicates the issue is happening at the point of constructing or sending the SMS notification.

  1. Validate ClickSend Credentials

Ensure that the API key and other credentials are correct in the Traccar configuration. Invalid credentials might result in unexpected errors.

  1. Test with a Direct API Request

Before troubleshooting the integration, you can send a direct request to ClickSend using a tool like Postman. Example:

POST https://rest.clicksend.com/v3/sms/send

For the authorization use your username (anders@xxx) and API key (A4A990FF-D8AB-94ED-6416-920803EE8134)

{

"messages": [

{

"body":"test message from Click send tech support",

"to": "UK number",

"from": "+35..."

 

}

]

}

If this works, the issue lies within the Traccar integration.

  1. Ensure Proper Integration Logic

The error could occur if:

No GPS tracker event is triggering the notification.

The event data isn't properly converted into an SMS message by Traccar.

Verify the configuration for your GPS tracker events in Traccar to ensure:

Notifications are enabled for the events you're tracking.

  1. Update or Patch Software

If you are using outdated versions of Traccar or the ClickSend API, update both to ensure compatibility.

The notifications are linked to the ClickSend SMS method.